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

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

What Is the Implicit Cursor
What Is the Implicit Cursor? - Oracle DBA FAQ - Working with Cursors in PL/SQL There is only one implicitly cursor in a session. The implicit cursor is the cursor automatically defined by PL/SQL for you. Whenever a SQL statement is executed, this cursor will be assigned to represent the execution of...
2007-04-29, 4241👍, 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, 4332👍, 0💬

How To Use Attributes of the Implicit Cursor
How To Use Attributes of the Implicit Cursor? - Oracle DBA FAQ - Working with Cursors in PL/SQL Right after executing a DML statement, you retrieve any attribute of the implicit cursor by using SQL%attribute_name, as shown in the following tutorial exercise: CREATE TABLE student (id NUMBER(5) PRIMAR...
2007-04-29, 4359👍, 0💬

How To Open and Close an Explicit Cursor
How To Open and Close an Explicit Cursor? - Oracle DBA FAQ - Working with Cursors in PL/SQL An existing cursor can be opened or closed by the OPEN or CLOSE statement as shown in the following sample script: DECLARE CURSOR c_list IS SELECT * FROM countries; CURSOR t_list IS SELECT * FROM employees WH...
2007-04-29, 4225👍, 0💬

How To Define an Explicit Cursor
How To Define an Explicit Cursor? - Oracle DBA FAQ - Working with Cursors in PL/SQL An explicit cursor must be defined in the declaration part of a procedure or function with the CURSOR ... IS statement as shown in the following sample script: DECLARE CURSOR c_list IS SELECT * FROM countries; CURSOR...
2007-04-29, 4341👍, 0💬

How To Retrieve Data from an Cursor to a RECORD
How To Retrieve Data from an Cursor to a RECORD? - Oracle DBA FAQ - Working with Cursors in PL/SQL If you have a cursor opened ready to use, you can also use the FETCH statement to retrieve data from the cursor into a RECORD variable as shown in the tutorial exercise below: CREATE OR REPLACE PROCEDU...
2007-04-29, 4291👍, 0💬

How To Retrieve Data from an Explicit Cursor
How To Retrieve Data from an Explicit Cursor? - Oracle DBA FAQ - Working with Cursors in PL/SQL If you have a cursor opened ready to use, you can use the FETCH ... INTO statement to retrieve data from the cursor into variables. FETCH statement will: Retrieve all the fields from the row pointed by th...
2007-04-29, 4164👍, 0💬

How To Use FETCH Statement in a Loop
How To Use FETCH Statement in a Loop? - Oracle DBA FAQ - Working with Cursors in PL/SQL If you have a cursor opened ready to use, you can also use the FETCH statement in a loop to retrieve data from the cursor more efficiently. But you need to remember to use an EXIT statement break the loop when th...
2007-04-29, 4309👍, 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, 4377👍, 0💬

Can Multiple Cursors Being Opened at the Same Time
Can Multiple Cursors Being Opened at the Same Time? - Oracle DBA FAQ - Working with Cursors in PL/SQL Yes, multiple cursors can be opened at the same time. See the following example: CREATE OR REPLACE PROCEDURE FYI_CENTER AS CURSOR emp_cur IS SELECT * FROM employees; emp_rec employees%ROWTYPE; CURSO...
2007-04-28, 6622👍, 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, 4662👍, 0💬

How To Define a Cursor Variable
How To Define a Cursor Variable? - Oracle DBA FAQ - Working with Cursors in PL/SQL To define cursor variable, you must decide which REF CURSOR data type to use. There are 3 ways to select a REF CURSOR data type: Define your own specific REF CURSOR types using the TYPE ... RETURN statement. Define yo...
2007-04-28, 4334👍, 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, 4574👍, 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, 4386👍, 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, 4306👍, 0💬

Why Cursor Variables Are Easier to Use than Cursors
Why Cursor Variables Are Easier to Use than Cursors? - Oracle DBA FAQ - Working with Cursors in PL/SQL Cursor variables are easier to use than cursors because: Cursor variables are easier to define. No need to give a specific query statement. Cursor variables are easier to open. You can specify the ...
2007-04-28, 4308👍, 0💬

How To Pass a Cursor Variable to a Procedure
How To Pass a Cursor Variable to a Procedure? - Oracle DBA FAQ - Working with Cursors in PL/SQL A cursor variable can be passed into a procedure like a normal variable. The sample script below gives you a good example: CREATE OR REPLACE PROCEDURE FYI_CENTER AS sys_cur SYS_REFCURSOR; PROCEDURE emp_pr...
2007-04-28, 4323👍, 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, 4407👍, 0💬

Can DML Statements Be Used in PL/SQL
Can DML Statements Be Used in PL/SQL? - Oracle DBA FAQ - Working with Database Objects in PL/SQL Yes, you can run almost any DML statements in PL/SQL directly. To manipulate Oracle database data you can include INSERT, UPDATE, and DELETE statements, directly in PL/SQL programs, without any special n...
2007-04-28, 4142👍, 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, 4411👍, 0💬

Can Variables Be Used in SQL Statements
Can Variables Be Used in SQL Statements? - Oracle DBA FAQ - Working with Database Objects in PL/SQL Yes, you can use variables in SQL statements as part of any expressions. The tutorial script provides you some good examples: (Connect to XE with SQL*Plus) CREATE TABLE student (id NUMBER(5) PRIMARY K...
2007-04-28, 4213👍, 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, 4710👍, 0💬

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