Re: Inconsistency with SQL in ACS vs RPG
Daniel Gross <[email protected]>
| Newsgroups | gmane.comp.lang.as400.rpg |
|---|---|
| Message-ID | <[email protected]> |
Hi, this week at TechXchange in Orlando, I have seen a nice feature in the VScode/Db2i extension: select * from table where col1 = ? and col2 = ?; bind: 'ABC' 123; bind: 'DEF' 456; The "bind:" lines bind the values to the parameters. And of course, when they do that, it should also work with "named variables": select * from table where col1 = :var1 or col3 = :var1; bind: var1='ABC'; bind: var1='DEF'; Every "bind:" line stands for an individual execution of the SQL statement above. This would make copying SQL statements out of a program source so much easier - and it would give us the opportunity to have "persistant" values for variables. I created an idea, to add that to iACS/RSS too: https://ibm-power-systems.ideas.ibm.com/ideas/IBMI-I-4655 If you like it, please vote - thank you. Kind regards, Daniel > Am 09.10.2025 um 09:52 schrieb Vern Hamberg via RPG400-L <[email protected]>: > That's the one, Dan - thanks for finding it. I voted. > > *Regards* > > *Vern Hamberg* > > IBM Champion 2025 <cid:[email protected]> CAAC (COMMON Americas Advisory Council) IBM Influencer 2023 > > > On 10/8/2025 7:43 PM, Dan Bale wrote: >> You mean, like this one? >> >> https://ibm-power-systems.ideas.ibm.com/ideas/IBMI-I-4640 >> >> - Dan Bale >> >> -----Original Message----- >> From: RPG400-L<[email protected]> On Behalf Of Vern Hamberg via RPG400-L >> Sent: Wednesday, October 8, 2025 5:51 PM >> To:[email protected] >> Cc: Vern Hamberg<[email protected]> >> Subject: Re: Inconsistency with SQL in ACS vs RPG >> >> Hi all >> >> We can also save the SQL that contains host variables or parameter markers - it's just a text file. >> >> Daniel, I'm also not happy that I have to enter a value for each instance of a host variable. I go back to how it works in QMQRY, the same substitution string needs the value entered only one time. I know, different interface. >> >> But one of us should submit an Idea for this to change. I'll look to see if there might already be one, maybe submit it myself - what a concept, eh? :) >> >> *Regards* >> >> *Vern Hamberg* >> >> IBM Champion 2025<cid:[email protected]> CAAC (COMMON Americas Advisory Council) IBM Influencer 2023 >> >> >> On 10/8/2025 9:09 AM,[email protected] wrote: >>> Daniel >>> In RSS try creating variables first and then populate the variables with a SET statement. >>> You can then save the SQL for later use and you will not have to re-enter any values. >>> Darryl Freinkel >>> A4G >>> Telephone: 770.321.8562 >>> -----Original Message----- >>> From: RPG400-L<[email protected]> On Behalf Of >>> Daniel Gross >>> Sent: Wednesday, October 8, 2025 8:49 AM >>> To:[email protected] >>> Subject: Re: Inconsistency with SQL in ACS vs RPG >>> I do that occasionally - but sadly the pseudo-host-variables in iACs are ... >>> a) not persistent - so I have to re-enter them at every execution >>> again and again - VScode DB2 for I has a new "bind:" prefix - I have >>> to look into this >>> b) if you have the same host-variable multiple times, you have to >>> enter it multiple times - which is also less than ideal >>> But all in all I use that feature here and there. >>> Regards, >>> Daniel >> *** CONFIDENTIALITY NOTICE: The information contained in this communication may be confidential, and is intended only for the use of the recipients named above. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please return it to the sender immediately and delete the original message and any copy of it from your computer system. If you have any questions concerning this message, please contact the sender. *** > -- > This is the RPG programming on IBM i (RPG400-L) mailing list > To post a message email: [email protected] > To subscribe, unsubscribe, or change list options, > visit: https://lists.midrange.com/mailman/listinfo/rpg400-l > or email: [email protected] > Before posting, please take a moment to review the archives > at https://archive.midrange.com/rpg400-l. > > Please contact [email protected] for any subscription related questions. -- This is the RPG programming on IBM i (RPG400-L) mailing list To post a message email: [email protected] To subscribe, unsubscribe, or change list options, visit: https://lists.midrange.com/mailman/listinfo/rpg400-l or email: [email protected] Before posting, please take a moment to review the archives at https://archive.midrange.com/rpg400-l. Please contact [email protected] for any subscription related questions.