Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004
    Posts
    1

    Unanswered: 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.

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1

    Re: Error runninf "LOAD FROM..:" in perl

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •