from: Jack Tucky <jacktucky@xxxxxxxxx>
subject: SQL Insert I need a line#/seq#
I have this code that originally had a group by so that one line was always
inserted into WSKUSUM99. The "1" after the field job is the sequence#.
insert into wskusum99 (
job , 1 , next value for styhs2r, msc1, msc2,shp,sea,sty,clr,
select :#sdjb#, seq,
0,'a','PHYSICAL COUNT',ls.shp, ls.sea, ls.sty, ls.clr,
ls.fab, ls.mod, ls.msz,
How can I change the 1 to an incrementing field? The table column is
defined as seq (3,0)
I found this code to create a sequence. I But I would like to reset it to 1
every time. How do I do that? Also,how do I put "next value for styhs2r"
into the insert statement?
create sequence styhs2r
start with 1
increment by 1