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: Problem in SELECT ... WHERE ... IN

Re: Problem in SELECT ... WHERE ... IN

From: Uwe Schneider <pi_at_nospam.richard-schneider.de>
Date: Sun, 14 Mar 1999 14:28:56 +0100
Message-ID: <36EBB998.FB1D1A70@nospam.richard-schneider.de>


lamtse wrote:
Hi,
>
> Dear Oracle experts,

I'm no expert, but the answer is easy...

> string_1 := ''''||'KG'||''''||','||''''||'GD'||'''';
> dbms_output.put_line(string_1);
> insert into table_1
> select column_1 from table_2
> where column_2 IN (string_1);
> The above will show 'KG','GD' on screen of SQL Plus but no row has been
> inserted to table_1.
> Any idea what has gone wrong?

Well, you expect Oracle to automagically do something which is equivalent to the "eval" command of the unix shell or of perl. But, Oracle will assume that "'KG','GD'" is a valid content of column_2. You might want to consider using the DBMS_SQL package for dynamic SQL within PL/SQL.

Uwe

--

Uwe Schneider       | Telefon +49 7251 / 82587
Karlsdorfer Str. 31 | Mail    pi_at_richard-schneider.de
76646 Bruchsal      | 

Linux - OS al dente! Received on Sun Mar 14 1999 - 07:28:56 CST

Original text of this message

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