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



Ali,

I am not familiar with graphics or DBCS data, nor with pointer arithmetic.
Barbara Morris already gave an answer on that.

I have done this

Every data type has a seperate subfield in my array Resultset, CharValue is the 
character subfield in this array
SQLDATA is subfield of SQLVAR
SQL_VAR is array subfield in SQLDA
SQLDA is data structure passed to SQL processor.
SQLIx reference the column number in the SQL resultset

First "link" my Resultset to the SQLDA. Every array element in Resultset 
represents one column of the SQL result set. The same applies to the SQL_VAR.

C                   Eval      SQLDATA = %addr(CharValue(SQLIx)) 
C                   Eval      SQL_VAR(SQLIx) = SQLVAR       

After a record fetch per column in recordset 

C                   Eval      SQLVAR = SQL_VAR(SQLIx)  
C                   Eval      Line = %trimr(Line) + %trim(CharValue(SQLIx)) 

So your substring might be:
c                   eval      
wChar=%char(%subst(VarGraph(SQLIx):3:DescribedLength(SQLIx)))    

I would use the actual length retrieved from the SQL function "describe", which 
I store in another array.

Hope this is helpful.

Regards,
Carel Teijgeler.

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

On 20-8-03 at 13:02 Ali Ekinci wrote:

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




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.