Suppose I have a file with empid and telephone number, I realised the telephone number value is not correct for some 3-4 employee ids. I have a backup file for this file and it has the correct telephone number value . I need to write an SQL querry to correct the wrong telephone number by [...]
I have a delete query in embedded SQL. How can I know how many records are deleted?
Hi, We are moving Values to Database Fields using Embedded SQL Concept. In Embedded SQL, We can decide the Variable Names dynamically. Is it possible with Display File? why?
How do you copy substring from clob-field with SQL if substring from/to positions are varables? This works OK (RPG free w embedded sql): exec sql select substr(myclobfield, 25, 70) INTO :mystring FROM MYLIB/MYFILE; [/pre] Whereas this causes a compilation error: from = 25; to = 70; exec sql select substr(myclobfield, :from, :to) [...]
RPGLE Embedded SQL is getting a SQL0305 (SQLcid-305, sqlstate 22002) when fetching the next record from a view. This is pointing to null values encountered. /free exec sql fetch next from C1 into :wtclaims ; /end-free Wtclaims is an Externally Described Data structure. There could be null values in any field in the ds over [...]
I have an sqlrpgle pgm setup, I want to add another sql select statement. I have a file that contains barcode label data, where multiple records can be assigned to the same Master serial #. My sqlrpg pgm is display various sorts in a screen inquiry. I want to setup my select, to display one [...]
Does anyone know of some good SQL books for RPGLE other than the IBM manuals? I need to learn more to keep afloat!
I am trying to join a header and a detail file and select all fields into data structures defined as external(filename). D dswtchdr E DS EXTNAME(wtchdr) D dswtcdet E DS EXTNAME(wtcdet) C $CreateCsr Begsr C/EXEC SQL C+ prepare S1 from :sqlstmt C/end-exec * C/EXEC SQL C+ declare C1 scroll cursor for S1 C/end-exec C EndSr [...]
I am using SQLRPGLE program,need to handle record lock in sql statement ..plz suggest?
I am building 4 part SQL select across 4 files using union alls. All 4 files have a date field which is one of the fields I am selecting. My problem is that on one file the date field is defined as L type where the other three files have a date field defined as [...]
C/EXEC SQL C+ INSERT INTO SERIOVR60 C+ SELECT HTSERN, HTPART, HTQTY, HTSTKL, C+ HTSTS, HTADAT, C+ substr(HTPART, 1, 11) AS HTMODEL, C+ HTADAT – :CURDATE AS HTDAYS C+ FROM SERI C+ WHERE HTADAT < :TESTDATE and C+ HTADAT <> ’0001-01-01′ and C+ HTSTS = ‘A’ C+ ORDER BY HTPART C/END-EXEC This returns; Date = 2010-05-12 Days [...]
I am trying to get some counts and totals from one file and put them in another. My SQL statement works fine with STRSQL, not in the RPGLE. Do I have to declare/set a cursor, exec sql and close the cursor just to put the total in another file? C/EXEC SQL C+ INSERT INTO outputfile [...]
When I try updating data in a PF via embedded SQL I get a message saying I need to turn journaling on.. * change dates on a set of records C/EXEC SQL C+ UPDATE ACC02602P C+ SET CSSTR8 = :$NEWSTR, C+ CSEND8 = :$NEWEND C+ WHERE CSSTR8 = :$CSSTR8 AND C+ CSEND8 = :$CSEND8 [...]
couldd someone pls help me wid generating week number of a year in rpgle. i guess its done thru embedding sql into rpgle pls help
I have embedded SQL in my RPG code and some of the results are different to what I get when I check using STRSQL
I have a prog that should update all KY cust master records with the new code AR. I run the program but nothing happens. The file remains unchanged. I am new to embedded sql so what am I doing wrong ?? D OLDWH S 2 INZ(‘KY’) D NEWWH S 2 INZ(‘AR’) * Get all [...]
In SQL RPGLE program, I declare a cursor using a view.. The view has name Emp_Pat_Dept_Data(EMPdata) the empdata is the AS400 name. In my cursor def which name I should use. Also for the fields referenced do I need to use the renamed field names in the view definition or I can use the field [...]
I coded an update query in COBOL and included COMMIT=NONE so the update could go through. When the COBOL program executed it returned nulls, and coalesced the value to the default. When the query was executed either through qmqry or on-line on the sql screen it worked fine and updated the field properly. I also [...]
I have a need to push data from the AS/400 to an SQL DB on an SQL 2008 server. I was wondering if there was a way to do this natively within RPG on the AS/400 without purchasing something. Was thinking embedded SQL or stored procedures might be able to accomplish this. Has anyone done [...]
I want to use embedded SQL in an SQLRPGLE program to search a file for a field entered in a screen to select data using the LIKE operand. This is my code C/EXEC SQL C+ DECLARE C1 CURSOR FOR SELECT * FROM F0101JN WHERE ALADDZ = :SZIP C+ AND ABALPH LIKE :SINNME ORDER BY ABAN8 [...]





