Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Pro*C Help Needed
Ed Tolsch wrote:
>
> I'm trying to use a host variable within a select clause as follows:
>
> EXEC SQL BEGIN DECLARE SECTION
> char HostVar[10][15];
> EXEC SQL END DECLARE SECTION
>
> strcpy(HostVar[0], 'string1');
> strcpy(HostVar[1], 'string2');
>
> select somefield
> from table
> where value in (:Hostvar);
>
> This does not return any values unless I fill up the entire array. Any
> help would be appreciated! Thanks.
hello,
You must use EXEC SQL SELECT .... INTO ... FROM ... WHERE ...
but not for return more than 1 row.
If you want to return many rows use a CURSOR with a FETCH.
Hugo, Toulouse, France Received on Thu Aug 14 1997 - 00:00:00 CDT