Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.
I created a batch# field using the following command in SQL. I’m trying now to access it in my program. It looks like it was created as a data area, but it’s defined at char(2000), even though the actual sequence number is dec(8,0). I tried putting it in my pgm as a data area with a size of dec(8,0) and when I ran it it said the field size is wrong. Maybe I need to have an SQL statement retrieve the value and increment it? Not sure…. Any ideas? Just an FYI, I create the counter this way because it's also being used by other SQL stored procedures.
Thanks!
create sequence mm610dvl/batch_seq as decimal(8,0) start with 100 increment by 1 no order cycle no minvalue no maxvalue cache 20