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 > Create table command

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-14-12, 00:27
ajfreitas ajfreitas is offline
Registered User
 
Join Date: Sep 2003
Posts: 44
Create table command

Hi guys,

I'm trying a simple create command in two different servers , Server01 and Server02:

create table a (a char (1) null) ..

It works fine in the Server01
$db2 "create table a (a char (1) null)"
DB20000I The SQL command completed successfully.

but ...

It not works on Server02 :
db2 "create table a (a char (1) 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 ")" was found following "e A (a char (1) null".
Expected tokens may include: "<references_spec>". SQLSTATE=42601

Question : why ????
Reply With Quote
  #2 (permalink)  
Old 07-14-12, 01:35
tonkuma tonkuma is offline
Registered User
 
Join Date: Feb 2008
Location: Japan
Posts: 2,752
Different commands could return different results.
Reply With Quote
  #3 (permalink)  
Old 07-14-12, 01:54
ajfreitas ajfreitas is offline
Registered User
 
Join Date: Sep 2003
Posts: 44
Are you crazy ??

we have exactly the same command : db2 "create table a (a char (1) null)"
Reply With Quote
  #4 (permalink)  
Old 07-14-12, 02:02
papadi papadi is offline
Registered User
 
Join Date: Oct 2009
Location: 221B Baker St.
Posts: 483
Quote:
Are you crazy ??
Probably not, but you might be. . . Possibly you will outgrow this attitude.

Not the smartest idea to act belligerant to one of the best "helpers" here

What you posted IS 2 different commands. . . Look at your post. . .
Reply With Quote
  #5 (permalink)  
Old 07-14-12, 02:21
ajfreitas ajfreitas is offline
Registered User
 
Join Date: Sep 2003
Posts: 44
I think you're crazy too .. commands are the same :

$db2 "create table a (a char (1) null)"
DB20000I The SQL command completed successfully.

but ...

It not works on Server02 :
db2 "create table a (a char (1) null)"


$ character is from OS prompt ....

If you read, and dont understand, I can change the sentences ..

It works fine in the Server01
db2 "create table a (a char (1) null)"
DB20000I The SQL command completed successfully.
but ...
It not works on Server02 :
db2 "create table a (a char (1) 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 ")" was found following "e A (a char (1) null".
Expected tokens may include: "<references_spec>". SQLSTATE=42601

good ?
Reply With Quote
  #6 (permalink)  
Old 07-14-12, 06:59
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,473
On a windows machine I also have a problem with that statement. If I change the table name to anything else, it works. Original statement works OK with a GUI client.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
Reply

Tags
create table, db2

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