<< < 14 15 16 17 18 19 20 >   ∑:464  Sort:Date

Define a Variable for a Specific RECORD Type in Oracle
How To Define a Variable of a Specific RECORD Type in Oracle? Once you have your specific RECORD type defined, you can define new variables with this specific RECORD type like any other data type. In the sample script below, several variables are defined with a regular data type and a specific RECOR...
2018-09-01, 1451🔥, 0💬

Define a RECORD Variable for a Table Row in Oracle
How To Define a RECORD Variable to Store a Table Row in Oracle? If you have a table, and want to define a RECORD variable to store all the data elements of a row from that table, you can use table_name%ROWTYPE to define the RECORD variable as shown in the following sample script: CREATE TABLE studen...
2018-08-14, 1450🔥, 0💬

Count Duplicated Values in a Column in Oracle
How To Count Duplicated Values in a Column in Oracle? If you have a column with duplicated values, and you want to know what are those duplicated values are and how many duplicates are there for each of those values, you can use the GROUP BY ... HAVING clause as shown in the following example. It re...
2019-11-21, 1448🔥, 0💬

Read Consistency in Oracle in Oracle
How Does Oracle Handle Read Consistency in Oracle? Oracle supports two options for you on how to maintain read consistency: READ WRITE (the default option), also called statement-level read consistency. READ ONLY, also called transaction-level read consistency.   ⇒ What Is a READ WRITE Transaction i...
2019-08-23, 1448🔥, 0💬

Run the Anonymous Block Again in Oracle
How To Run the Anonymous Block Again in Oracle? 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&gt; set serveroutput on; SQL&gt; begin 2 dbms_output.put_line('This is a PL/SQL FAQ.'); 3 end; 4 / Th...
2018-10-30, 1447🔥, 0💬

Show All Background Sessions in the Database in Oracle
How To Get a List of All Background Sessions in the Database in Oracle? If you don't like to use a SELECT statement to get a list of all background sessions in the current database, you can use the Reports view to do this as shown in the following tutorial example. You need to connect to the server ...
2019-01-26, 1439🔥, 0💬

Use Existing Column Values in SET Clause in Oracle
How To Use Existing Values in UPDATE Statements in Oracle? If a row matches the WHERE clause in a UPDATE statement, existing values in this row can be used in expressions to provide new values in the SET clause. Existing values are represented by columns in the expressions. The tutorial exercise bel...
2020-01-21, 1434🔥, 0💬

Sort the Query Output in Oracle
How To Sort the Query Output in Oracle? If you want the returning rows to be sorted, you can specify a sorting expression in the ORDER BY clause. The following select statement returns rows sorted by the values in the "manager_id" column: SQL&gt; SELECT * FROM departments ORDER BY manager_id; DE...
2019-12-19, 1433🔥, 0💬

Enter a New Row Interactively in Oracle
How To Enter a New Row into a Table Interactively in Oracle? If you don't like to use the INSERT statement to enter a new row into a table, you can use the object view to enter it interactively. Follow the steps below to enter new row into table TIP: Double-click on the table name TIP. Click the Dat...
2018-10-08, 1433🔥, 0💬

Apply Filtering Criteria at Group Level in Oracle
How To Apply Filtering Criteria at Group Level in Oracle? If you want to return only specific groups from the query, you can apply filtering criteria at the group level by using the HAVING clause inside the GROUP BY clause. The following script gives you a good HAVING example: SQL&gt; SELECT dep...
2019-11-21, 1432🔥, 0💬

Work with Data Objects Interactively in Oracle
How To Work with Data Objects Interactively in Oracle? You can work with data objects through SQL statements in statement area. If you want to work with data objects interactively, you should use the object browser. The following tutorial steps help you to browse data objects: Click the Connetions t...
2018-10-08, 1432🔥, 0💬

Filter Out Duplications in Returning Rows in Oracle
How To Filter Out Duplications in Returning Rows in Oracle? If there are duplications in the returning rows, and you want to remove the duplications, you can use the keyword DISTINCT or UNIQUE in the SELECT clause. The tutorial exercise below shows you that DISTINCT works on selected columns only: S...
2019-12-19, 1431🔥, 0💬

Use Variables in SQL Statements in Oracle
Can Variables Be Used in SQL Statements in Oracle? 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 KEY, first_name VARCHAR(80) NOT NULL, last_name VA...
2018-09-24, 1431🔥, 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, 1421🔥, 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, 1420🔥, 0💬

Update Values on Multiple Rows in Oracle
How To Update Values on Multiple Rows in Oracle? If the WHERE clause in an UPDATE matches multiple rows, the SET clause will be applied to all matched rows. This rule allows you to update values on multiple rows in a single UPDATE statement. Here is a good example: UPDATE fyi_links SET counts = 9, n...
2020-01-21, 1418🔥, 0💬

Assign Data from a Deleted Row to Variables in Oracle
How To Assign Data of the Deleted Row to Variables in Oracle? If a DELETE statement is deleting a single row, you can assign column values of the deleted row to variables by using the RETURNING clause, which an extension of DELETE statements for PL/SQL. The tutorial script shows you how to do this: ...
2018-09-13, 1417🔥, 0💬

Retrieve Field Values from RECORD Variables in Oracle
How To Retrieve Values from Data Fields in RECORD Variables in Oracle? 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 "variable.field_name". Here is a sample script showing...
2018-09-01, 1416🔥, 0💬

Create a Single Index for Multiple Columns in Oracle
How To Create a Single Index for Multiple Columns in Oracle? If you know a group of multiple columns will be always used together as search criteria, you should create a single index for that group of columns with the "ON table_name(col1, col2, ...)" clause. Here is an example of one index for two c...
2019-04-17, 1413🔥, 0💬

Query Output Sorted by Multiple Columns in Oracle
Can the Query Output Be Sorted by Multiple Columns in Oracle? You can specifying multiple columns in the ORDER BY clause as shown in the following example statement, which returns employees' salaries sorted by department and salary value: SQL&gt; SELECT department_id, first_name, last_name, sala...
2019-12-19, 1411🔥, 0💬

Specify Default Values in INSERT Statements in Oracle
How To Specify Default Values in INSERT Statement in Oracle? If a column is defined with a default value in a table, you can use the key word DEFAULT in the INSERT statement to take the default value for that column. The following tutorial exercise gives a good example: INSERT INTO fyi_links VALUES ...
2020-01-29, 1407🔥, 0💬

Types of Execution Flow Control Statements in Oracle
What Are the Execution Control Statements in Oracle? 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 - Repeatedly executes a block of statements. ...
2018-11-17, 1406🔥, 0💬

Date and Time Differences in Oracle
How To Calculate Date and Time Differences in Oracle? If you want to know how many years, months, days and seconds are there between two dates or times, you can use the date and time interval expressions: YEAR ... TO MONTH and DAY ... TO SECOND. The tutorial exercise below gives you some good exampl...
2020-03-15, 1404🔥, 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, 1403🔥, 0💬

<< < 14 15 16 17 18 19 20 >   ∑:464  Sort:Date