Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Oracle Procedure just hangs

Status
Not open for further replies.

wdm

IS-IT--Management
Jun 5, 2003
1
US
I am trying to get a procedure to work when executed from a form. When I execute it, it just hangs there. I would greatly appreciate it if someone would look at this code and figure out why it does not want to run. The syntax compiles with no errors and is as follows:


(
drgval IN VARCHAR2)
as
BEGIN
DECLARE
DRGTemp charity.drg%type;
FyearTemp charity.fyear%type;
CURSOR drglookup IS SELECT * FROM mattw.charity where drg = drgval;
BEGIN
htp.print('<HTML>');
htp.print('<HEAD>');
htp.print('<TITLE> DRG Lookup</TITLE>');
OPEN drglookup;
Loop
htp.print(drgtemp);
htp.print(fyeartemp);
END LOOP;
htp.print('</BODY>');
htp.print('</HTML>');
END;
END
 
Hi wdm

Your LOOP block is the problem. Since you are not FETCHing from the CURSOR your code will never get a 'read past end' exception - so it keeps looping.

Inside your LOOP I suggest you

FETCH <cursor> INTO <record>;
EXIT WHEN <cursor>%NOTFOUND;

and outside the loop remember to

CLOSE <cursor>;

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top