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

pts.
Tags:
Application development
AS/400
Backup and Recovery
CLP
IBM DB2
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.

here are the possible causes of your error.

1 — &1 has no members.
2 — &1 has been saved with storage free.
3 — &1 not journaled, or no authority to the journal. Files with an RI
constraint action of CASCADE, SET NULL, or SET DEFAULT must be journaled to
the same journal.
4 and 5 — &1 is in or being created into production library but the user
has debug mode UPDPROD(*NO).
6 — Schema being created, but user in debug mode with UPDPROD(*NO).
7 — A based-on table used in creation of a view is not valid. Either the
table is program described table or it is in a temporary schema.
8 — The based-on table resides in an ASP which is different than the ASP
of the object being created.
9 — Index is currently held or is not valid.
10 — A constraint or trigger is being added to a table that is not valid.
The table is in QTEMP, has ASP’s that are not the same, or is not an
externally described file, or is not write, update, or delete capable. For a
constraint, the table is a source file or the parent does not have a member.
For a trigger, maximum number of triggers reached.
11 — Distributed table is being created in schema QTEMP, or a view is
being created over more than one distributed table.
12 — Table could not be created in QTEMP, QSYS, QSYS2, or SYSIBM because
it contains a column of type DATALINK having the FILE LINK CONTROL option.
13 — The table contains a DATALINK column or a LOB column that conflicts
with the data dictionary.
14 — A DATALINK or LOB column cannot be added to a non SQL table.
15 — Attempted to create or change an object using a commitment
definition in a different ASP.
16 — Sequence &1 in &2 was incorrectly modified with a CL command.
Recovery . . . : Do one of the following based on the reason code:
1 — Add a member to &1 (ADDPFM).
2 — Restore &1 (RSTOBJ).
3 — Start journaling on &1 (STRJRNPF), or get access to the journal.
4, 5, or 6 — Perform a CHGDBG command with UPDPROD(*YES).
7 — Remove table names which identify files in QTEMP or program described
files.
8 — Use tables in the same ASP.
9 — Use the EDTRBDAP command to change the sequence of the access path
from HELD to 1-99 or *OPN, or rebuild or delete the unique index or
constraint.
10 — Specify tables that are valid for constraints or triggers.
11 — Specify a schema other than QTEMP, or create the view over only one
distributed table.
12 — Specify a schema other than QTEMP, QSYS, QSYS2, or SYSIBM.
13 — Specify a schema that does not contain a data dictionary or remove
all DATALINK and LOB columns.
14 — Specify SQL table for adding the DATALINK or LOB column.
15 — Specify an object in the same ASP as the current commitment
definition or end the current commitment definition.
16 — Specify a different sequence, or delete the data area associated

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
    The below is the exact command which is being used in EXECUTE statement Below that you have: The same command works fine in STRSQL. Not sure why this is not working in a SQLRPGLE. Nowhere is the SQL statement shown. How can we comment if you don't show the statement? If this is a statement constructed in RPG code, it's almost guaranteed the it is not the same statement in STRSQL. In RPG, you probably have variables being concatenated into the statement, and you won't have variables in STRSQL. So, there are differences. Show the statement so we can comment. 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