Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Any expert Pro*C/C++ programmer out there?

Re: Any expert Pro*C/C++ programmer out there?

From: Laurenz Albe <invite_at_spam.to.invalid>
Date: 14 Mar 2007 09:11:46 GMT
Message-ID: <1173863498.463513@proxy.dienste.wien.at>


Ramon F Herrera <ramon_at_conexus.net> wrote:

>>> In my application, the critical variable which is only known at run
>>> time is none less than the table name. It is something like this:
>>
>>> SELECT emp_name FROM $table_name WHERE emp_id = :some_unique_id;
>>
>> I think that 'dynamic SQL' is what you are looking for.

>
> Exactly. Oracle provides four ways to use Dynamic SQL:
>
> - Method 1
> - Method 2
> - Method 3
> - Method 4
>
> The first two cannot be used in queries (SELECT) and the last one is
> more than I need. Therefore, I have to use Method 3.

I see; you didn't mention that you knew.

Yes, 'Method 3' is appropriate.

Do I get it right that your only question is whether this could be done in a simpler way or not?
I don't think so, Oracle is quite explicit about that. However, I think that you are exaggerating - the additional complexity consists of 2 or 3 more statements to write.

Yours,
Laurenz Albe Received on Wed Mar 14 2007 - 04:11:46 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US