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 > Strange error message when running a ddl script

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-23-03, 15:03
db2_learner99 db2_learner99 is offline
Registered User
 
Join Date: Nov 2003
Posts: 9
Unhappy Strange error message when running a ddl script

hi,

i am new to db2 and try to run a simple ddl script using db2 script center. when running the following script ...


CONNECT TO PLATO01 USER db2admin USING db2admin

CREATE TABLE THACTIVI
(ACTIVITY_ID INTEGER NOT NULL,
ACTIVITY_NAME CHAR(32) NOT NULL,
ACT_PRIORITY INTEGER,
ACTIVITY_STATUS INTEGER,
ACTIVITY_OWNER CHAR(32),
ACT_DEFERRABLE CHAR(1) NOT NULL,
MAN_HOURS INTEGER,
PREDECESSOR_ID INTEGER,
ACT_DEPENDS_ON INTEGER,
ACTIVITY_TYPE CHAR(32),
MILESTONE CHAR(1) NOT NULL,
PERSON_ID INTEGER,
ADMINTASK_ID INTEGER,
....)


CREATE TABLE THADTASK
(ADMINTASK_ID INTEGER NOT NULL,
ADMINTASK_NAME CHAR(32) NOT NULL,
PERSON_ID INTEGER NOT NULL,
START_DATE DATE,
....)

CONNECT RESET

... i get this output from the journal:

CONNECT TO PLATO01 USER db2admin USING



Database Connection Information



Database server = DB2/NT 7.2.3

SQL authorization ID = DB2ADMIN

Local database alias = PLATO01





CREATE TABLE THACTIVI

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 "TABLE" was found following "CREATE ". Expected

tokens may include: "TYPE". SQLSTATE=42601



(ACTIVITY_ID INTEGER NOT NULL,

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 "INTEGER" was found following "(ACTIVITY_ID ".

Expected tokens may include: "JOIN <joined_table>". SQLSTATE=42601

......

does anyone know what is wrong? I am using DB2 7.2.3 PE

thx.
Reply With Quote
  #2 (permalink)  
Old 11-24-03, 02:08
subbu subbu is offline
Registered User
 
Join Date: Nov 2003
Posts: 7
Post

Hi,

U write like this it may be work.U write total statement in one line.

CREATE TABLE THACTIVI(ACTIVITY_ID INTEGER NOT NULL,ACTIVITY_NAME CHAR(32) NOT NULL,ACT_PRIORITY INTEGER,ACTIVITY_STATUS INTEGER,ACTIVITY_OWNER CHAR(32),ACT_DEFERRABLE CHAR(1) NOT NULL,MAN_HOURS INTEGER,PREDECESSOR_ID INTEGER,ACT_DEPENDS_ON INTEGER,ACTIVITY_TYPE CHAR(32),MILESTONE CHAR(1) NOT NULL,PERSON_ID INTEGER,ADMINTASK_ID INTEGER)

Regards
Reply With Quote
  #3 (permalink)  
Old 11-24-03, 03:48
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Re: Strange error message when running a ddl script

Delimit each statement with a ';'
and use

db2 -tvf <filename>

Cheer
Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #4 (permalink)  
Old 01-08-04, 18:22
db2_learner99 db2_learner99 is offline
Registered User
 
Join Date: Nov 2003
Posts: 9
Re: Strange error message when running a ddl script

Quote:
Originally posted by sathyaram_s
Delimit each statement with a ';'
and use

db2 -tvf <filename>

Cheer
Sathyaram

thx Sathyaram. One question remains: why is this from the clp running but from the sql script center not?

thx,
dirk
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