Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Paul found that DESCRIBE in ESQL/C returned the correct sqltype (SQLLVARCHAR) for an LVARCHAR column but always gave sqllen = 0, and asked whether another call was needed to get the defined length. VG posted a small describe/prsqlda test program that correctly reported len = 100 on CSDK 2.90.UC3; Paul's failing setup was CSDK 2.80 (ESQL 9.52). The issue turned out to be the client version: after upgrading his Solaris CSDK to 2.90.FC4, sqllen was returned correctly.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Paul Dembry — — source: Usenet: comp.databases.informix
Has anyone used esqlc to describe a table that has a LVARCHAR column? I get
SQLLVARVHAR as the sqltype (correct) but sqllen always returns 0. Is there
some other call that I have to make to get the defined length?
Paul
I tried a sample with 9.40.UC3 on AIX and seem to get the data
properly.
Here is a sample app,
$include "sqlca.h";
$include "sqlhdr.h";
struct sqlda *dastruct;
main()
{
$begin declare section;
$int i,desc_count;
$end declare section;
$database stores_demo;
printf("%d\\n",SQLCODE);
$prepare stmt from "select * from vctab";
$describe stmt into dastruct;
desc_count = dastruct->sqld;
for (i = 1; i <= desc_count; i++)
prsqlda(i, &(dastruct->sqlvar[i-1]));
printf("\\n\\n");
}
prsqlda(index, sp)
int2 index;
register struct sqlvar_struct *sp;
{
printf(" Column %d: type = %d, len = %d, name = %s\\n",
index, sp->sqltype, sp->sqllen, sp->sqlname);
}
o/p...
Column 1: type = 43, len = 100, name = col1
Are you seeing this in any particular platform?
VG.
Please post the CSDK and server versions being used.
↪ replying to VG
Paul Dembry — — source: Usenet: comp.databases.informix
"VG" <gopalvg@gmail.com> wrote in message
news:1145478677.215673.111940@i40g2000cwc.googlegroups.com...
> Please post the CSDK and server versions being used.
I'm running this on CSDK 2.80, ESQL version 9.52.FC2 against a 9.40 FC4 64
bit Solaris instance. I'll try your example on our AIX box.
Thanks,
Paul
↪ replying to VG
Paul Dembry — — source: Usenet: comp.databases.informix
Hi VG,
> I tried a sample with 9.40.UC3 on AIX and seem to get the data
> properly.
I tried your sample on 9.40.FC4 on AIX using CSDK 2.80, ESQL 9.52.FC1 and it
fails to return a value in sqllen. What CSDK and ESQL versions are you
using?
Regards,
Paul
Paul Dembry wrote:
> Hi VG,
> > I tried a sample with 9.40.UC3 on AIX and seem to get the data
> > properly.
> I tried your sample on 9.40.FC4 on AIX using CSDK 2.80, ESQL 9.52.FC1 and it
> fails to return a value in sqllen. What CSDK and ESQL versions are you
> using?
> Regards,
> Paul
CSDK version being used is 2.90.UC3. I will check on when this support
was added to ESQL/C and get back.
↪ replying to VG
Paul Dembry — — source: Usenet: comp.databases.informix
Hi VG,
> CSDK version being used is 2.90.UC3. I will check on when this support
> was added to ESQL/C and get back.
I upgraded my Solaris CSDK to 2.90.FC4 and it works correctly now.
Thanks!
Paul
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.