All Forums Analytics
nguyent02 8 posts Joined 03/07
21 Mar 2008
how to generate addition row as counter

hi, i am needing help on how to create a table (No RAW data to insert) , only generate the count from 1 to 1000. the final table will Counter1...1000Thank you very much.

dhirajpalse 36 posts Joined 01/08
24 Mar 2008

Hi,Create table as mentioned below and exec the foll. query.CREATE SET TABLE ,NO FALLBACK ,NO BEFORE JOURNAL,NO AFTER JOURNAL,CHECKSUM = DEFAULT(ID_COL INTEGER GENERATED ALWAYS AS IDENTITY(START WITH 1 INCREMENT BY 1 MINVALUE -2147483647 MAXVALUE 1000NO CYCLE))UNIQUE PRIMARY INDEX ( ID_COL );INSERT INTO SELECT 1 FROM DB_NAME.TABLE_NAME_2 Just make sure, above select query fetches the number of records you want. In this case 1000.

Dhiraj

dnoeth 4628 posts Joined 11/04
25 Mar 2008

Hi Dhiraj,did you try it, this will not work :-)If it's less than 73000 values:insert into tabselect day_of_calendar from sys_calendar.calendarwhere day_of_calendar <= 1000Dieter

Dieter

nguyent02 8 posts Joined 03/07
22 Apr 2008

Hi, it does not work. it did not fetch the record, only insert 1 record. the max value may go up to 999999999999999.thanks,

You must sign in to leave a comment.