Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Binding types to a dynamic sql statements
Has anyone tried to used dbms_sql with the collection types?
I want to bind a type to a sql statment for an insert statment?
i.e.
CREATE OR REPLACE TYPE usertype AS TABLE OF VARCHAR2(20) /
declare
l_user_tab usertype := usertype();
l_varchar2_tab dbms_sql.varchar2_table;
begin
l_user_tab.extend;
l_user_tab(l_user_tab.last) := 'TEST1';
l_user_tab.extend;
l_user_tab(l_user_tab.last) := 'TEST2';
l_sql := 'INSERT INTO '|| l_table_name || ' ' ||
'VALUES(usertype(:l_user_tab))';
WHAT WOULD BE NICE!!!
dbms_sql.bind_array(l_cursor,':l_user_tab',l_user_tab);
WHAT IS AVAILABLE!!!
dbms_sql.bind_array(l_cursor,':l_user_tab',l_varchar2_tab);
Any suggestions!!
Thanks! Received on Sat Aug 18 2001 - 20:54:04 CDT