|
Il 03/02/2026 10:14, stefan@xxxxxxxxxx ha scritto:
Hi Luca - good to hear about 24/7 🙂Library/file combo you need to update.
Likely the best approach here might be to use a create alias for every
You can create the alias in qtemp ( it will be a ddm-file object ).You're the fourth person to mention alias creation.
Then you will be able to keep your sql-logic almost intact.
This is the same as making alcohol the main course but ..... 😱
Best regards
Stefan
Now I'd like to understand: said that in my application context, creating
an
alias doesn't make much sense. In terms of overall performance and code
clarity
and maintainability to me there's not much difference between a situation
like this:
<code>
dcl-s sqlstring varchar(300) inz;
sqlstring ='Insert into ';
if company <> defaultCompany;
sqlstring +=%trim(companyLib) + '.';
endif;
sqlstring +='MYFILE (FIELD01, FIELD02, FIELD03, FIELD04, FIELD05,
FIELD06, ' +
'FIELD07, FIELD08, FIELD09, FIELD10, FIELD11, FIELD12, ' +
'FIELD13, FIELD14, FIELD15) ' +
'VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)';
Exec SQL Prepare I1 From :sqlstring;
For i = 1 to MaxValue by 1;
Reset MyDS;
MyDS = MyArray.MyRec(i);
EXEC SQL EXECUTE I1 USING :MyDS.F01, :MyDS.F02, :MyDS.F03, :MyDS.F04,
:MyDS.F05, :MyDS.F06, :MyDS.F07, :MyDS.F08,
:MyDS.F09, :MyDS.F10, :MyDS.F11, :MyDS.F12,
:MyDS.F13, :MyDS.F14, :MyDS.F15;
if sqlcode <> 0;
logError(yabadabadoo);
retcode='1';
leave;
elseIf sqlcode = 0;
retcode='0';
endif;
Endfor;
return retcode;
</endcode>
or create and alias in qtemp and manage it. Or am I missing something?
TIA
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.