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



 
I am now trying to figure out How to get the VarGraphic data out of SQLDATA. 
I have tried the following, but didn't work out. Any idea what I am missing?


p**---------------------------------------------------------------    
p** getVarGraph                                                       
p**---------------------------------------------------------------    
                                                                      
P getVarGraph     B                                                   
D getVarGraph     PI           256A                                   
                                                                      
d wChar           s            256A                                   
d wLen            s              3S 0                                 
d VarGraph        s            256C   based(ptr1) varying             
                                                                      
c                   eval      ptr1=SQLDATA+2                          
c                   eval      wLen=%len(VarGraph)                     
c                   eval      wChar=%char(%subst(VarGraph:1:wLen))    
c                   return    wChar                                   
                                                                      
p getVarGraph     E                                                   


-----Original Message-----
From: Carel Teijgeler [mailto:coteijgeler@xxxxxxxxx]
Sent: Friday, August 08, 2003 5:39 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: RE: Dnamic SQL question


Ali,

Again from memory, and unlucky for you, it is weekend.

SQLDA contains an array, each element reference a field in the  result set.

With the API I use I have to use a pointer to a variable where the value of the 
field will be stored. Hence, I created an array,  apptly called ResultSet and 
have a subfield for each data type available defined, like

Resultset                DS                              DIM(xx)
    CharValue                                  32
    PackValue                                 30 P  9
    ZonedValue                                30 P  9
 etc..

In the SQLDA I put a %adr(Charvalue(SQLIx)), based on the data type of the 
column in the resultset which I have described with the Describe function.

I do not think SQLDA for the API is different for embedded SQL.

I hope this will help (a little).

Regards,
Carel Teijgeler.

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

On 8-8-03 at 16:32 Ali Ekinci wrote:

>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) 



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