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



[ Converted text/html to text/plain ]

<<Interesting.  I know at least one of the manuals I read said that if I used
<<the SQLDA I could not use the INTO clause on the FETCH, so I hadn't tried
<<it.  Apparently, that is wrong since you are doing it.

I haven't seen that in the manual. Do you know which one? I know it doesn't
work unless you use the ROWS clause on the FETCH.
<I agree that I don't won't to use externally described DS's.  I'm trying to
<get away from that.  The only way I've found to do that was with pre-defined
<work fields of every possible type & size that the SQLDA might return to me.
<That would seem to also be required your way too, isn't it?  I mean, what do
<you parse out the big character field into?

Yes and no. All I'm trying to do with the output of the select is to print the
report. So I just need to format some of the fields. For Alpha, dates, and
numerics fields I don't any special processing. I just position them on the
output line where I want em using substring from one field to another.  Packed
fields need to be unpacked, but you only need one packed field for that. I
don't have binary fields, timestamps, BLOBS, GLOBs, etc on my system so I
haven't worried about em. I think you would need field definitions for each of
those types.
<I started out using the SYSTABLES catalog file and right away I needed
<binary fields, varying fields, TimeStamps, etc.  I was toying with the idea
<of useing Based arrays of different types so I could Allocate and Reallocate
<additional instances of them as needed. It's still going to take a lot of
<arrays.  How are you handling this requirement?

This was my first thought too when I first started out on this project. But
then I couldn't decide how that would work. I mean if the first, fifth, and
tenth columns of the result table were packed fields, would they be in the
first, fifth, and tenth elements of my packed based array? Or would they be in
one, two and three. And how would I track it? Or how would I tell the system
in advance where to put them in the arrays? I wouldn't know ahead of time that
first, fifth and tenth fields were packed. So how could I provide the correct
pointer?  And if I'm going to read multiple ROWs on the FETCH I think I need
multiple occuring data structures for the arrays. This seemed like a lot of
work just to figure out the approach so I decided to see if the system would
put the data into one long data structure.
<Also, where did you find the data type chart you were referring to earlier?
<The one I'm using is an equivalency chart of SQL to RPG data types in
<chapter 14 of DB2 for AS/400 SQL Programming.  However, it seems to be
<rather limited, in that I'm running into many types that are not on that
<chart.  The same is true of the SQLCODE's I got out of the SQL reference
<manual.  I'm getting many codes not on their list, however when in DEBUG,
<the descriptions are put into the joblog so at least they are manageable.



For the SQLCODE's you might try the DB2 Database Messages and Codes manual.
You can download this from the info center. I'll have to go search for the
data type chart. I'll get back to you.



Ron Hawkins



As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.