Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating column names with spaces without quotes ! (DB2 MTK)

Status
Not open for further replies.

Sudmill

Programmer
Apr 20, 2001
65
GB
Hi,

Im new to DB2 (currently Oracle/sql dba), and am attempting to convert our SQL Server DB to Db2 using the DB2 MTK from IBM. Now I have a problem that the original system has spaces in its table names and also its field names.

This is causing problems in the MTK becuase the migration toolkit GUI doesnot allow me to remove the quotes around the field name for some reason. So I will probably have to edit the MTK produced script and run it manually.

Here is an example;

CREATE TABLE "table name" (
UserID VARCHAR(3) NOT NULL,
ClientID INT NOT NULL,
"Call ID" INT NOT NULL)!


How do I epecify the create table command and specify column names WITH spaces in their names WITHOUT the quotes appearing as part of the actual column name?


Also how do I get the the above script to run in command centre and accept the ! symbol as a terminator. ( it currently seems to complain that it doesnt like the "!" symbol.

Thanx in advance ..


Cheers

John (Sudmill)
 
If your tablename or column name has spaces, then you will have to use double-quotes ... There doesn't seem to be an option ..

In the command centre, tools drop down, open options and in one of the tabs you have 'Statement Delimiter' Change that to !

HTH

Sathyaram




More DB2 questions answered at
 
Thanks for the both answers, but I think you misunderstood the first question. The problem is that the when specifying a column name as

"Call ID"

it should appear as (thru the tree view of control centre);

Call ID

but in fact it actually appears as;

"Call ID"

so DB2 is quite literally creating the column name as specified including the quotes as part of the column name.

Can anyone help PLEASE ?!?!?!



Cheers

John (Sudmill)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top