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

How To Run SQL Functions in PL/SQL
How To Run SQL Functions in PL/SQL? - Oracle DBA FAQ - Working with Database Objects in PL/SQL Of course, you can run SQL functions in SQL statements. But many SQL functions can also be executed in regular PL/SQL statements, as shown in the following sample script: DECLARE now DATE; id NUMBER; str V...
2007-04-27, 5418👍, 0💬

What Are the Logical Operations
What Are the Logical Operations? - Oracle DBA FAQ - Understanding PL/SQL Language Basics PL/SQL supports 3 logical operations as shown in the following sample script: PROCEDURE proc_comparison AS x BOOLEAN := TRUE; y BOOLEAN := FALSE; res BOOLEAN; BEGIN res = x AND y; res = x OR y; res = NOT x; -- m...
2007-04-30, 5397👍, 0💬

What Is a Named Program Unit
What Is a Named Program Unit? - Oracle DBA FAQ - Understanding PL/SQL Language Basics A named program unit is a PL/SQL code block with an name. It consists of three parts: Declaration Part - Defining the program unit name, calling parameters, local variables and local procedures. Declaration part is...
2007-04-30, 5348👍, 0💬

How To Place Comments in PL/SQL
How To Place Comments in PL/SQL? - Oracle DBA FAQ - Understanding PL/SQL Language Basics There are two ways to place comments into PL/SQL codes: SQL Statement Style: Starts you comment any where in the line but prefixed with '--'. The comment ends at the end of the line. C Language Style: Starts you...
2007-05-01, 5305👍, 0💬

How To Define an Anonymous Block
How To Define an Anonymous Block? - Oracle DBA FAQ - Introduction to PL/SQL An anonymous block must have an execution part, which is a group of other PL/SQL statements enclosed in the BEGIN ... END statement. Here is a script on how to define a simple anonymous block with SQL*Plus: SQL> set serverou...
2007-04-25, 5281👍, 0💬

How To Assign Values to Variables
How To Assign Values to Variables? - Oracle DBA FAQ - Understanding PL/SQL Language Basics You can use assignment statements to assign values to variables. An assignment statement contains an assignment operator ":=", which takes the value specified on the right to the variable on left. The script b...
2007-04-30, 5268👍, 0💬

What Is Stored Program Unit
What Is Stored Program Unit? - Oracle DBA FAQ - Introduction to PL/SQL A stored program unit is a named block of codes which: Has a name. Can take parameters, and can return values. Is stored in the data dictionary. Can be called by many users.
2007-04-25, 5239👍, 0💬

What Are the Types PL/SQL Code Blocks
What Are the Types PL/SQL Code Blocks? - Oracle DBA FAQ - Understanding PL/SQL Language Basics There are 3 types of PL/SQL code blocks: Anonymous Block - A block of codes with no name. It may contain a declaration part, an execution part, and exception handlers. Stored Program Unit - A block of code...
2007-05-01, 5234👍, 0💬

What Is a Procedure
What Is a Procedure? - Oracle DBA FAQ - Understanding PL/SQL Language Basics A procedure is a named program unit. It consists of three parts: Declaration Part - Defining the procedure name, calling parameters, local variables and local procedures. Declaration part is required. Execution Part - Defin...
2007-04-30, 5231👍, 0💬

Can You Assign Multiple Query Result Rows To a Variable
Can You Assign Multiple Query Result Rows To a Variable? - Oracle DBA FAQ - Working with Database Objects in PL/SQL You can use "SELECT ... INTO variable" to assign query results to variables. But what happens if the SELECT statements return multiple rows? The answer is that you will get a run time ...
2007-04-27, 5227👍, 0💬

How To Define a Sub Procedure
How To Define a Sub Procedure? - Oracle DBA FAQ - Creating Your Own PL/SQL Procedures and Functions A sub procedure is a named procedure defined and used inside another procedure or function. You need to define a sub procedure in the declaration part of the enclosing procedure or function. Sub proce...
2007-04-25, 5202👍, 0💬

How To Use "IN" Parameter Properly
How To Use "IN" Parameter Properly? - Oracle DBA FAQ - Creating Your Own PL/SQL Procedures and Functions Here are the rules about IN parameters: A formal IN parameter acts like constant. It can not be assigned with new values. An actual IN parameter can take a value or a variable. An actual IN param...
2007-04-25, 5174👍, 0💬

What Is the Order of Defining Local Variables and Sub Procedures/Functions
What Is the Order of Defining Local Variables and Sub Procedures/Functions? - Oracle DBA FAQ - Creating Your Own PL/SQL Procedures and Functions In the declaration part, you must define all local variables before defining any sub procedures or sub functions. See the following sample script: SQL> CRE...
2007-04-25, 5170👍, 0💬

How To Resolve Name Conflicts between Variables and Columns
How To Resolve Name Conflicts between Variables and Columns? - Oracle DBA FAQ - Working with Database Objects in PL/SQL The best way to resolve name conflicts is to avoid using column names for variables.
2007-04-27, 5164👍, 0💬

How To Use "FOR" Statements
How To Use "FOR" Statements? - Oracle DBA FAQ - Understanding PL/SQL Language Basics If you have a block of codes to be executed repeatedly over a range of values, you can use the "FOR ... LOOP" statement. Here is a sample script on FOR statements: DECLARE total NUMBER := 0; BEGIN FOR i IN 1..10 LOO...
2007-04-29, 5160👍, 0💬

What Are the Arithmetic Operations
What Are the Arithmetic Operations? - Oracle DBA FAQ - Understanding PL/SQL Language Basics There are 4 basic arithmetic operations on numeric values as shown in the following sample script: PROCEDURE proc_arithmetic AS addition NUMBER; subtraction NUMBER; multiplication NUMBER; division NUMBER; BEG...
2007-04-30, 5145👍, 0💬

How To Pass a Parameter to a Cursor
How To Pass a Parameter to a Cursor? - Oracle DBA FAQ - Working with Cursors in PL/SQL When you define a cursor, you can set a formal parameter in the cursor. The formal parameter will be replaced by an actual parameter in the OPEN cursor statement. Here is a good example of a cursor with two parame...
2007-04-28, 5130👍, 0💬

What Is PL/SQL Language Case Sensitive
What Is PL/SQL Language Case Sensitive? - Oracle DBA FAQ - Understanding PL/SQL Language Basics PL/SQL language is not case sensitive: Reserved words are not case sensitive. For example: CASE and Case are identical. Variable names and other names are not case sensitive. For example: TOTAL_SALARY and...
2007-05-01, 5116👍, 0💬

What Are the Numeric Comparison Operations
What Are the Numeric Comparison Operations? - Oracle DBA FAQ - Understanding PL/SQL Language Basics PL/SQL supports 6 basic numeric comparison operations as shown in the following sample script: PROCEDURE proc_comparison AS res BOOLEAN; BEGIN res := 1 = 2; res := 1 2; res := 1 = 2; res := 1 2; -- mo...
2007-04-30, 5112👍, 0💬

How To Define Default Values for Formal Parameters
How To Define Default Values for Formal Parameters? - Oracle DBA FAQ - Creating Your Own PL/SQL Procedures and Functions If you have an IN parameter, you can make it as an optional parameter for the calling statement by defining the formal parameter with the DEFAULT clause. This gives you the freedo...
2007-04-21, 5108👍, 0💬

What Happens If Recursive Calls Get Out of Control
What Happens If Recursive Calls Get Out of Control? - Oracle DBA FAQ - Creating Your Own PL/SQL Procedures and Functions What happens if your code has bug on recursive procedure calls, which causes an infinite number nested procedure calls? The answer is so good. Oracle server seems to offer no prot...
2007-04-25, 5103👍, 0💬

How Many Types of Cursors Supported in PL/SQL
How Many Types of Cursors Supported in PL/SQL? - Oracle DBA FAQ - Working with Cursors in PL/SQL PL/SQL supports two types of cursors: The implicit cursor - A single default cursor that automatically connects to the last DML statement executed. Explicit cursors - User defined cursors with specific D...
2007-04-29, 5074👍, 0💬

What Is a Cursor Variable
What Is a Cursor Variable? - Oracle DBA FAQ - Working with Cursors in PL/SQL A cursor variable is a variable of a specific REF CURSOR data type, which is a pointer to a data structure resource connects to query statement result, similar to the CURSOR data type.. The advantage of using cursor variabl...
2007-04-28, 5074👍, 0💬

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, 5033👍, 0💬

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