We have a problem with an embedded SQL RPG program that he is writing. The program uses an ALTER TABLE to add columns to an existing table and then uses an UPDATE to populate them. The problem is that the UPDATE statement is kicking out an error as the pre-compiler doesn't recognise the new columns as belonging to the table at the time of the update.
If he can set the GENLVL to 31 to get past the pre-compiler error, but then the RPG compiler fails as the generated CLI code is incorrect.
We know that we can code the statement dynamically to get round the issue, but as a rule we try to avoid dynamic SQL. My question is, should this be something the pre-compiler ought to be able to deal with or should we be looking at using dynamic SQL or splitting the program into two?
Proud partner of The Ageas Bowl and the Ageas Salisbury International Arts Festival.
Registered Address: Ageas House, Hampshire Corporate Park, Templars Way, Eastleigh, Hampshire, SO53 3YA Registered Number: 354568 England
Authorised by the Prudential Regulation Authority and regulated by the Financial Conduct Authority and the Prudential Regulation Authority
This e-mail together with any attachments are intended for the addressee only and may be private and confidential. If you are not the intended recipient, or the person responsible for delivering it to the intended recipient, you must not open any attachments, or copy, disclose, distribute, retain or use this e-mail, including any attachments, in any way whatsoever; please return it to us immediately using the reply facility on e-mail.
Consider the environment and think before you print this email.
As an Amazon Associate we earn from qualifying purchases.
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.