Re: Newline inserted?
am 24.10.2005 22:40:59 von mdougherYou seem to have a single quote in the text.
You might want to use $dbh->quote($_) instead of qq.
Matt Dougherty
On Mon, 24 Oct 2005 13:01:14 -0500, Ward.P.Fontenot wrote
> I have the following sql insert statement in a file:
>
> INSERT INTO message(FULLDATE,HOSTNAME,FACILITY,PRIORITY,MESSAGE,SHA1)
> VALUES('2005-Oct-18 11:53:21','pkitest.wellsfargo.com','auth
> ','info','su(pam_unix)[3638]: session opened for user oracle by
> root(uid=0)','H4vgmf+OJsT99kCfQuIpALY7k9k=');
>
> When I attempt to load this file into Oracle 10g using the DBI I get
> the following error:
>
> DBD::Oracle::st execute failed: ORA-00911: invalid character (DBD ERROR:
> error possibly near <*> indicator at char 238 in 'INSERT INTO
> message(FULLDATE,HOSTNAME,FACILITY,PRIORITY,MESSAGE,SHA1)
> VALUES('2005-Oct-18
> 11:53:21','pkitest.wellsfargo.com','auth','info','su(pam_uni x)[3638]:
> session opened for user oracle by
> root(uid=0)','H4vgmf+OJsT99kCfQuIpALY7k9k=')<*>;')
>
> This is the code that loads this file:
>
> while (
> chomp;
> $sql = qq{$_};
>
> $sth = $dbh->prepare($sql); # Should these be outside the loop?
> $sth->execute();
> }
>
> Od -cx FILENAME shows a "\n" character at the <*> point in the above
> file. VI -b does not. Is this a known issue with DBI and 10g or am I
> overlooking something?
>
> Paul Fontenot
> WFS - CAST Operations
> Email: ward.p.fontenot@wellsfargo.com
> Phone: (480) 437-7795
>
> This message may contain confidential and/or privileged information.
> If you are not the addressee or authorized to receive this for the
> addressee, you must not use, copy, disclose, or take any action
> based on this message or any information herein. If you have
> received this message in error, please advise the sender immediately
> by reply e-mail and delete this message. Thank you for your cooperation.
--
@@@USER@@@
Internet Channel -- inch.com