× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Just saw Jon's reply of:

Dcl-s SQLStuff VarChar(32000: 4) Based( %Addr( EZDQLSTL ) ); // Length
can be anything up to 16Mb

This way you would be using QSYSINC and getting what you want directly.
Nice :)


On Mon, Dec 9, 2019 at 11:55 AM Bruce Vining <bruce.vining@xxxxxxxxx> wrote:

I'm confused by your 'SqlPtr = %addr(EZDQLSTL) + 2'. EZDQLSTL is a 4-byte
integer so I would have expected '+ 4' to get to the start of the SQL
statement text. With that change you're now just addressing the statement
text directly (and don't need the varying definition) so

dcl-s upper char(9216) based(SqlPtr);
sqlPtr = %addr(EZDSLSTL) + 4;

and the lesser of 9216 or EZDQLSTL references the (up to) 9216 bytes of
(the commented) EZDSQLST00 element now known as upper.

Either that or just defining a new DS such as:

dcl-ds myDS qualified;
hdr likeds(EZDSQLF2)
upper char(9216);
end-ds;

and again %subst the lesser of hdr.EZDQLSTL or 9216 bytes of hdr.upper.

You could also directly define the text as being varying(4) with the same
start location (235) of EZDQLSTL but that would mean not using the QSYSINC
include and building your own.

There are of course also other ways. My leaning would be to the DS
approach using QSYSINC.


On Mon, Dec 9, 2019 at 11:02 AM C Holko <christopherholko@xxxxxxxxx>
wrote:

So, I have this
XSql1024 S 9216 Varying
Based(SqlPtr)

Upper S Like(XSQL1024)

and later some code does
SqlPtr = %addr(EZDQLSTL) + 2
Upper = XSQL1024

The EZ* fields are from QSYSINC/QRPGLESRC EZDAEP coming in the exit
QIBM_QZDA_SQL2

I need to clip XSQL1024 so it will always fit in Upper. I am getting SQL
strings in excess of 9k.

What are my options?
--
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@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com



--
Thanks and Regards,
Bruce
931-505-1915




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 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.