Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2003
    Posts
    3

    Unanswered: clp script error!

    hi,all!
    i am new to db2,and i run into this problem:
    i wrote a very simple script named test.db2:
    create table table1(filed1 integer)@
    create table table2(filed1 integer)@


    and i run it in the clp(in linux):
    su db2inst1
    db2 connect to test1(the db i want to operate)
    db2 -td@ -vf test.db2

    but unfortunatly,the output is:
    create table table2(filed1 integer)
    DB21034E The command was processed as an SQL statement bacause
    it was not a valid Command Line Processor command. During SQL processing it returned:
    SQL0104N An unexpected token"create table table1(filed1 integer)@"was found following"BEGIN-OF-STATEMENT".Expected tokens may include:""<space>".
    SQLSTATE=42601

    the strange thing is that when i only write one statement in the script,for instance,"create table table1(filed1 integer)@",than,everything is ok!
    why?
    i will appreciate every help!
    thanks!

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: clp script error!

    Strange ....
    Do you want to try leaving a space between ) and @ ? Try again

    Cheers
    Sathyaram

    Originally posted by zswparamount
    hi,all!
    i am new to db2,and i run into this problem:
    i wrote a very simple script named test.db2:
    create table table1(filed1 integer)@
    create table table2(filed1 integer)@


    and i run it in the clp(in linux):
    su db2inst1
    db2 connect to test1(the db i want to operate)
    db2 -td@ -vf test.db2

    but unfortunatly,the output is:
    create table table2(filed1 integer)
    DB21034E The command was processed as an SQL statement bacause
    it was not a valid Command Line Processor command. During SQL processing it returned:
    SQL0104N An unexpected token"create table table1(filed1 integer)@"was found following"BEGIN-OF-STATEMENT".Expected tokens may include:""<space>".
    SQLSTATE=42601

    the strange thing is that when i only write one statement in the script,for instance,"create table table1(filed1 integer)@",than,everything is ok!
    why?
    i will appreciate every help!
    thanks!
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  3. #3
    Join Date
    Nov 2003
    Posts
    3
    hi,Sathyaram!
    it's so nice of u to give me advice.
    and i try what u suggest to me,but the result is the same. : (
    anyway,thank u very much!

  4. #4
    Join Date
    Jan 2003
    Posts
    1,605
    Hi,

    1. Create file test.db2 and put sqls in this file delimered with ;
    Sample:
    create table table1(filed1 integer);
    create table table2(filed1 integer);

    2. Run test.db2
    db2 -tvf test.db2

    Hope this helps,
    Grofaty

  5. #5
    Join Date
    Jan 2003
    Posts
    1,605
    Hi,

    I have tested your way zswparamount.
    If works fine for me, with no problems.

    Grofaty

  6. #6
    Join Date
    Nov 2003
    Posts
    3
    hi,every one!
    Thanks very much!
    yes, it works now!
    and i knew why now!because i wrote the script in the OS of windows 2000 ,and copy it to the linux.so .....

Posting Permissions

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