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

Home -> Community -> Usenet -> c.d.o.misc -> Re: First attempt with Dynamic SQL

Re: First attempt with Dynamic SQL

From: Marc Eggenberger <nw1_at_devnull.ch>
Date: Sun, 18 Apr 2004 19:54:49 +0200
Message-ID: <MPG.1aecdf5173d0c6f989683@news.individual.net>


In article <7b0834a8.0404180941.71e228fa_at_posting.google.com>, thomas.kyte_at_oracle.com says...

[...]

I found now in Oracle PL/SQL (from Steven Feuerstein) that you cant bind table names. But the other thing is working now. Thanks a lot to all of you for helping me.

> you bound the wrong thing!
>
> identifiers cannot be bound.
>
>
> open config_cursor for
> 'select * from ' || v_name || ' where probid = :x' using intProbeId;
>
>
> the rule with binds in DML is -- if you could go into sqlplus and use
> a character string literal, you can bind it.
>
> Eg:
>
> select * from emp where empno = 55;
>
>
> in that query, 55 can be bound because:
>
> select * from emp where empno = '55';
>
> would be "valid" but -- emp itself (and in fact nothing else in that
> string) cannot be bound because:
>
>
> select * from 'emp' where empno = 55;
>
> would not be valid -- you cannot select from the string 'emp'.
[...]

-- 
mfg
Marc Eggenberger
Received on Sun Apr 18 2004 - 12:54:49 CDT

Original text of this message

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