Hello,

I see a semicolon after the mark:
>> root(uid=0)','H4vgmf+OJsT99kCfQuIpALY7k9k=')<*>;')

Since you do not pass PL*SQL there should be no semicolon and maybe no
newline too. But you use chomp to get rid of the newline, don't you?

In SQL*Plus the semicolon is used to mark the end of the statement,
because it might be bigger than one line. If you have statements
spanning more than one line you need to concatenate before parsing it.

>> -----Original Message-----
>> From: Reidy, Ron [mailto:[EMAIL PROTECTED] 
>> 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 <eof
>> connect uid/[EMAIL PROTECTED]
>> @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: [EMAIL PROTECTED]
>> [mailto:[EMAIL PROTECTED]
>> 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=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?


cu
 Wieland                            mailto:[EMAIL PROTECTED]

Reply via email to