| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
|
| Having solved my previous problem I am currently creating an SQLDA to use as a descriptor when FETCHing data in ESQLC I'm passing in a User Class object from OpenROAD as a handle, along with a SELECT statement and creating an SQLDA based on the data types, lengths, nullability of the class attributes, but only for the columns I want to SELECT (every column is an attribute of the class) Using examples in the doco I get a buffer full of data for each FETCH and can extract chars, varchars and dates from the buffer (as in the code snippet in the Dynamic SQL section of the ESQLC guide) using sqltype and sqllen. However I am unable to work out how to convert the results in the buffer into the respective integer or float columns I'm also having trouble getting my program to determine which values are null or not If ANYONE has even done dynamic SQL in C then I could REALLY do with some assistance Regards Colin |
|
#2
|
| "Colin Hay" news:S2N7k.13878$IK1.398-at-news-server.bigpond.net.au... > Having solved my previous problem I am currently creating an SQLDA to use > as a descriptor when FETCHing data in ESQLC > > I'm passing in a User Class object from OpenROAD as a handle, along with a > SELECT statement and creating an SQLDA based on the data types, lengths, > nullability of the class attributes, but only for the columns I want to > SELECT (every column is an attribute of the class) > > Using examples in the doco I get a buffer full of data for each FETCH and > can extract chars, varchars and dates from the buffer (as in the code > snippet in the Dynamic SQL section of the ESQLC guide) using sqltype and > sqllen. However I am unable to work out how to convert the results in the > buffer into the respective integer or float columns You don't have to convert anything. You map the buffer out with suitable amounts of space in the appropriate position and the values are deposited there in a directly usable form. > I'm also having trouble getting my program to determine which values are > null or not The null indicator is returned at the location pointed to by the sqlind in the element of sqlvar[] that you are looking at. > If ANYONE has even done dynamic SQL in C then I could REALLY do with some > assistance It's been a few years but I should be able to dredge up something for you. Can you post code? Roy -- UK IUA 2009 will be held on Tuesday June 9, 2009 Go to http://www.iua.org.uk/member/signup....de_paysys=free to join the mailing list. |
![]() |
| Thread Tools | |
| Display Modes | |