PL/SQL (MOSC)

MOSC Banner

Using a variable parm with IN list...

edited Jun 30, 2011 6:21AM in PL/SQL (MOSC) 6 commentsAnswered
 Why does the hard-coded list for WHERE work, but not the l_sql_list variable? dbms_output shows variable l_sql_list matches  

set serveroutput on ;

 DECLARE

  l_PO_1             VARCHAR2(15) := '624091' ;
  l_PO_2             VARCHAR2(15) ;
  l_PO_3             VARCHAR2(15) ;
  l_PO_4             VARCHAR2(15) ;
  l_PO_5             VARCHAR2(15) ;
  l_SQL_List         VARCHAR2 (1024);

BEGIN
     
      l_SQL_List := '(' || '''' || Trim(l_PO_1) || ''''
                 || ',' || '''' || Trim(l_PO_2) || '''' 
                 || ',' || '''' || Trim(l_PO_3) || ''''
                 || ',' || '''' || Trim(l_PO_4) || ''''
                 || ',' || '''' || Trim(l_PO_5) || ''''
                 || ')' ;
DBMS_OUTPUT.PUT_LINE ('SQL_LIST: ' || l_SQL_List ) ; --this line of code works.... DELETE FROM APPS.Purchase_orders where 

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center