Thanks gagan for your answer,i'm new to as400,i don't know
embedded sql in rpg.can you send me the coding for the below
mentioned question in embedded sql rpg.
how to retrieve particular field records from a physical
file,say i have a physical file called 'employee' in it i
have to retrieve the records of a field 'admin' present in
pf 'employee' using rpg,but i should not use logical file
or openquery file.
Answers were Sorted based on User's Feedback
Answer / harshad r suryawaunshi
1. Declare cursor first - It will select all the record
available in the filed 'ADMIN'
c/exec sql
c+ declare cr1 cursor for
c+ select ADMIN from EMPLOYEE
c/end-exec
2. Open the cursor - its like seting the pointer on the
first record
c/exec sql
c+ open cr1
c/end-exec
3. Fetch the cursor - its like reading the records in the
cursor. NAME is the field defined in the program which
attributs are same as per field ADMIN.
c/exec sql
c+ fetch cr1 into :name
c/end-exec
This code u can execute in Do loop to read all the records.
The complete coding would look like this
c/exec sql
c+ fetch cr1 into :name
c/end-exec
C dow sqlcod <>100
C
C name dsply
c/exec sql
c+ fetch cr1 into :name
c/end-exec
C enddo
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / ravi
Give DOW SQLCOD =0. There are several other errors with SQLCOD <> 0
| Is This Answer Correct ? | 0 Yes | 0 No |
what is the difference between SETON RT & RETURN?
1.CA(command Atention key)& CF(command Function key) difference with example?Please can any body tell me in real time exp? 2.Can any body tell me some mandatery function keys using while creating any screen with use of SDA-FUNCTION kEYS?
how can an indexed file be used as arrival sequence in RPG?
what is a rpg?
how can I tell when to replace the array?
can anyone explain aboutovrOVRDBF,OPNQRYF, OVRSCOPE and OPNSCOPE?
can any body correct the following code? Following a procedure which returns the maximum of two numbers.Correct the following code. P GETMAX B D GETMAX PI D NUM1 35 0 D NUM2 45 0 C IF NUM1 > NUM2 C RETURN NUM1 C ELSE C RETURN NUM2 C ENDIF P GETMAX E
can any one help in hawkeye and turnover or any change management system plzzzzz or send the documents to my mail id :gvsp.as4@gmail.com
ESCAPE message sent by child program can be handled by parent program using which keyword?
How do you call procedures in ILE?
I have 1000 records in a file. I would like to generate 10 identical reports from this record with same format (structure of records) how do I do this?
what is decimal data error? when it will come and how to achieve(rectify) this error please give me solution as well as code