Skip to Main Content

SQL Developer

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!

How to get current date/sysdate in procedure

3769660Nov 13 2019 — edited Nov 18 2019

Dear All,

How do i get current date or sysdate in procedure? My procedure is like below.

create or replace procedure  procedure_name

as

cursor c is select * from <table.name> where effdt = <current date / sysdate > for update;

begin

for r in c loop

-- insert statement here

r.field1,

r.field2);

commit;

end loop;

end procedure_name;

When i tried change current date / sysdate to a string, my procedure works well. So from there i know procedure wont accept any parameter/function here. the reason why is because i only want row with current date / sysdate to be inserted as this procedure being scheduled as a daily basis.

If you guys got better approach please..please..Please enlighten me T T.

Comments
Post Details
Added on Nov 13 2019
11 comments
4,950 views