DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   Oracle (http://www.daniweb.com/forums/forum129.html)
-   -   Cursor%FOUND problem (http://www.daniweb.com/forums/thread122446.html)

veledrom May 4th, 2008 9:49 pm
Cursor%FOUND problem
 
Hi,
I can't find the missing thing in this code. "05-MAY-08" is in the table but, ( CURSOR_TARIH%FOUND ) never returns TRUE. When i do manuel query it is ok.
Thanks

create or replace
PROCEDURE A_SIPARIS_EKLE_SP
IS

CURSOR CURSOR_TARIH IS
SELECT TARIH FROM A_ACCOUNT WHERE TARIH = to_date('05-MAY-08', 'DD-MM-YY');

BEGIN

OPEN CURSOR_TARIH;

INSERT INTO A_SIPARIS (MID,STATUS) VALUES (1, 'NO');

IF ( CURSOR_TARIH%FOUND ) THEN
  UPDATE A_ACCOUNT SET PRICE = '10' WHERE TARIH = to_date('05-MAY-08', 'DD-MM-YY'); 
ELSE
  INSERT INTO A_ACCOUNT( TARIH, PRICE) values ( SYSDATE,  '1' );
END IF;

COMMIT;

CLOSE CURSOR_TARIH;

END;

peter_budo May 9th, 2008 6:53 am
Re: Cursor%FOUND problem
 
Can you please share your solution?

veledrom May 9th, 2008 9:15 am
Re: Cursor%FOUND problem
 
I don't insert date with SYSDATE anymore. I use VARCHAR for it and get date manual.


All times are GMT -4. The time now is 3:15 am.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC