Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Select into variable in pl/sql from dynamic table_name - possible?

user5716448Dec 10 2014 — edited Dec 10 2014

Hi,

Using 11.2.0.3

select count(*)

into v_cnt

from products

example but when we don't know name of table until runtimeĀ  e.g in pl/sql package table is products_<sysdate>

Is it possible to use dyanamic sql for this below not work

select count(*)

into v_cnt

from <dyanmic_table_name>

If so how?

Thanks

This post has been answered by KayK on Dec 10 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 7 2015
Added on Dec 10 2014
12 comments
3,199 views