Tags

links:
http://www.plsql-tutorial.com/

summary:
– similarity to pro C
– str concat using ||
– str delimit with ‘ single quote
– use — for comment
– / to execute code
– ; is needed for some command like END to indicate end of statement- – dbms_output.put_line(‘some thing’)
– parameters are default IN
– exception when ZERO_DIVIDE then … blah
– loop exit when … blah
cursor a temp space from select results
– implicit cursor if result a row
– need explicit cursor if more than 1 result row
– cursor eg. declare, open, fetch-into some variable, close
– type declaration example:
money number(4);
emp_name varchar2(10) NOT NULL := “john doe”;
– object method call using %, e.g. TABLE%ROWTYPE
– create or replace to define procedure or function
e.g.
CREATE OR REPLACE PROCEDURE emp_name (id IN NUMBER, emp_name OUT NUMBER)
IS
BEGIN
END;

CREATE OR REPLACE FUNCTION employer_details_func
RETURN VARCHAR(20);
IS
emp_name VARCHAR(20);
BEGIN
END;

Advertisements