Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: when is a variable not a variable

Re: when is a variable not a variable

From: N Prabhakar <prabhs_at_po.pacific.net.sg>
Date: 1997/01/29
Message-ID: <5cnc7f$r43@newton.pacific.net.sg>#1/1

bach_at_panix.com (John Steinbach) wrote:
>PROCEDURE count_tables IS
>v_name CHAR(20);
>v_count INTEGER;
>CURSOR c_tables IS
> SELECT table_name
> FROM user_tables
> WHERE tabelspace_name = 'tablespacename';
>BEGIN
>
> FOR x IN c_tables LOOP
> v_name := x.table_name;
> SELECT COUNT(*) INTO v_count
> FROM v_name;
>
> INSERT INTO table_count(table_name,count)
> VALUES(v_name,v_count);
> ENND LOOP;
>END;
>
>

Hi there,

You are trying to execute a dynamic sql statement in your plsql block. You need to open a cursor, then parse it and then execute it. You need to use DBMS_SQL.open_cursor. I am not sure of the syntax, Atpresent I am at my residence, I will forward you from the office tomorrow.

Regards

N.Prabhakar Received on Wed Jan 29 1997 - 00:00:00 CST

Original text of this message

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