RE: Newline inserted?
am 25.10.2005 16:22:24 von Ron.ReidyReally? I use SQL*Plus in cron jobs all the time.
-----Original Message-----
From: Ward.P.Fontenot@wellsfargo.com
[mailto:Ward.P.Fontenot@wellsfargo.com]=20
Sent: Monday, October 24, 2005 12:23 PM
To: Reidy, Ron; dbi-users@perl.org
Subject: RE: Newline inserted?
This runs as a CRON job loading syslog data into Oracle so SQL*Plus is
not a good answer. Thanks for help though.=20
-----Original Message-----
From: Reidy, Ron [mailto:Ron.Reidy@arraybiopharma.com]=20
Sent: Monday, October 24, 2005 11:08 AM
To: Fontenot, Ward P.; dbi-users@perl.org
Subject: RE: Newline inserted?
If your file has a '\n' in it, it cannot possibly be an issue with DBI
or Oracle v anything.
Are you processing individual SQL statements (does your file contain SQL
insert statements)? If so, DBI is not your best bet to do this. I
would rethink this and:
a. Use SQL*Plus to load the file:
sqlplus -L /nolog
@file
commit;
exit
eof
b. Consider getting a file of data (no SQL statemets) and use
SQL*Loader to load the data.
--
Ron Reidy
Lead DBA
Array BioPharma, Inc.
-----Original Message-----
From: Ward.P.Fontenot@wellsfargo.com
[mailto:Ward.P.Fontenot@wellsfargo.com]
Sent: Monday, October 24, 2005 12:01 PM
To: dbi-users@perl.org
Subject: Newline inserted?
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=3D0)','H4vgmf+OJsT99kCfQuIpALY7k9k=3D');
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=3D0)','H4vgmf+OJsT99kCfQuIpALY7k9k=3D')<*>;')
This is the code that loads this file:
while (
chomp;
$sql =3D qq{$_};
$sth =3D $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.
This electronic message transmission is a PRIVATE communication which
contains information which may be confidential or privileged. The
information is intended=20
to be for the use of the individual or entity named above. If you are
not the=20
intended recipient, please be aware that any disclosure, copying,
distribution=20
or use of the contents of this information is prohibited. Please notify
the sender of the delivery error by replying to this message, or notify
us by telephone (877-633-2436, ext. 0), and then delete it from your
system.
This electronic message transmission is a PRIVATE communication which =
contains
information which may be confidential or privileged. The information is =
intended=20
to be for the use of the individual or entity named above. If you are =
not the=20
intended recipient, please be aware that any disclosure, copying, =
distribution=20
or use of the contents of this information is prohibited. Please notify =
the
sender of the delivery error by replying to this message, or notify us =
by
telephone (877-633-2436, ext. 0), and then delete it from your system.