Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2012
    Posts
    6

    Unanswered: getting error using load

    create procedure TestLoad()
    specific TestLoad
    language sql

    P1: BEGIN
    declare v_sql VARCHAR(200);
    declare v_stmt statement;
    declare cur cursor for select * from test_proc fetch first 3 rows only;

    set v_sql='call SYSPROC.ADMIN_CMD('||chr(39) ||'load from ( select * from
    proc_test fetch first 200 rows only) of cursor insert into
    test_procc'||chr(39)||')';

    Execute Immediate v_sql;

    END P1
    @

    When i run am getting the error

    db2 call "TestLoad()"

    SQL0104N An unexpected token "cursor" was found following "OF". Expected
    tokens may include: "ASC". SQLSTATE=42601

    Pls let me know where is the problm

  2. #2
    Join Date
    Dec 2008
    Location
    Toronto, Canada
    Posts
    399
    i think your syntax is incorrect.

    see this "Fast and easy data movement using DB2's LOAD FROM CURSOR feature":

    Fast and easy data movement using DB2's LOAD FROM CURSOR feature
    DB2 9.5/9.7 on Unix/AIX 6.1/Linux

Posting Permissions

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