Error while using OVRDBF

120 pts.
Tags:
AS/400
AS400 RPGLE
OVRDBF
Hi I am using OVRDBF command in my cl program in order to apply a particular select criteria on a database file in order to pass it to the RPGLE code. The syntax I used is as below: OVRDBF     FILE(MYFILE) TOFILE(MYFILE) +                      MBR(MYFILE) OVRSCOPE(*JOB) SHARE(*YES) OPNQRYF    FILE((MYFILE *FIRST *ONLY)) OPTION(*ALL) +              QRYSLT('MYCODE *EQ "R"') OPNID(MYFILE)  Now when I debug my code and execute the above steps successfully, I go to SQL command line in my same session using shift F9 and try to query the same file for other values of MYCODE and they are visible. Could anyone please help me in achieving my objective of placing the filter on MYFILE with MYCODE = 'R' only so that I can pass it to subsequent functions. Also help on grouping the fields of MYFILE during OPNQRYF will be appreciated. Thanks, Vivek Sharma

Software/Hardware used:
as400

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hi Vivek,

When you are using OVRDBF you are giving limation only to JOB. So, It will not reflect when you are trying to query Database file using SELECT(from STRSQL) statement.
Instead, you can verify data by running RUNQRY command in command line with required conditions.

Pradeep.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    I go to SQL command line in my same session using shift F9 and try to query the same file for other values of MYCODE and they are visible. I don't know if dynamic SQL statements will have any connection to the OPNQRYF at all. OPNQRYF is a query. And when you run a SELECT statement in interactive SQL, you are running a different query. I'm not sure that the first query will affect the second query at all. Since you're already in debug, you might review messages in your joblog to see what indications there are of what is happening. However, I don't think that SQL will see what OPNQRYF has done. Personally, I'd say to forget OPNQRYF in this case and just use SQL to SELECT WHERE MYCODE = 'R'. I can't see any reason to use OPNQRYF at all for this. Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following