Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: First attempt with Dynamic SQL
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 EggenbergerReceived on Sun Apr 18 2004 - 12:54:49 CDT