select gthamcode as hamcode, gtnumber as item, ‘G’ from testlib/gtinl01 where (gtnumber between 08000000000000 and 08999999999999) union all select modkey as hamcode, modndcnum as item, ‘M’ from testlib/hammodel where (modndcnum between 08000000000 and 08999999999) This works with interactive SQL but I need to use this in an COBOL embbeded SQL cursor. The ’M’ and ’G’ are constants [...]
I have three tables. Table One is a master table which contains rows which need to be updated with data from the other two tables (I’ll call them Table Two and Table Three). I have created a cursor which updates existing rows in Table One with data from Table Two. This works fine, and following [...]
I’m trying to recursively call a PI in my SQLRPGLE program. Problem is, I get an SQLCODE error of -519 and I’m sure it has to do with cursors and the prepare statement in my PI. Here’s the code: pprintPrograms b dprintPrograms PI d program 10a value d spacer 10a value [...]
I’m using Prepare, Declare SQL cursor in my SQLRPGLE program After Declare statement I receive SQL -312 – Which indicates to me that the SQL statement is not declared correctly. Is it something wrong with my query. I ran this query in SQL editor and went fine. I dun understand why not in the program. Given [...]
hi, i’ve SQLRPGLe program in which i’m writing a cursor to select all records, order them by a field A (suppose employee number). And once all the rows fetched for an employee and printed, print the count at the bottom. Repeat this for all the subsequent employees…. i’m not sure how to handle the print count part…i.e. in SQL how [...]
What are the alternatives to cursors? I can’t find any other method to move through record sets one at a time.
what is the max length for an embeded sql cursor name in RPG?
Hi, I’ve been told to never use cursor in SQL, because of possibility of memory leak, etc. But I have no idea of how to implement my script without them. My script doesn’t execute anything on the database, it simply use cursor to create another TSQL script that does the execution. EG. open cursor to [...]





