× 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.



"RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> wrote on 07/04/2019
03:21:41 PM:
For idx = 1 to columnNbr;
Exec sql GET DESCRIPTOR :desc1 VALUE :idx :journalData.colName =
DB2_SYSTEM_COLUMN_NAME,
:journalData.type = TYPE,
:journalData.length =
LENGTH,
:journalData.precision =
PRECISION;

Select;
When journalData.type = 4; // Integer
Exec sql GET DESCRIPTOR :desc1 VALUE :idx :intType = DATA;
yajl_addChar('' + journalData.colName + ''
:%Char(intType));
Endsl;
Endfor;

I got this far but I don't know how I should be getting DATA. The
documentation says that the data type of DATA matches the data type
specified by TYPE. For example, if the TYPE = 1 (character) than
CHARACTER(n)
So how would I declare a variable to receive DATA. In the above
example I
think I'm handling the INTEGER tyoe correctly but how do I define
varaiable
for the other types?


As stated in the manual, the variable [definition] must have the
same data type, length, precision, scale, and CCSID as the indexed entry
in the descriptor. The reason for this is because SQL performs a
storage-to-storage move of the data as a memory block. Meaning, SQL does
not use the data definition rules of an RPG EVAL (for example) as to the
compatibility between the source and the target definitions. So, you're
going to need a variable definition for every expected differing column
value you might encounter.


Sincerely,

Dave Clark

As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.