If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Error runninf "LOAD FROM..:" in perl

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-26-04, 09:03
arreguez arreguez is offline
Registered User
 
Join Date: Jan 2004
Posts: 1
Error runninf "LOAD FROM..:" in perl

Hi, I've the following sentence in a perl script:

do {
$sentence ="LOAD FROM \
/tmp/test.txt \
OF DEL insert into ngr.TABLE_NAME_test";
$load=$dbh->do($sentence);
die "Error in do: $DBI::err ... $DBI::errstr" if $DBI::err;
};

But, I obtain the following error:

Error in prepare: -104 ... [IBM][CLI Driver][DB2/6000] SQL0104N An unexpected token "LOAD" was found following "BEGIN-OF-STATEMENT". Expected tokens may include: "<values>". SQLSTATE=42601

Thanks in advance for your help
*********************************************
perl, version 5.005_03
aix 5.1.0.0
db2 Command Line Processor for DB2 SDK 8.1.0
*********************************************

NOTE: all other sent4ences work ok, sentences as INSERT; DELETE, SELECT.etc.
Reply With Quote
  #2 (permalink)  
Old 01-26-04, 09:50
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Re: Error runninf "LOAD FROM..:" in perl

Quote:
Originally posted by arreguez
Hi, I've the following sentence in a perl script:

do {
$sentence ="LOAD FROM \
/tmp/test.txt \
OF DEL insert into ngr.TABLE_NAME_test";
$load=$dbh->do($sentence);
die "Error in do: $DBI::err ... $DBI::errstr" if $DBI::err;
};

But, I obtain the following error:

Error in prepare: -104 ... [IBM][CLI Driver][DB2/6000] SQL0104N An unexpected token "LOAD" was found following "BEGIN-OF-STATEMENT". Expected tokens may include: "<values>". SQLSTATE=42601

Thanks in advance for your help
*********************************************
perl, version 5.005_03
aix 5.1.0.0
db2 Command Line Processor for DB2 SDK 8.1.0
*********************************************

NOTE: all other sent4ences work ok, sentences as INSERT; DELETE, SELECT.etc.
"LOAD" is not a SQL statement; it's a CLP (command line processor) command. You'll have to invoke CLP to run LOAD, like this

db2 $sentence
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On