Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
GOTO StatementThe GOTO statement branches to a label unconditionally. The label must be exclusive within its scope and should precede an executable statement or a PL/SQL block. If executed, the GOTO statement transfers control to the labeled statement or block. In the following illustration, you go to an executable statement farther down in a series of statements:BEGIN...GOTO insert_row;...<>INSERT INTO emp VALUES...END;In the next illustration, you go to a PL/SQL block farther up in a series of statements:BEGIN...<>BEGINUPDATE emp SET ......END;...GOTO update_row;...END;The label end_loop in the example below is illegal as it does not precede an executable statement:DECLAREdone BOOLEAN;BEGIN...FOR i IN 1..50 LOOPIF done THENGOTO end_loop;END IF;...<> -- illegalEND LOOP; -- not an executable statementEND;To debug the last illustration, now add the NULL statement, as shown:FOR i IN 1..50 LOOPIF done THENGOTO end_loop;END IF;...<>NULL; -- an executable statementEND LOOP;As the following illustration shows, a GOTO statement can branch to an enclosing block from the present block:DECLAREmy_ename CHAR(10);BEGIN<>SELECT ename INTO my_ename FROM emp WHERE...BEGIN...GOTO get_name; -- branch to enclosing blockEND;END;RestrictionsSome likely destinations of a GOTO statement are illegal. Particularly, a GOTO statement cannot branch into an IF statement, LOOP statement, or sub-block. For illustration, the following GOTO statement is illegal:BEGIN...GOTO update_row; -- illegal branch into IF statement...IF valid THEN...<>UPDATE emp SET...END IF;END;A GOTO statement also cannot branch from one IF statement clause to another, as the following illustration shows:BEGIN...IF valid THEN...GOTO update_row; -- illegal branch into ELSE clauseELSE...<>UPDATE emp SET...END IF;END;The next illustration shows that a GOTO statement cannot branch from an enclose block into a sub-block:BEGIN...IF status = ’OBSOLETE’ THENGOTO delete_part; -- illegal branch into sub-blockEND IF;...BEGIN...<>DELETE FROM parts WHERE...END;END;A GOTO statement also cannot branch out of a subprogram, as the following illustration shows:DECLARE...PROCEDURE compute_bonus (emp_id NUMBER) ISBEGIN...GOTO update_row; -- illegal branch out of subprogramEND;BEGIN...<>UPDATE emp SET...END;Finally, the GOTO statement cannot branch from an exception handler into the present block. For illustration, the following GOTO statement is illegal:DECLARE...pe_ratio REAL;BEGIN...SELECT price / NVL(earnings, 0) INTO pe_ratio FROM ...<>INSERT INTO stats VALUES (pe_ratio, ...);EXCEPTIONWHEN ZERO_DIVIDE THENpe_ratio := 0;GOTO insert_row; -- illegal branch into current blockEND;Though, a GOTO statement can branch from an exception handler into the enclosing block.
Delimiters A delimiter is a simple or compound symbol which has a special meaning to PL/SQL. For example, you use delimiters to symbolize an arithmetic operation like additio
Accessing Attributes: You can refer to an attribute only by its name not by its position in the object type. To access or modify the value of an attribute, you can use the dot
An analyst in the quality assurance office reviews the time lapse between receiving an order and shipping an order. Any orders that have not been shipped within a day of the order
Semidifference via NOT IN and a subquery SELECT StudentId FROM IS_CALLED WHERE Name = 'Devinder' AND StudentId NOT IN (SELECT StudentId FROM IS_ENROLLED_ON WHER
Table Represents an Extension - SQL It describes how each tuple in a relation represents a true instantiation of some predicate and each true instantiation is represented by s
what is the use of declare keyword
At times, customers make mistakes in submitting their orders and call to cancel the order. Brewbean’s wants to create a trigger that automatically updates the stock level of all pr
Functions The function is a subprogram which can take parameters and be invoked. Normally, you can use a function to calculate a value. The function has 2 sections: the specifi
which operation is used if we are interested in only certain columns of a table?
Example of Foreign Key Constraint Example: Alternative formulation for 6.3 as a foreign key constraint ALTER TABLE EXAM_MARK ADD CONSTRAINT Must_be_enrolled_to_take_exam
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +1-415-670-9521
Phone: +1-415-670-9521
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd