Re: Why these two methods using cursor to acquire table_name and then using this table_name to select its returned lines is always encoutered a weird error?

From: Quanwen Zhao <quanwenzhao_at_gmail.com>
Date: Fri, 10 Dec 2021 10:39:58 +0800
Message-ID: <CABpiuuSrG+nRRz56XMMP7QZk4oprhf=kHw-MtC6Gk+Ntbr3kkg_at_mail.gmail.com>



Hello Dominic 😊,

I've updated these two anonymous pl/sql code blocks from Github Gist.

Thank you so much for your help.

Best Regards
Quanwen Zhao

Quanwen Zhao <quanwenzhao_at_gmail.com> 于2021年12月9日周四 21:52写道:

> Thanks Dominic, you're very very right! I've heard of execute immediate
> with into clause (subsequently known using clause as well) and am extremely
> glad to learn some new knowledge of oracle pl/sql from you.
>
> Best Regards
> Quanwen Zhao
>
> 在 2021年12月9日星期四,Dominic Brooks <dombrooks_at_hotmail.com> 写道:
> > Remove into from the select count(*) sql.
> > Use execute immediate … into.
> > Cheers
> > Dominic
> >
> > Sent from my iPhone
> >
> > On 9 Dec 2021, at 08:32, Quanwen Zhao <quanwenzhao_at_gmail.com> wrote:
> >
> > 
> > Hello my friends 😊,
> > I've written two anonymous plsql blocks checking those tables (starting
> with "DBA_HIST_" in SYS schema of oracle database) returned line is 0, but
> it's always encountered an error.
> > Here's my PL/SQL code:
> >
> > https://gist.github.com/guestart/1e0f49089530564a9f7c01b015416ad7
> > https://gist.github.com/guestart/0ca72e5344aa3ecaf26b905337e1dcd8
> >
> > Could you help me troubleshooting it? Thanks beforehand 🙏.
> > Best Regards
> > Quanwen Zhao

--
http://www.freelists.org/webpage/oracle-l
Received on Fri Dec 10 2021 - 03:39:58 CET

Original text of this message