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;...
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;...
Oracle PL/SQL Set Transaction Example COMMIT; SET TRANSACTION READ ONLY NAME 'London'; SELECT customer_id, city FROM customers WHERE customer_id = 1; COMMIT;...
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...