By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,610 Members | 1,677 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,610 IT Pros & Developers. It's quick & easy.

load failure - SQL0104N Db2 version 9

P: n/a
Excuted the statement through a SSH connection:

db2 import from <filename.ixfof ixf messages /database/stage/
acct_news_asc.txt insert into userid.acct_news_asc

And it worked fine.

Ran the same command through perl and received an error:
SQLErr: [IBM][CLI Driver][DB2/LINUXX8664] SQL0104N An unexpected
token "/database/stage/acct_news_asc.txt" was found following
"MESSAGES". Expected tokens may include: "ON". SQLSTATE=42601
(-104)(42601)

Error while executing import on acct_news_asc.

Any suggestions would be helpful...

Nov 12 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Ian
Justin wrote:
Excuted the statement through a SSH connection:

db2 import from <filename.ixfof ixf messages /database/stage/
acct_news_asc.txt insert into userid.acct_news_asc

And it worked fine.

Ran the same command through perl and received an error:
How exactly did you run the command? Via DBD::DB2? By using the
system() function? What was the exact statement you tried to execute?

It would be helpful to see an excerpt of the code that is doing this.
Nov 13 '07 #2

P: n/a

Ian,

Thanks for responding so quickly.

Yes, the command is run through DBD::DB2 (perl).

We use the sysproc.admin_cmd. A similar piece code works great for
the export.

Here is the perl code:

# setup import command
my $importcmd = "Load FROM " . $filename . " OF IXF MESSAGES " .
$messagefile . " INSERT INTO USERID." . $table ;

# Prepare import command
my $sths = $dbh->prepare("call sysproc.admin_cmd(?)")
or return ($self->do_return($q, 0, $dbh->errstr, $dbh->err, $dbh-
>state,
"Error while preparing import on $table.", $dbh));

# Bind input parameters
$sths->bind_param( 1, $importcmd);

# Call the stored procedure
$sths->execute()
or return ($self->do_return($q, 0, $dbh->errstr, $dbh->err, $dbh-
>state,
"Error while executing import on $table.", $dbh));

$sths->finish();

On Nov 12, 11:15 pm, Ian <ianb...@mobileaudio.comwrote:
>
How exactly did you run the command? Via DBD::DB2? By using the
system() function? What was the exact statement you tried to execute?

It would be helpful to see an excerpt of the code that is doing this.

Nov 13 '07 #3

P: n/a

Interesting enough... If I take out messages (and associate msg text
file) it works fine through perl

Not sure if that is helpful...
Nov 14 '07 #4

P: n/a

Message on server was the part that I was missing.

Thanks.

For those who run into similar - here is a little info:

my $importcmd = "LOAD FROM " . $filename . " OF IXF MESSAGES on
server INSERT INTO USERID." . $table ;
print "importcmd = $importcmd\n";

# Prepare import command
my $sths = $dbh->prepare("call sysproc.admin_cmd(?)") #
sysproc.db2load
or return ($self->do_return($q, 0, $dbh->errstr, $dbh->err, $dbh-
>state,
"Error while preparing import on $table.", $dbh));

# Bind input parameters
$sths->bind_param( 1, $importcmd);

# Call the stored procedure
$sths->execute()
or return ($self->do_return($q, 0, $dbh->errstr, $dbh->err, $dbh-
>state,
"Error while executing import on $table.", $dbh));
# bind column 1 to variable
$sths->bind_col(1, \$outCol1);

# bind column 2 to variable
$sths->bind_col(2, \$outCol2);

# bind column 3 to variable
$sths->bind_col(3, \$outCol3);

# bind column 4 to variable
$sths->bind_col(4, \$outCol4);

# bind column 5 to variable
$sths->bind_col(5, \$outCol5);

# bind column 6 to variable
$sths->bind_col(6, \$outCol6);

# bind column 9 to variable
$sths->bind_col(9, \$msg_retrieval);

# bind column 10 to variable
$sths->bind_col(10, \$msg_removal);
Nov 16 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.