You need to have columns defined when you create table.
For instance:
create table test (Lastname varchar(10), Initial char(1), salary int);
Before the create table command is executed, you may need to do a
connect to <db-name>
Quote:
Originally posted by Shinto
hi, I am trying to create a script to create a DB2 database and tables. What i did was write out the SQL codes in notepad and save them under a .SQL extension. Next, i open the script centre and import the sql code and run it.
In the journal, its stated that the running of the script was successful, however when i open the journal report its states that :
CREATE TABLE test
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 "test" was found following "CREATE TYPE TABLE ".
Expected tokens may include: "END-OF-STATEMENT". SQLSTATE=42601
Does anyone know how to solve this problem? Or is it that the steps i am using to create a script is wrong? If possible, can someone post a working copy of a script to create a table here? I just wanna know how it works and how to solve the error message. Attached is a copy of my .sql file.
|