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!

passing date variable into a string

913578Mar 21 2018 — edited Apr 1 2018

HI,

I want to pass the date 201802 as a variable in the below query. Here the date is attached with a string.

declare

v_date date;

v_count number;

begin

SELECT TO_CHAR(SYSDATE,'YYYYMM')-1 into v_date FROM DUAL;

select count(*) into v_count from orders partition (status_wi_dat_201802);  ------Here i want to pass the variable v_date

dbms_output.put_line('Record count:'|| v_count);

end;

Can you please suggest.

Thanks.

This post has been answered by Paulzip on Mar 21 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 18 2018
Added on Mar 21 2018
6 comments
954 views