Re: enum values in EXEC SQL statement

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Wed, 24 Nov 1999 09:08:11 -0500
Message-ID: <f8sn3sol4725211f903hts83v8hm63sin5_at_4ax.com>


A copy of this was sent to mguillem_at_my-deja.com (if that email address didn't require changing) On Wed, 24 Nov 1999 13:35:51 GMT, you wrote:

>It seems not possible to refer to an enum value within a EXEC SQL
>statement like this:
>
>EXEC SQL begin declare section;
> enum toto (t1=1, t2, t3);
>EXEC SQL end declare section;
>
>EXEC SQL select * from myTable where myKey > :t2;
>
>When pre-compiling the above code pro*C/C++ says t2 has to be declared.
>
>I guess this occurs because pro*C/C++ uses addresses of bind variables
>and it can't do it for enum values. But in this case why don't he
>create a new variable initialized with the enum value and then uses
>it's address to communicate with Oracle. This would permit a direct use
>of enum values defined elsewhere in a header file.
>
>Can someone contradict my interpretation of this problem, or confirm it?
>

Host variables (bind variables) are variables. An ENUM is simply *not a variable*. You must have a variable that is defaulted to t2 -- that is just the way it works.

>Marc.
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.

-- 
See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'...
Current article is "Part I of V, Autonomous Transactions" updated June 21'st
 
Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation
Received on Wed Nov 24 1999 - 15:08:11 CET

Original text of this message