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 -> Re: Materialized view dynamic row count

Re: Materialized view dynamic row count

From: Geoff Muldoon <geoff.muldoon_at_trap.gmail.com>
Date: Wed, 12 Oct 2005 15:54:28 +1000
Message-ID: <MPG.1db75024493a641b9896fb@news.readfreenews.net>


postbus_at_sybrandb.demon.nl says...
> <geoff.muldoon_at_trap.gmail.com> wrote:
> >
> >I am in the habit whenever using execute immediate of declaring a varchar2
> >named v_sql, populating the string and then calling it. Had tried:
> >
> >v_sql := 'select count(*) from '||c.view_name||' into '||l_count;
> >execute immediate v_sql;
> >
> >and this was failing.
>
> The correct syntax is, IIRC, execute immediate into variable.
>

Thanks Sybrand,

v_sql := 'select count(*) from '||c.view_name; execute immediate v_sql into l_count;

work perfectly (as did Connor's advice), and additionally enables me to maintain my preferred coding style.

Sometimes it's just the littlest things ...

Cheers,

Geoff M Received on Wed Oct 12 2005 - 00:54:28 CDT

Original text of this message

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