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!

SYSDATE --> WHERE CLAUSE

733880Dec 28 2010 — edited Dec 28 2010
Hello Experts,

Good Day to all...

I am using the Oracle Version 11g.

Structure of EMP table
--------------------------------
EMP_NAME VARCHAR2
EMPNO NUMBER
START_DATE DATE


I am having the block as below:-
DECLARE

CURSOR C_SEL IS
SELECT EMP_NAME, EMPNO
FROM EMP
WHERE <<START_DATE = CURRENT_DATE>>
BEGIN
  	  OPEN C_SEL;
	  LOOP
	  FETCH C_SEL INTO L_EMP_NAME,L_EMPNO;
		....
		....

END;
Doubt
--------
I need to fetch the data for the current_date

For eg; if i'm running block on today; then it should get the details of the current_date from the CURSOR C_SEL.

How can i achieve it?

Thanks for your comments....
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 25 2011
Added on Dec 28 2010
4 comments
3,740 views