dallara@hpcc01.corp.hp.com (Jon Dallara) writes:
>PROBLEM: Data looks fine in isql (key3).
> When 'fetched' from esql/c
> it returns only 1 byte from a 2 byte field.
[...]
>key3 char(2) yes
[...]
>/* bad-prog.ec -- esql test program */
>#include <stdio.h>
>$char csKey3[2];
^
Should be three long, because the string gets copied and null terminated.
Therefor, if you provide a character array one too short, you get what
you asked.
>**** bad-prog output: notice that only a "P" was returned, instead of "PA" ****
>key3 = |P|
>$char csKey2[16];
See what I mean :-)
>**** good-prog output is fine ****
>key2 = |EVA-3300 |
Klaus
--
__________________________________________________________________________
Klaus Lichtenwalder, Dipl. Inf., Datapat GmbH, Mauerkircherstr. 8
D-81679 Muenchen, F.R. Germany, Fax +49-89-983297
email: Lichtenwalder@ACM.org, klaus@gaston.boss.sub.org