Cursor [message #332609] |
Wed, 09 July 2008 03:02 |
|
I am writing a procedure on the Database and gives no problem while saving. but when i am writing the procedure in a form, while i compile it shows error on this cursor.
cursor vc_leave is
select emp_no from hr_db.hr_emp_m
where emp_sts = 2 and to_date(nvl((select max(end_date) from hr_db.hr_leaves where empno = emp_no),(select max(end_date) from hr_db.hr_leaves_h where empno = emp_no))) < to_date(sysdate);
The error is attached.
-
Attachment: 1.jpg
(Size: 58.75KB, Downloaded 584 times)
|
|
|
Re: Cursor [message #332612 is a reply to message #332609] |
Wed, 09 July 2008 03:15 |
JRowbottom
Messages: 5933 Registered: June 2006 Location: Sunny North Yorkshire, ho...
|
Senior Member |
|
|
1) Don't use TO_DATE on date columns, or on sysdate.
2) Anytime you use TO_DATE, you should use a format mask
3) I suspect that the Forms Pl/Sql engine doesn't support this feature.
|
|
|
Re: Cursor [message #332616 is a reply to message #332612] |
Wed, 09 July 2008 03:24 |
|
Quote: | 1) Don't use TO_DATE on date columns, or on sysdate.
|
I tried doing that also... but still the same result.
Quote: | 3) I suspect that the Forms Pl/Sql engine doesn't support this feature.
|
What i did was created a form with a button on it. and called
the procedure from the database. but it gave me error ORA -01001
|
|
|
Re: Cursor [message #332622 is a reply to message #332616] |
Wed, 09 July 2008 03:52 |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
ORA-01001 Invalid cursor
It does not mean that you have an error in your cursor-definition, but that you refer to a cursor in an invalid way. eg fetch from a cursor that is not open
|
|
|
Re: Cursor [message #332675 is a reply to message #332622] |
Wed, 09 July 2008 06:23 |
|
Thanks Frank for pointing that out to me.
I found the error. Like you said it was pointing to another cursor already closed.
Thanks all for you prompt replies.
Cheers.....
Mudabbir
|
|
|