Y
Size: a a a
Y
IZ
Y
IZ
Y
Y
Y
Y
Y
SET SERVEROUTPUT ON
ACCEPT year_salary PROMPT 'Give yearly salary: '
DECLARE
month NUMBER(9,2) := &year_salary;
BEGIN
month := month/12;
DBMS_OUTPUT.PUT_LINE ('Monthly salary = ' ||month);
END;
IZ
SET SERVEROUTPUT ON
ACCEPT empno PROMPT 'Enter empno: '
ACCEPT ename PROMPT 'Enter ename: '
ACCEPT job PROMPT 'Enter job: '
ACCEPT mgr PROMPT 'Enter mgr: '
ACCEPT sal PROMPT 'Enter sal: '
ACCEPT deptno PROMPT 'Enter deptno: '
DECLARE
empn NUMBER := &empno;
ena VARCHAR(255) := &ename;
ejob VARCHAR(255) := &job;
emgr NUMBER := &mgr;
ehire DATE := Sysdate;
esal NUMBER := &sal;
ecomm NUMBER := null;
edeptno NUMBER := &deptno;
BEGIN
INSERT INTO EMP VALUES(empn, ena, ejob, emgr, ehire, esal, ecomm, edeptno);
END;
Y
IZ
Y
Y
IZ
Besides variables declared in PL/SQL block there may also be variables from the application using the PL/SQL block - they are preceded by a colon (:variable) and are called bind variables. There may also beSQL*Plus substitution variables
(&variable) - but only in expressions and never on the left hand side of the assignment statement.
SC
IZ
IZ
SC
IZ