Midrange News for the IBM i Community


Posted by: Chris Proctor
Programmer Analyst
Columbia Sports Company
Portland, OR
Accessing a sequence# created w/SQL in an RPG pgm?
has no ratings.
Published: 13 Dec 2012
Revised: 23 Jan 2013 - 1611 days ago
Last viewed on: 22 Jun 2017 (2471 views) 

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.

Accessing a sequence# created w/SQL in an RPG pgm? Published by: Chris Proctor on 13 Dec 2012 view comments(1)

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††††

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS