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: Thu, 9 Dec 2021 21:52:04 +0800
Message-ID: <CABpiuuTyozi1vQOc_o7D47RoZ4+_Vn49B=1DC1=o1CnRGGYJ9A_at_mail.gmail.com>



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 Thu Dec 09 2021 - 14:52:04 CET

Original text of this message