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

Home -> Community -> Usenet -> c.d.o.tools -> Re: PL/SQL Problem

Re: PL/SQL Problem

From: Klaus Zeuch <KZeuch_at_hotmail.com>
Date: Thu, 24 Aug 2000 10:32:34 +0200
Message-ID: <8o2mi9$f5b$14$1@news.t-online.com>

See below

Klaus
<bombart_at_my-deja.com> schrieb im Newsbeitrag news:8o2fnl$l9a$1_at_nnrp1.deja.com...
> Hello,
>
> I need your help.
>
> I'd like to write a program, which countts the ata record of a table.
> The result of prog1 should be used in prog 2.
>
> create or replace procedure TabSaetze (TABNAM VARCHAR2) is
> anz number(6);
> begin

Here you have to use either dbms_sql package to generate that statement at runtime or (with 8.1.x) native dynamic sql, e.g.: execute immediate 'select count(*) from ' || tabnam into anz;

> select count(*) into anz from TabNam
> DBMS_OUTPUT.pUT_LINE (TabNam||tochar(anz,'999.999');
> end;
>
> create or replace procedure TabName is
> coursor cu is
> select TNAME from tab;
> TabNam tab.Tname %type;
> begin
> open cu;
> loop
> fech cu into TabNam;
> exit when cu%notfound;
> TABSAETZE (TABNAM);
> end loop;
> end;
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Thu Aug 24 2000 - 03:32:34 CDT

Original text of this message

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