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

Define an Explicit Cursor in Oracle
How To Define an Explicit Cursor in Oracle? 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 t_list IS SELECT * FROM employees WHERE...
2018-07-22, 461👍, 0💬

Loop through the Implicit Cursor in Oracle
How To Loop through Data Rows in the Implicit Curosr in Oracle? 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 "row" is a local RECORD type variable with...
2018-07-22, 449👍, 0💬

Open and Close an Explicit Cursor in Oracle
How To Open and Close an Explicit Cursor in Oracle? 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 WHERE employee_id = 100; BEGIN OPEN c_list...
2018-07-22, 439👍, 0💬

Open a Cursor Variable in Oracle
How To Open a Cursor Variable in Oracle? 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 exercise: CREATE OR REPLACE PROCEDURE FY...
2018-07-18, 575👍, 0💬

Loop through a Cursor Variable in Oracle
How To Loop through a Cursor Variable in Oracle? 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 loop through a cursor variable: CREATE OR...
2018-07-18, 515👍, 0💬

Define a Cursor Variable in Oracle
How To Define a Cursor Variable in Oracle? 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 your own generic REF CURSOR type using the...
2018-07-18, 498👍, 0💬

Pass a Cursor Variable to a Procedure in Oracle
How To Pass a Cursor Variable to a Procedure in Oracle? 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_print(cur SYS_REFCURSOR) AS emp_rec employ...
2018-07-18, 488👍, 0💬

Pass a Parameter to a Cursor in Oracle
How To Pass a Parameter to a Cursor in Oracle? 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 parameters: CREATE OR REPLACE PROCEDURE FYI_CE...
2018-07-18, 436👍, 0💬

What Is NULL in PL/SQL in Oracle
What Is NULL in PL/SQL in Oracle? NULL is a reserved key word and it stands for two things in PL/SQL: NULL is an executable statement, and means doing nothing. NULL is a data value, and means no value. The following sample script shows you examples of using NULL keyword: DECLARE next_task CHAR(80); ...
2018-07-13, 530👍, 0💬

Test NULL Values in Oracle
How To Test NULL Values in Oracle? There ate two special comparison operators you can use on NULL values: "variable IS NULL" - Returns TRUE if the variable value is NULL. "variable IS NOT NULL" - Return TRUE if the variable value is not NULL. The following sample script shows you examples of compari...
2018-07-13, 459👍, 0💬

Use "WHILE" Loop Statements in Oracle
How To Use "WHILE" Loop Statements in Oracle? 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 total &lt; 10 LOOP total := total+1; END ...
2018-07-13, 453👍, 0💬

Use "IF" Statements with Multiple Conditions in Oracle
How To Use "IF" Statements on Multiple Conditions in Oracle? If you have multiple blocks of codes to be executed based on different conditions, you can use the "IF ... ELSIF" statement. Here is a sample script on IF statements: DECLARE day VARCHAR2; BEGIN day := 'SUNDAY'; IF day = 'THURSDAY' THEN DB...
2018-07-13, 447👍, 0💬

Use "FOR" Loop Statements in Oracle
How To Use "FOR" Loop Statements in Oracle? 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 LOOP total := total + i; END LOOP; DBMS_OUTP...
2018-07-13, 419👍, 0💬

Loading and Exporting Data in Oracle
Where to find answers to frequently asked questions on Loading and Exporting Data in Oracle? Here is a list of frequently asked questions and their answers compiled by FYIcenter.com DBA team on Loading and Exporting Data in Oracle. Clear answers are provided with tutorial exercises on saving data as...
2018-06-27, 625👍, 0💬

Simplest Tool to Run Commands on Oracle Server in Oracle
What Is the Simplest Tool to Run Commands on Oracle Servers in Oracle? The simplest tool to connect to an Oracle server and run commands to manage data is SQL*Plus. It is an Oracle database client tool that works as a command-line user interface to the database server. SQL*Plus allows you: Format, p...
2018-06-27, 539👍, 0💬

Export Data with Field Delimiters in Oracle
How To Export Data with a Field Delimiter in Oracle? The previous exercise allows you to export data with fixed field lengths. If you want export data with variable field lengths and field delimiters, you can concatenate your fields with an expression in the SELECT clause as shown in the tutorial ex...
2018-06-27, 506👍, 0💬

Quickest Way to Export Data to a Flat File in Oracle
What Is the Quickest Way to Export a Table to a Flat File in Oracle? The quickest way to export a table to a flat file is probably to use the SQL*Plus SPOOL command. It allows you to record SELECT query result to a text file on the operating system. The following tutorial exercise shows you how cont...
2018-06-27, 497👍, 0💬

Cursor Variable Easier to Use than Cursor in Oracle
Why Cursor Variables Are Easier to Use than Cursors in Oracle? 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 query dynamically at the time of open. C...
2018-06-27, 467👍, 0💬

What Is SQL*Loader in Oracle
What Is SQL*Loader in Oracle? SQL*Loader is a database tool that allows to load data from external files into database tables. SQL*Loader is available as part of the free Oracle 10g Expression Edition. It has some interesting features as: Can load data from multiple data files into multiple tables i...
2018-06-12, 563👍, 0💬

Start with a Minimum Initialization Parameter File in Oracle
How To Start Instance with a Minimal Initialization Parameter File in Oracle? The sample initialization parameter file provided by Oracle seems to be not working. But we can try to start the new instance with a minimal initialization parameter file (PFile). First you can create another PFile, $ORACL...
2018-05-08, 797👍, 0💬

Create a Server Parameter File in Oracle
How To Create a Server Parameter File in Oracle? This is Step 5. The initialization parameter file is good to get an Oracle database instance started. But it is not ideal run an instance as production. You need to convert the initialization parameter file into a Server Parameter File (SPFile) using ...
2018-05-08, 561👍, 0💬

Start a Specific Oracle Instance in Oracle
How To Start a Specific Oracle Instance in Oracle? A simple way to start a specific Oracle instance is to start the instance with the PFILE option as shown in the following example: &gt;.\bin\sqlplus /nolog SQL&gt; CONNECT / AS SYSDBA Connected. SQL&gt; STARTUP NOMOUNT PFILE=$ORACLE_HOME...
2018-05-08, 537👍, 0💬

Start an Oracle Instance in Oracle
How To Start an Oracle Instance in Oracle? This is Step 6. Now you are ready to start the new Oracle Instance without any database. This instance will be used to create a database. Starting an instance without database can be done by using STARTUP NOMOUNT statement as shown below: &gt;.\bin\sqlp...
2018-05-08, 503👍, 0💬

Run CREATE DATABASE Statement in Oracle
How To Run CREATE DATABASE Statement in Oracle? This is Step 7. Oracle Administrator Guide provided a sample CREATE DATABASE statement. But it is a long statement. You can modify and same it in a file, $ORACLE_HOME/configscripts/cre ate_database_fyi.sql,and run the file within SQL*Plus. Here is a co...
2018-05-08, 451👍, 0💬

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