<< < 1 2 3 4 5 > >>   Sort: Date

What Are the Execution Control Statements
What Are the Execution Control Statements? - Oracle DBA FAQ - Understanding PL/SQL Language Basics PL/SQL supports three groups of execution control statements: IF Statements - Conditionally executes a block of statements. CASE Statements - Selectively executes a block of statements. LOOP Statements...
2007-04-30, 5131👍, 0💬

How To Use "WHILE" Statements
How To Use "WHILE" Statements? - Oracle DBA FAQ - Understanding PL/SQL Language Basics If you have a block of codes to be executed repeatedly based a condition, you can use the "WHILE ... LOOP" statement. Here is a sample script on WHILE statements: DECLARE total NUMBER; BEGIN total := 0; WHILE tota...
2007-04-29, 5118👍, 0💬

How To Run the Anonymous Block Again
How To Run the Anonymous Block Again? - Oracle DBA FAQ - Introduction to PL/SQL If you have an anonymous block defined in your session, you can run it any time by using the "/" command as shown in the following script: SQL> set serveroutput on; SQL> begin 2 dbms_output.put_line('This is a PL/SQL FAQ...
2007-04-25, 5110👍, 0💬

How To Update a Table Row with a Record
How To Update a Table Row with a Record? - Oracle DBA FAQ - Working with Database Objects in PL/SQL If you have a RECORD variable with data fields matching a table structure, you can update a row in this table with this RECORD variable using the UPDATE ... SET ROW statement as shown in the sample sc...
2007-04-26, 5099👍, 0💬

What Is a Function
What Is a Function? - Oracle DBA FAQ - Understanding PL/SQL Language Basics A function is a named program unit. It consists of three parts: Declaration Part - Defining the function name, calling parameters, return value type, local variables and local procedures. Declaration part is required. Execut...
2007-04-30, 5055👍, 0💬

How To Assign Values to Data Fields in RECORD Variables
How To Assign Values to Data Fields in RECORD Variables? - Oracle DBA FAQ - Working with Database Objects in PL/SQL If a variable is a RECORD variable, you can assign values to its data fields by using fields names prefixed with variable name as "variable.field_name". Here is a sample script assigni...
2007-04-27, 5054👍, 0💬

How Many Scalar Data Types Are Supported in PL/SQL
How Many Scalar Data Types Are Supported in PL/SQL? - Oracle DBA FAQ - Understanding PL/SQL Language Basics PL/SQL supports many scalar data types divided into 4 groups: Numeric Types: BINARY_DOUBLE, BINARY_FLOAT, BINARY_INTEGER, DEC, DECIMAL, DOUBLE PRECISION, FLOAT, INT, INTEGER, NATURAL, NATURALN...
2007-04-30, 5053👍, 0💬

How To Execute a Stored Procedure
How To Execute a Stored Procedure? - Oracle DBA FAQ - Creating Your Own PL/SQL Procedures and Functions If you want to execute a stored procedure, you can use the EXECUTE statement. The example script below shows how to executes a stored procedure: SQL> set serveroutput on; SQL> CREATE PROCEDURE Gre...
2007-04-26, 5051👍, 0💬

How To Use "OUT" Parameter Properly
How To Use "OUT" Parameter Properly? - Oracle DBA FAQ - Creating Your Own PL/SQL Procedures and Functions Here are the rules about OUT parameters: A formal OUT parameter acts like an un-initialized variable. It must be assigned with new values before the end of the procedure or function. An actual O...
2007-04-21, 5050👍, 0💬

How To Create a Stored Procedure
How To Create a Stored Procedure? - Oracle DBA FAQ - Creating Your Own PL/SQL Procedures and Functions A stored procedure is a procedure with a specified name and stored into the current database. If you want to create a stored procedure, you can use the CREATE PROCEDURE statement. The example scrip...
2007-04-26, 5017👍, 0💬

What Happens If Variable Names Collide with Table/Column Names
What Happens If Variable Names Collide with Table/Column Names? - Oracle DBA FAQ - Working with Database Objects in PL/SQL When a variable name collides with a column name, PL/SQL will use it as the variable if it is used where variable is allowed; It will be used as the column, if it is used where ...
2007-04-28, 5000👍, 0💬

How To Loop through a Cursor Variable
How To Loop through a Cursor Variable? - Oracle DBA FAQ - Working with Cursors in PL/SQL Once a cursor variable is opened with a query statement, it will have the same attributes as a normal cursor and it can be used in the same way a normal cursor too. The following sample script shows you how to l...
2007-04-28, 4997👍, 0💬

How To Create a Stored Function
How To Create a Stored Function? - Oracle DBA FAQ - Creating Your Own PL/SQL Procedures and Functions A stored function is a function with a specified name and stored into the current database. If you want to create a stored function, you can use the CREATE FUNCTION statement. The example script bel...
2007-04-26, 4992👍, 0💬

How To Pass Parameters to Procedures
How To Pass Parameters to Procedures? - Oracle DBA FAQ - Introduction to PL/SQL Store procedures or functions can take parameters. You need to define parameters while defining the procedure, and providing values to parameters while calling the procedure. The script below shows you how to do this: SQ...
2007-04-26, 4983👍, 0💬

How To Pass Parameters to Procedures
How To Pass Parameters to Procedures? - Oracle DBA FAQ - Creating Your Own PL/SQL Procedures and Functions Store procedures or functions can take parameters. You need to define parameters while defining the procedure, and providing values to parameters while calling the procedure. The script below s...
2007-04-26, 4967👍, 0💬

How To Retrieve Values from Data Fields in RECORD Variables
How To Retrieve Values from Data Fields in RECORD Variables? - Oracle DBA FAQ - Working with Database Objects in PL/SQL If a variable is a RECORD variable with data fields assigned values, you can retrieve those values out of its data fields by using fields names prefixed with variable name as "vari...
2007-04-27, 4949👍, 0💬

How To Drop a Stored Function
How To Drop a Stored Function? - Oracle DBA FAQ - Creating Your Own PL/SQL Procedures and Functions If there is an existing stored function and you don't want it any more, you can remove it from the database by using the DROP FUNCTION statement as shown in the following script example: SQL> CREATE O...
2007-04-25, 4944👍, 0💬

How To Open a Cursor Variable
How To Open a Cursor Variable? - Oracle DBA FAQ - Working with Cursors in PL/SQL A cursor variable must be opened with a specific query statement before you can fetch data fields from its data rows. To open a cursor variable, you can use the OPEN ... FOR statement as shown in the following tutorial ...
2007-04-28, 4933👍, 0💬

How To Loop through Data Rows in the Implicit Curosr
How To Loop through Data Rows in the Implicit Curosr? - Oracle DBA FAQ - Working with Cursors in PL/SQL You use the FOR ... IN ... LOOP statement to loop through data rows in the implicit cursor as the following syntax: FOR row IN dml_statement LOOP (statement block with row.field) END LOOP; Here "r...
2007-04-29, 4929👍, 0💬

How To Call a Stored Function with Parameters
How To Call a Stored Function with Parameters? - Oracle DBA FAQ - Creating Your Own PL/SQL Procedures and Functions You can define a function that takes parameters, provide values to those parameters when calling the function. Here is a good example of a function with a parameter: SQL> CREATE OR REP...
2007-04-25, 4928👍, 0💬

What Is a Cursor
What Is a Cursor? - Oracle DBA FAQ - Working with Cursors in PL/SQL A cursor looks like a variable, but it is not a variable. A cursor looks like a procedure, but it is not a procedure. A cursor is a cursor. It is a logical representation of a resource connects to a set of data rows related to a DML...
2007-04-29, 4924👍, 0💬

How To Use an Explicit Cursor without OPEN Statements
How To Use an Explicit Cursor without OPEN Statements? - Oracle DBA FAQ - Working with Cursors in PL/SQL If you want to open a cursor and loop through its data rows in quick way, you can use the FOR ... IN ... LOOP statement in the same way as the implicit cursor. The following tutorial exercise giv...
2007-04-29, 4920👍, 0💬

Can DDL Statements Be Used in PL/SQL
Can DDL Statements Be Used in PL/SQL? - Oracle DBA FAQ - Working with Database Objects in PL/SQL No, you can not run any DDL statements is PL/SQL directly. If you try to use the DROP TABLE statement inside PL/SQL, you will get a compilation error as shown below: (Connect to XE with SQL*Plus) BEGIN D...
2007-04-28, 4918👍, 0💬

How To Execute a Stored Program Unit
How To Execute a Stored Program Unit? - Oracle DBA FAQ - Introduction to PL/SQL If you want to execute a stored program unit, you can use the EXECUTE statement. The example script below shows how to executes a stored program unit: SQL> set serveroutput on; SQL> CREATE PROCEDURE Hello AS 2 BEGIN 3 DB...
2007-04-25, 4915👍, 0💬

<< < 1 2 3 4 5 > >>   Sort: Date