Re: sqlda structure
Posted in 1996
I suggest going to the IIUG archives (http://www.iiug.org) and looking in the software repository. Under the index for ESQL/C software, there is an entry 'sqlda funcs' and another for sqlcmd, both of which I wrote. SQLCMD is a full-blooded command interpreter (replacement for ISQL and DB-Access within a (shell) scripting environment); the other is an extract from SQLCMD which shows how it handles blobs. SQLCMD prints the values returned in columns, but has code to put the heading at the top of each column. It is not beyond the wit of humankind to to adapt the code in SQLCMD to print columnname:value instead of columnname value1 value2 One warning; the version of SQLCMD in the archive is version 8 and dates back a few years,m and hence versions of ESQL/C. One mythical day when I get some time, I'll finish tidying up my current version (20) so that it gets reposted. The problems with it are primarily porting issues -- if you want to do some testing and aren't using Sun Solaris 2.4 and version 7.20 ESQL/C, then I would be prepared to send the newer code on an as-is basis provided you promise to give me the feedback I need to fix any compilation problems you encounter... And it is going to take some work to upgrade it to work with the new features of Informix Universal Server when that comes out at the end of this year. Your basic problem is that blobs have to be fetched into a locator (loc_t) structure; there are no implicit conversions to other data structures. What you do with it after it is retrieved is up to you. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> >From: marks@po.EECS.Berkeley.EDU (Gregory A. Marks) >Date: 8 Oct 1996 19:06:13 GMT >X-Informix-List-Id: <news.29037> > >I am trying to do the following: > >1. execute a dynamic query >2. for each row returned > a. for each column print out colname:colvalue > >I am using the sqlda structure, so when I do a fetch >the values from these columns are inserted into the >value field of the sqlda structure. The problem arises >when the column is of type TEXT (blob). I get error 450 >because a blob value is trying to get placed in the data >field of the sqlda structure which is of type (char *) > >Does anyone know how I can remedy this? >Does anyone know how I can solve my initial problem >(maybe some other way)