Category: PL/SQL

PL/SQL Substr

Oracle PL/SQL Substr Example Select SUBSTR('HELLO JAVA',2,4) From dual; SELECT u.name, SUBSTR(u.name, 1, 2) substr_1, SUBSTR(u.name, 4, 3) substr_2 FROM users u;...

PL/SQL Sqlerrm

Oracle PL/SQL Sqlerrm Example DECLARE var customers%rowtype; BEGIN Select * Into var From customers c Where c.customer_type='CC'; dbms_output.put_line('NAME: '||var.customer_type); EXCEPTION WHEN Others THEN dbms_output.put_line('Sqlerrm message is:'||SQLERRM); Raise; END;...

PL/SQL SqlCode

Oracle PL/SQL SqlCode Example DECLARE var customers%rowtype; BEGIN Select * Into var From customers c Where c.customer_type='I'; dbms_output.put_line('ID: ' || var.customer_id); dbms_output.put_line('NAME: ' || var.customer_name); EXCEPTION WHEN Others THEN dbms_output.put_line('Sqlcode exception is:'||sqlcode); Raise; END;...

PL/SQL Self-Join

Oracle PL/SQL Self-Join Self-Join is a select query of a table by herself after a given condition. Self-Join Example 1: Select * From customers cust, customers buyer Where cust.customer_id = buyer.buyer_id; Self-Join Example 2: Select * From customers cust, customers supplier...