Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: variable binding in DDL statements problem
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