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: variable binding in DDL statements problem

Re: variable binding in DDL statements problem

From: Dave <treschaud33_at_hotmail.com>
Date: 16 Feb 2005 14:32:46 -0800
Message-ID: <1108593166.090637.125730@z14g2000cwz.googlegroups.com>


Create a procedure that does builds the DDL statement and executes it.

Example procedure:

Create or replace procedure Build_bug_view (p_dt in varchar2, p_usr in varchar2)

is

v_sql varchar2(500);

begin

v_sql := 'CREATE VIEW BUG_VW AS SELECT * FROM BUG WHERE BG_DETECTION_DATE= to_date(' || p_dt || ',''mm/dd/yyyy hh24:mi'') And BG_USER= ''' || p_usr || '''';

execute immediate v_sql;

end;
/

Calling procedure:

exec Build_bug_view('12/31/2004 14:00','jjames'); Received on Wed Feb 16 2005 - 16:32:46 CST

Original text of this message

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