SQLCOD = -7008 when doing an insert into file using SQLRPGLE

pts.
Tags:
Application development
AS/400
Backup & recovery
CLP
DB2 Universal Database
RPG
RPGLE
Hi, I'm trying to insert selective records from one file into the same file in another library. I have to do this for many file. Am building the query dynamically using SQLRPGLE. Am using a PREPARE statement and an EXECUTE statement to run the query. While the PREPARE statement ends fine, am getting an SQLCOD -7008 while executing the same. The details are as given below. SQLCOD = -7008 SQLSTATE = 55019 The SQL Error message says: FILENAME in LIBRARY not valid for Operation but am not able to get the reason code for the same. The below is the exact command which is being used in EXECUTE statement The same command works fine in STRSQL. Not sure why this is not working in a SQLRPGLE. Can somebody help...please?

Answer Wiki

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

Hi
I did not see the exact code in question but do you have a pgm described varaible as the “Library name”? <i>That is not allowed when SQL is embedded in RPGLE.</i>
Jim

…….. Yes, it is allowed. You just have to code it properly. — Tom

Is commitment control on?

If not, are you setting commit option to *none

/Free
Exec SQL set option commit = *none;
/End-Free

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
  • cjdugas
    Check you commitment control. The default is *CHG; try it set to *NONE.
    55 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