Home » SQL & PL/SQL » SQL & PL/SQL » "continue" in pl/sql (oracle 10 g)
"continue" in pl/sql [message #361254] Tue, 25 November 2008 09:42 Go to next message
kanis
Messages: 61
Registered: November 2006
Member
when trying to execute the below subprogram in oracle 10g
DECLARE
x NUMBER := 0;
BEGIN
LOOP -- After CONTINUE statement, control resumes here
DBMS_OUTPUT.PUT_LINE ('Inside loop: x = ' || TO_CHAR(x));
x := x + 1;

IF x < 3 THEN
CONTINUE;
END IF;

DBMS_OUTPUT.PUT_LINE
('Inside loop, after CONTINUE: x = ' || TO_CHAR(x));

EXIT WHEN x = 5;
END LOOP;

DBMS_OUTPUT.PUT_LINE (' After loop: x = ' || TO_CHAR(x));
END;

It is giving an error
ORA-06550: line 9, column 11:
PLS-00201: identifier 'CONTINUE' must be declared
ORA-06550: line 9, column 11:
PL/SQL: Statement ignored

Is pl/sql in oracle 10g does not support continue? what to be done to resolve the error.?

Re: "continue" in pl/sql [message #361257 is a reply to message #361254] Tue, 25 November 2008 09:53 Go to previous messageGo to next message
joicejohn
Messages: 327
Registered: March 2008
Location: India
Senior Member
Kanis,

I am not sure about this. But I think the CONTINUE Statement was introduced in Oracle 11g

Oracle Documentation

Many programming languages allow transfer of control either out of the loop entirely or within a loop back to a new iteration. In previous releases, PL/SQL only allowed transfer of control out of the loop using the EXIT statement. In Oracle Database 11g Release 1 (11.1), the new CONTINUE statement implements the ability to transfer control within a loop back to a new iteration.



Confirmed: Oracle Documentation

Regards,
Jo

[Updated on: Tue, 25 November 2008 09:57]

Report message to a moderator

Re: "continue" in pl/sql [message #361261 is a reply to message #361254] Tue, 25 November 2008 10:18 Go to previous messageGo to next message
rajavu1
Messages: 1574
Registered: May 2005
Location: Bangalore , India
Senior Member

No.. its not supported in 10g . you can use GO TO instead.

GO TO instead of CONTINUE

or you can use Exception to do the same

EXCEPTION instead of CONTINUE

Smile
Rajuvan.

[Updated on: Tue, 25 November 2008 10:27]

Report message to a moderator

Re: "continue" in pl/sql [message #361267 is a reply to message #361254] Tue, 25 November 2008 10:30 Go to previous message
Michel Cadot
Messages: 64151
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
From your previous post:
Michel Cadot wrote on Sat, 18 October 2008 07:50
...
Before, please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format and indent the code.
Use the "Preview Message" button to verify.

Regards
Michel


Previous Topic: how see the real value from PLSQL
Next Topic: cannot perform a DML operation inside a query
Goto Forum:
  


Current Time: Fri Dec 09 22:56:58 CST 2016

Total time taken to generate the page: 0.05835 seconds