Re: [Q] Blank problem in Pro*C
From: Ian Funnell <ian_at_icf0.demon.co.uk>
Date: 1996/11/30
Message-ID: <+q8pGAANuAoyIws8_at_icf0.demon.co.uk>#1/1
Date: 1996/11/30
Message-ID: <+q8pGAANuAoyIws8_at_icf0.demon.co.uk>#1/1
Use the "VARCHAR" C datatype instead of char. When a value is fetched into the 'arr' component of the structure, Oracle sets the 'len' component to the length of the string.
e.g.
v_name VARCHAR[11]; /* declare 10 + 1 for NULL */Received on Sat Nov 30 1996 - 00:00:00 CET
...
EXEC SQL FETCH ... INTO :v_name;
...
v_name.arr[v_name.len] = '\0'; /* Null terminate */
...
printf("v_name is %s\n", v_name.arr); -- Ian Funnell ian_at_icf0.demon.co.uk