The first time with the DB2 database, due to the construction of the statement may not be the same, so the use of manual table-based approach, one field to fill. And check the primary key, and finally found that the creation failed. Look at the SQL statements generated by the system
The SQL statements are as follows:
CREATE TABLE FRONT. Score_reverse
(
Serial_no VARCHAR (50),
Secret_key VARCHAR (50),
tradebox_id INTEGER (32),
Reduce_point_type VARCHAR (50),
Reduce_point_reason VARCHAR (50),
Reduce_time VARCHAR (50),
Login_name VARCHAR (50),
commodity_id INTEGER (32),
Commodity_number VARCHAR (50),
Point INTEGER (32),
Contact_Name VARCHAR (50),
Contact_mobile_no VARCHAR (50),
Contact_address VARCHAR (50),
Commodity_type VARCHAR (50),
Reverse_time VARCHAR (50),
PRIMARY KEY (serial_no));
The following two errors are indicated:
First exception: [CREATE-0 row (s), 0.000 secs] [Error Code: -104, SQL state:42601] DB2 SQL error:sqlcode=-104, sqlstate=42601, Sqlerrmc=integer; R (50),
Because the online search does not want the answer, then directly see the problem, found hint sqlerrmc=integer; R () then removes the length of the integer and changes the integer (32) to Integer. Problem solving
Second exception: DB2 SQL error:sqlcode=-542, sqlstate=42831, Sqlerrmc=serial_no, driver=4.15.82
This is what I can't find. Search found that when DB2 creates a primary key, its primary key SQL must be set to not be empty. That is to be set to: serial_no VARCHAR (not null), and the system generates no NOT NULL
Re-modify SQL, execute OK again, table creation complete
Development: DB2-related problems in the collection of exceptions