Browsing articles tagged with " oracle 9i"
Dec
13

Packages in PL/SQL

By admin  //  Oracle  //  View Comments

CREATE OR REPLACE PACKAGE BODY emp_actions AS — body
PROCEDURE hire_employee ( ename VARCHAR2, job VARCHAR2, mgr NUMBER, sal NUMBER, comm NUMBER, deptno NUMBER) IS
BEGIN
INSERT INTO emp VALUES (emp_sec.NEXTVAL, ename, job, mgr, SYSDATE, sal, comm, deptno);
COMMIT;
END hire_employee;

PROCEDURE fire_employee (emp_id NUMBER) IS
BEGIN
DELETE FROM emp WHERE empno = emp_id;
COMMIT;
END fire_employee;

END emp_actions;

Dec
13

Structure of PL/SQL Block

By admin  //  Oracle  //  View Comments

[<Block Header>]

[DECLARE

<constants>

<variables>

<Cursors>

<user defined exceptions>

]

BEGIN

<PL/SQL Statements>

[Exceptions <exception handlings>]

END;

BLOCK HEADER specifies whether the PL/SQL block is procedure, a function or a package. If no header is specified, the block is said to be an anonymous PL/SQL block.

Namaste!

Hello! This is Nirmal Gyanwali, a freelance web developer from Kathmandu, Nepal. I am well versed with Open source CMS and portal frameworks like Joomla!, Wordpress, Drupal. If you're interested, you can contact me at info@nirmal.com.np.
Thanks!

Latest Tweets