Home » Developer & Programmer » Forms » Cursor (Oracle Forms 6i Ver 6.0.8.8.0)
Cursor [message #332609] Wed, 09 July 2008 03:02 Go to next message
mudabbir
Messages: 235
Registered: April 2006
Location: Kuwait
Senior Member

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 149 times)
Re: Cursor [message #332612 is a reply to message #332609] Wed, 09 July 2008 03:15 Go to previous messageGo to next message
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 Go to previous messageGo to next message
mudabbir
Messages: 235
Registered: April 2006
Location: Kuwait
Senior Member

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 Go to previous messageGo to next message
Frank
Messages: 7880
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 Go to previous message
mudabbir
Messages: 235
Registered: April 2006
Location: Kuwait
Senior Member

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
Previous Topic: cudnt able to insert data from text box in forms
Next Topic: backup from oracle form
Goto Forum:
  


Current Time: Mon Dec 05 08:37:35 CST 2016

Total time taken to generate the page: 0.08151 seconds