If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > clp script error!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-12-03, 03:09
zswparamount zswparamount is offline
Registered User
 
Join Date: Nov 2003
Posts: 3
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!
Reply With Quote
  #2 (permalink)  
Old 11-12-03, 04:40
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Re: clp script error!

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

Cheers
Sathyaram

Quote:
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.
Reply With Quote
  #3 (permalink)  
Old 11-12-03, 04:52
zswparamount zswparamount is offline
Registered User
 
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!
Reply With Quote
  #4 (permalink)  
Old 11-12-03, 07:16
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
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
Reply With Quote
  #5 (permalink)  
Old 11-12-03, 07:20
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
Hi,

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

Grofaty
Reply With Quote
  #6 (permalink)  
Old 11-13-03, 01:07
zswparamount zswparamount is offline
Registered User
 
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 .....
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On