QMF issue

80 pts.
Tags:
AS/400 DB2
QMF
Query Management Facility
SQL
I have my QMF for windows version 8.1 Fix Pack 13, and I try to run this instruction INSERT INTO destination table SELECT * FROM origin table and every time I receive this error message: An error occurred while running the query. destrination table not valid for operation. (SQL code = -7008, SQL state = 55019) If I try by selecting each field like the next sentence INSERT INTO destination table(field 1, field2, ...,field n) SELECT field1, field2, ........., field n FROM origin table the error is this: An error occurred while running the query. Value cannot be specified for GENERATED ALWAYS column field1. (SQL code = -798, SQL state = 428C9) But the most interesting thing is that each one of this sentences works perfectly everytime in my AS/400( SQL) session, and I would like to know the reason, do I have to change my QMF? or everytime that I need to run a sql sentence forgot that I have QMF? or QMF is not the right tool to run a sql sequence? or simply, QMF is worthless?, please advise me in this matter I would like to continue beliving and using QMF Another question, is there a better product to use intead of QMF, somethig that allows me to debug my sql intructions? Thanks for your advise
ASKED: June 2, 2008  9:28 PM
UPDATED: October 31, 2009  1:43 AM

Answer Wiki

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

Try adding OVERRIDING SYSTEM VALUE here:
<pre>INSERT INTO destination table OVERRIDING SYSTEM VALUE SELECT * FROM origin table
</pre>
Without knowing more than what you show, it’s hard to be about exact syntax or even if it’s appropriate. There’s no way to be sure that the schemas match up between QMF and interactive SQL, nor if the same user is involved, nor if there are session settings that are set, nor almost anything else.

Given this error — Value cannot be specified for GENERATED ALWAYS column field1. — it’s hard to accept that the two scenarios, QMF and interactive SQL, are operating on the same table with the same statements unless the two sessions are configured differently.

Tom

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
    As for the second question, I don't know of anyone who uses QMF to test SQL against a DB2 for System i database; so I can't offer an opinion on how appropriate it is. I would simply use System i Navigator ( or whichever Navigator matches in your site.) 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