Start Discovering Solved Questions and Your Course Assignments
TextBooks Included
Active Tutors
Asked Questions
Answered Questions
dynamic rangesthe plsql lets you determine the loop range dynamically at run time as the example below showsselect countempno into empcount from
iteration schemesthe bounds of a loop range can be variables literals variables or expressions but must compute to integers below are some of the
for-loopwhile the number of iterations through a while loop is unknown till the loop completes then the number of iterations through a for loop is
while-loopthe while-loop statement relates a condition with the series of statements enclosed by the keywords loop and end loop as shownwhile
loop labelslike the plsql blocks loops can also be labeled the label an undeclared identifier enclosed by double angle brackets should appear at the
exit-whenthe exit-when statement permits a loop to complete conditionally whenever the exit statement is encountered the condition in the when clause
exitthe exit statement forces a loop to done unconditionally whenever an exit statement is encountered the loop is done immediately and controls the
iterative control loop statementsthe loop statement executes a series of statements multiple times there are 3 forms of loop statements loop
plsql conditional control if statementsfrequently it is necessary to take the alternative actions depending on the circumstances the if statement
in operatorthe operator in tests the set membership this means equal to any member of the set may have nulls but they are ignored for illustration
between operatorthe operator between tests whether the value lies in a specified series that means greater than or equivalent to low value and less
like operatoryou use the like operator to compare the character value to a pattern the case is significant like returns the boolean value true when
is null operatorthe is null operator returns the boolean value true whenever its operand is null or false if it is not null the comparisons including
comparison operatorsthe comparison operators can compare one expression to another the outcome is always true false or null usually you use a
short-circuit evaluation when computing a logical expression the plsql uses short-circuit evaluation that is the plsql stops computing the expression
order of evaluationwhen you do not use the parentheses to specify the order of evaluation the operator precedence determine the order now compare the
plsql expressions the expressions are constructed by using the operands and operators an operand is a constant literal variable or function call
database valuesyou can use the select statement to have the oracle assign values to a variable foreach and every item in the select list there must
boolean valuesonly the values true false amp null can be assigned to a boolean variable for illustration given the declarationdeclaredone booleanthe
assignments in plsqlthe variables and constants are initialized every time a block or subprogram is enteredby default the variables are initialized
name resolutionin potentially uncertain sql statements the names of the database columns take precedence over the names of the local variables and
case sensitivitysimilar to all the identifiers the variables the names of constants and parameters are not case sensitive for illustration plsql
scopingwithin the similar scope all the declared identifiers should be unique so even if their datatypes differ the variables and parameters cannot
synonymsyou can create the synonyms to provide location transparency for the remote schema objects like tables views sequences stand-alone
naming conventionsthe similar naming conventions apply to all plsql program items and units including the variables cursors constants cursor