goto plsql

Pl sql goto statement: The pl sql goto statement provides an unconditional jump from the GOTO to a labeled statement in the same subprogram. A label can be declare with the > syntax. pl sql goto statement syntax: GOTO label_name; //Other statements <<label_name>> Statement;GOTO label_name; //Other statements <<label_name>> Statement; Pl sql goto statement example: DECLARE … Read more

loop label plsql

Pl sql loop label: The pl sql loop can be labeled by loop labels. Pl sql loop label syntax: << label >><< label >> Pl sql loop label example: DECLARE i number(1); j number(1); BEGIN << outer_loop >> FOR i IN 1..5 LOOP << inner_loop >> FOR j IN 1..5 LOOP dbms_output.put_line(’i is: ‘|| i … Read more

continue plsql

Pl sql continue statement: The pl sql continue statement is a control statement which is used to skip the following statement in the body of the loop and continue with the next iteration of the loop. Pl sql continue syntax: continue;continue; Pl sql continue statement example: DECLARE num NUMBER := 0; BEGIN WHILE num < … Read more

for in loop plsql

Pl sql for in loop: The pl sql for in loop repeatedly executes a block of statements for a fixed number of times. The loop iteration occurs between the start and end integer values. The counter is always incremented by 1 and loop terminates when the counter reaches the value of the end integer. Pl … Read more

while loop plsql

PL SQL WHILE LOOP: The pl sql while loop repeatedly executes a block of statements until a particular condition is true. It first check the condition and executes a block of statements if condition is true. PL SQL WHILE LOOP syntax: WHILE condition LOOP //block of statements; END LOOP;WHILE condition LOOP //block of statements; END … Read more

exit loop plsql

Pl sql exit loop: The pl sql loop repeatedly executes a block of statements until it reaches a loop exit. The EXIT and EXIT WHEN statements are used to terminate a loop. Where: EXIT: The EXIT statement is used to terminate the loop unconditionally and normally used with IF statement. EXIT WHEN: The EXIT WHEN … Read more

switch plsql

PL/SQL Case Statement: Switch statement is used to execute a block of statement based on the switch expression value. An expression must be of type int, short, byte or char. A case value should be a constant literal value and cannot be duplicated. Expression value is compared with each case value. If a match found … Read more

if else plsql

PL/SQL If statement: If statement is used to execute a block of statements if specified condition is true. Commonly used PL/SQL If statement: IF-THEN statement: Syntax: IF condition THEN //Block of statements1 END IF;IF condition THEN //Block of statements1 END IF; Block of statements1 executes when the specified condition is true. IF-THEN-ELSE statement: Syntax: IF … Read more

Hello world plsql

pl sql hello world program: DECLARE — variable declaration message varchar2(20):= ‘Hello World!’; BEGIN –output dbms_output.put_line(message); END; /DECLARE — variable declaration message varchar2(20):= ‘Hello World!’; BEGIN –output dbms_output.put_line(message); END; / Output: Hello World!Hello World!  

Constants and literals in plsq

PL/SQL Constants: A constant holds a value used in a PL/SQL block that does not change throughout the program. It is a user-defined literal value. Syntax to declare a constant: constant_name CONSTANT datatype := VALUE;constant_name CONSTANT datatype := VALUE; Where: constant_name – is a valid identifier name. CONSTANT – is a keyword. VALUE – is … Read more