Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2007
    Posts
    31

    Unanswered: SP error with Load option

    Hello,

    D:\SP>db2 -td@ -vf sp_load.txt
    CREATE PROCEDURE UPLOAD_1()
    LANGUAGE SQL
    P1: BEGIN
    DECLARE cur_contact CURSOR FOR select * from test;
    Load from cur_contact of cursor insert into test1;
    END P1
    @

    DB21034E The command was processed as an SQL statement because it was not a
    valid Command Line Processor command. During SQL processing it returned:
    SQL0104N An unexpected token "Load" was found following "select * from test;
    ". Expected tokens may include: "<psm_loop>". LINE NUMBER=5.
    SQLSTATE=42601


    DB21034E The command was processed as an SQL statement because it was not a
    valid Command Line Processor command. During SQL processing it returned:
    SQL0104N An unexpected token "Load" was found following "from test;
    ". Expected tokens may include: "<psm_loop>". LINE NUMBER=9.
    SQLSTATE=42601

    Could you please help me on this error.? Thank you
    Regards
    Mohan

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    LOAD is not an SQL statement, which you can use in a stored procedure; it is a command implemented by the command processor.

    Try using ADMIN_CMD(), if your version of DB2 (which you didn't bother to mention) supports it.
    ---
    "It does not work" is not a valid problem statement.

Posting Permissions

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