QUESTION POSED ON: 28 April 2008
I need a file with an automatic key in it on the iSeries. I know you can create one using SQL but is there a keyword in DDS that can be used for this?
Would I have to use the following code in an RPGLESQL program to do this?
CREATE TABLE invoice_data
(invoice# INTEGER NOT NULL
GENERATED ALWAYS AS IDENTITY
(START WITH 1
,INCREMENT BY 1
,NO MAXVALUE
,NO CYCLE
,ORDER)
,sale_date DATE NOT NULL
,customer_id CHAR(20) NOT NULL
,product_id INTEGER NOT NULL
,quantity INTEGER NOT NULL
,price DECIMAL(18,2) NOT NULL
,PRIMARY KEY (invoice#));
|