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



Thanks for all the information. 
I now understand how Dynamic SQL is handled using SQLDA. One remaining thing I 
need to know is How to get the numeric data from SQLDATA. To get the character 
data I can use 
charData=%str(SQLADATA:SQLLEN)
What is it I need to do extract numeric value into a numeric variable?
something like 
numericData=%num(SQLDATA:Precision:Scale)
numericData is (30,9) 

Ali


-----Original Message-----
From: Carel Teijgeler [mailto:coteijgeler@xxxxxxxxx]
Sent: Wednesday, August 06, 2003 1:46 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: RE:Dnamic SQL question


Ali,

Doing this on top of my head (being at home) and using SQLDA with the QSQPRCED 
API.

Initialize the subfields SQLN and SQLD with a value 0 and do a decscribe; it 
should return the number of columns within the result set  (value is in SQLN).
Now use those value in SQLN and SQLD to do a second describe; it will return 
the information for each field (data type, number of decimals, fieldname, text)

I do not know if this will work with embedded SQL, but I think it should. 
Others may correct me on this.

The mentioning of the DYNSQL service programme form the Toolkit is a bit 
cumbersome, as it will do one field only and on SQL based tables, not DDS based 
PF's.

Regards,
Carel Teijgeler.

*********** REPLY SEPARATOR  ***********

On 5-8-03 at 15:32 Ali Ekinci wrote:

>Anybody has a good running sample of a SQL DESCRIBE using SQLDA ?
>Trying to figure out how to fetch, if the column list is unknown,
>I have searched the archives, but wasn;t able to find a good sample.



_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.