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 -> Binding types to a dynamic sql statements

Binding types to a dynamic sql statements

From: Christopher Tava <christophertava_at_hotmail.com>
Date: 18 Aug 2001 18:54:04 -0700
Message-ID: <82cecea6.0108181754.3b9ab93c@posting.google.com>


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

Original text of this message

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