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

What Is the Scope of a Local Variable
What Is the Scope of a Local Variable? - Oracle DBA FAQ - Creating Your Own PL/SQL Procedures and Functions The scope of a variable can be described with these rules: A variable is valid within the procedure or function where it is defined. A variable is also valid inside a sub procedure or function...
2007-04-21, 5477👍, 0💬

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

What Is a Deadlock
What Is a Deadlock? Deadlock is a unique situation in a multi user system that causes two or more users to wait indefinitely for a locked resource. First user needs a resource locked by the second user and the second user needs a resource locked by the first user. To avoid dead locks, avoid using ex...
2007-04-15, 5374👍, 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, 5350👍, 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, 5309👍, 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, 5285👍, 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, 5274👍, 0💬

What Is Integrity?
What Is Integrity? Several points about data integrity: Assures database data and structures reflects all changes made to them in the correct sequence. Locks ensure data integrity and maximum concurrent access to data. Commit statement releases all locks. Types of locks are given below. Data Locks p...
2007-04-15, 5263👍, 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, 5242👍, 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, 5237👍, 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, 5234👍, 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, 5229👍, 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, 5204👍, 0💬

What Are TTITLE and BTITLE
What Are TTITLE and BTITLE? TTITLE and BTITLE are commands to control report headings & footers.
2007-04-15, 5188👍, 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, 5178👍, 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, 5176👍, 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, 5169👍, 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, 5165👍, 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, 5152👍, 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, 5133👍, 0💬

What Is SQL*Loader
What Is SQL*Loader? SQL*Loader is a product for moving data in external files into tables in an Oracle database. To load data from external files into an Oracle database, two types of input must be provided to SQL*Loader: the data itself and the control file. The control file describes the data to b...
2007-04-15, 5125👍, 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, 5121👍, 0💬

What Is Mutating Table
What Is Mutating Table? Mutating Table is a table that is currently being modified by an Insert, Update or Delete statement. Constraining Table is a table that a triggering statement might need to read either directly for a SQL statement or indirectly for a declarative Referential Integrity constrai...
2007-04-15, 5120👍, 0💬

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