Re: Newline inserted?



You 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_unix)[3638]:
> session opened for user oracle by
> root(uid=0)','H4vgmf+OJsT99kCfQuIpALY7k9k=')<*>;')
>
> This is the code that loads this file:
>
> while (<SQL>) {
> 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@xxxxxxxxxxxxxx
> 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

.



Relevant Pages

  • RE: Newline inserted?
    ... > When I attempt to load this file into Oracle 10g using the ... > session opened for user oracle by ... Is this a known issue with DBI and 10g or am ... > are not the addressee or authorized to receive this for the ...
    (perl.dbi.users)
  • Re: FC4 Boot Log
    ... > What do you mean by boot log? ... To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list ... CONFIDENTIAL AND PRIVILEGED INFORMATION ... This message is intended for the addressee only and is privileged ...
    (Fedora)
  • RE: Poor view performance
    ... Simple view joining two tables. ... Paul Watson ... This message may contain confidential and/or privileged information. ... If you are not the addressee or authorized to receive this for the ...
    (comp.databases.informix)
  • RE: Bind parameter behaviour using DBI and DBD::Oracle
    ... Andy. ... This e-mail is intended only for the above addressee. ... privileged information. ... Security Notice: all e-mail, sent to or from this address, may be ...
    (perl.dbi.users)
  • Well have the Bushbots here had enough of
    ... *** This message may contain confidential or privileged information. ... are not the addressee of this e-mail or it was addressed to you in error, ... confidentiality or privilege. ... please notify the sender by return e-mail and delete it. ...
    (alt.politics.bush)