Home » Fusion Middleware & Colab Suite » Weblogic & Application Server » query a data from dbms_sql.varchar2_table
query a data from dbms_sql.varchar2_table [message #156931] Mon, 30 January 2006 02:49 Go to next message
ganeshsv
Messages: 51
Registered: January 2006
Member
I have a variable of type dbms_sql.varchar2_table. And rows are inserted into it. Is it possible to retrieve a record from dbms_sql.varchar2_table?
Re: query a data from dbms_sql.varchar2_table [message #156949 is a reply to message #156931] Mon, 30 January 2006 05:56 Go to previous message
Frank Naude
Messages: 4565
Registered: April 1998
Senior Member
Yes, here is an example:

SET SERVEROUTPUT ON
DECLARE
  v_tab  dbms_sql.varchar2_table;
  CURSOR c IS SELECT table_name FROM user_tables;
BEGIN
  -- Populate the varchar2_table...
  OPEN c;
  FETCH c BULK COLLECT INTO v_tab;
  CLOSE c;

  -- Retrieve records from varchar2_table...
  FOR i IN v_tab.FIRST .. v_tab.LAST LOOP
    dbms_output.put_line('Value for row '||i||' = '||v_tab(i));
  END LOOP;
END;
/

Previous Topic: configuration
Next Topic: Configuring iAS for Forms and Reports
Goto Forum:
  


Current Time: Thu Oct 29 09:31:40 CDT 2020