June 2010
You are currently browsing the articles from Techno Oracle written in the month of June 2010.
Exp Function returns the exponent value of the given input or EXP Returns e raised to the nth Power,where e=2.71828183. Syntax ——— EXP(input) NOTE: Input must be a numeric value. Example SELECT EXP(4) “exp” FROM DUAL; Output>> exp —————— 54.59815
Written by admin on June 30th, 2010 with no comments.
Read more articles on Built-In Functions.
Numeric functions accept numeric input and return numeric values. Most of these functions return values that are accurate to 38 decimal digits. The transcendental functions COS, COSH, EXP, LN, LOG, SIN, SINH, SQRT, TAN, and TANH are accurate to 36 decimal digits. The transcendental functions ACOS, ASIN, ATAN, and ATAN2 are accurate to 30 decimal [...]
Written by admin on June 30th, 2010 with no comments.
Read more articles on Built-In Functions.
ABS Function Returns the absolute value of input.The input provided must be a number Syntax ABS(number) Example SQL>SELECT ABS(-200) “Absolute” FROM DUAL; Output>> Absolute ————- 200
Written by admin on June 30th, 2010 with no comments.
Read more articles on Built-In Functions.
A PL/SQL function is a schema object that logically groups a set of SQL and other PL/SQL programming language statements together to perform a specific task. or pl/sql functions are a pl/sql block which is named and stored in oracle database.the main difference between a stored procedure and stored function is that a stored function [...]
Written by admin on June 29th, 2010 with no comments.
Read more articles on Oracle PL/SQL and PL/SQL Functions.
Use your normal text editor to write the procedure. At the beginning of the procedure, place the command CREATE PROCEDURE procedure_name AS … For example, to use the example , you can create a text (source) file called get_emp.sql containing the following code: CREATE PROCEDURE procedure_name AS … For example, to use the example , [...]
Written by admin on June 28th, 2010 with no comments.
Read more articles on Procedures in PL/SQL.
Stored procedures and functions can take parameters. The following example shows a stored procedure that is similar to the anonymous block : PROCEDURE get_emp_names (dept_num IN NUMBER) IS emp_name VARCHAR2(10); CURSOR c1 (depno NUMBER) IS SELECT ename FROM emp WHERE deptno = depno; BEGIN OPEN c1(dept_num); LOOP FETCH c1 INTO emp_name; EXIT WHEN c1%NOTFOUND; DBMS_OUTPUT.PUT_LINE(emp_name); [...]
Written by admin on June 27th, 2010 with no comments.
Read more articles on Procedures in PL/SQL.
A procedure is a subprogram that performs a specific action . A stored procedure is a PL/SQL block that is stored in the database with a name. It is invoked using the name. Each procedure is meant for a specific purpose. A stored procedure is stored in the database as an object. It is also [...]
Written by admin on June 27th, 2010 with no comments.
Read more articles on Procedures in PL/SQL.
Commercial applications require that the query, which, defines the cursor, be generic and the data that is retrieved from the table be allowed to change according to need. Oracle recognizes this and permits the creation of a parameterized cursor prior opening. Parameters allow values to be passed to a cursor when it is opened, and [...]
Written by admin on June 26th, 2010 with 2 comments.
Read more articles on Cursor in PL/SQL.
The Cursor FOR Loop implicitly declares its loop index as a record of type %ROWTYPE, opens a cursor, repeatedly fetches rows of the values from the active set into fields in the record, then closes the cursor when all rows have been processed or when the EXIT command is encountered. The syntax for the FOR [...]
Written by admin on June 26th, 2010 with no comments.
Read more articles on Cursor in PL/SQL.
We will move to some examples showing how to Use Cursor in Oracle PL/SQL Example 1:Consider a PL/SQL code to display the employee number, employee name, job of employees of Department ‘Database Security’ DECLARE CURSOR C1 IS SELECT EMP_NO, EMP_NAME, EMP_JOB FROM EMP WHERE EMP_DEPT=’DataBase Security’; /*EMP_REC is a row type variable for cursor c1 [...]
Written by admin on June 25th, 2010 with no comments.
Read more articles on Cursor in PL/SQL.
« Older articles
No newer articles