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

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, 4680👍, 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 Assign Query Results to Variables
How To Assign Query Results to Variables? - Oracle DBA FAQ - Working with Database Objects in PL/SQL If you want to assign results from SELECT statements to variables, you can use the INTO clause, which an extension of SELECT statements for PL/SQL. The sample code below shows some good example on IN...
2007-04-27, 9506👍, 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 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💬

How To Retrieve the Count of Updated Rows
How To Retrieve the Count of Updated Rows? - Oracle DBA FAQ - Working with Database Objects in PL/SQL After running an UPDATE statement, the database server returns a count of updated rows. You can retrieve this count from a special predefined variable called SQL%ROWCOUT, as shown in the following t...
2007-04-27, 6517👍, 0💬

What Is the Implicit Cursor
What Is the Implicit Cursor? - Oracle DBA FAQ - Working with Database Objects in PL/SQL 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 this statement. This implicit cursor is ...
2007-04-27, 4783👍, 0💬

How To Assign Data of the Deleted Row to Variables
How To Assign Data of the Deleted Row to Variables? - Oracle DBA FAQ - Working with Database Objects in PL/SQL 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/SQ...
2007-04-27, 4772👍, 0💬

What Is a RECORD in PL/SQL
What Is a RECORD in PL/SQL? - Oracle DBA FAQ - Working with Database Objects in PL/SQL RECORD is a composite data type in PL/SQL. It can have many fields representing data elements with different data types. Variables of RECORD type can be designed to hold data from database table rows. To use RECOR...
2007-04-27, 4772👍, 0💬

How To Define a Specific RECORD Type
How To Define a Specific RECORD Type? - Oracle DBA FAQ - Working with Database Objects in PL/SQL If you want to define a specific RECORD type, you need to use the TYPE ... IS RECORD statement in the declaration part of any procedure or function. The following example script defines a RECORD type cal...
2007-04-27, 4730👍, 0💬

How To Define a Variable of a Specific RECORD Type
How To Define a Variable of a Specific RECORD Type? - Oracle DBA FAQ - Working with Database Objects in PL/SQL 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 defi...
2007-04-27, 4632👍, 0💬

How To Assign Values to Data Fields in RECORD Variables
How To Assign Values to Data Fields in RECORD Variables? - Oracle DBA FAQ - Working with Database Objects in PL/SQL If a variable is a RECORD variable, you can assign values to its data fields by using fields names prefixed with variable name as "variable.field_name". Here is a sample script assigni...
2007-04-27, 4952👍, 0💬

How To Retrieve Values from Data Fields in RECORD Variables
How To Retrieve Values from Data Fields in RECORD Variables? - Oracle DBA FAQ - Working with Database Objects in PL/SQL 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 "vari...
2007-04-27, 4849👍, 0💬

How To Define a Data Field as NOT NULL
How To Define a Data Field as NOT NULL? - Oracle DBA FAQ - Working with Database Objects in PL/SQL When defining a specific RECORD type, you can define a data field as NOT NULL to make sure variables with this RECORD type to always have values in this field. A field defined as NOT NULL must have a d...
2007-04-27, 4794👍, 0💬

How To Define a RECORD Variable to Store a Table Row
How To Define a RECORD Variable to Store a Table Row? - Oracle DBA FAQ - Working with Database Objects in PL/SQL 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...
2007-04-27, 4656👍, 0💬

How To Assign a Table Row to a RECORD Variable
How To Assign a Table Row to a RECORD Variable? - Oracle DBA FAQ - Working with Database Objects in PL/SQL If you have a table, and want to assign a data row of that table to a RECORD variable, you need to define this RECORD variable to match the table column structure, then use the SELECT ... INTO ...
2007-04-27, 4806👍, 0💬

How To Insert a Record into a Table
How To Insert a Record into a Table? - Oracle DBA FAQ - Working with Database Objects in PL/SQL If you have a RECORD variable with data fields matching a table structure, you can insert a row to this table with this RECORD variable using the INSERT statement as shown in the example below: CREATE TAB...
2007-04-26, 4827👍, 0💬

How To Update a Table Row with a Record
How To Update a Table Row with a Record? - Oracle DBA FAQ - Working with Database Objects in PL/SQL If you have a RECORD variable with data fields matching a table structure, you can update a row in this table with this RECORD variable using the UPDATE ... SET ROW statement as shown in the sample sc...
2007-04-26, 5015👍, 0💬

How To Define a Variable to Match a Table Column Data Type
How To Define a Variable to Match a Table Column Data Type? - Oracle DBA FAQ - Working with Database Objects in PL/SQL If you have a table, and want to define some variables to have exactly the same data types as some columns in that table, you can use table_name.column_name%TYPE as data types to de...
2007-04-26, 4712👍, 0💬

What Is a Procedure
What Is a Procedure? - Oracle DBA FAQ - Creating Your Own PL/SQL Procedures and Functions 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...
2007-04-26, 4633👍, 0💬

What Is a Function
What Is a Function? - Oracle DBA FAQ - Creating Your Own PL/SQL Procedures and Functions A function is a named program unit. It consists of three parts: Declaration Part - Defining the function name, calling parameters, return value type, local variables and local procedures. Declaration part is req...
2007-04-26, 4598👍, 0💬

How To Define an Anonymous Procedure without Variables
How To Define an Anonymous Procedure without Variables? - Oracle DBA FAQ - Creating Your Own PL/SQL Procedures and Functions Anonymous procedure is a procedure without any name. If you don't have any variables to declare, you can define an anonymous procedure by using the BEGIN keyword directly in S...
2007-04-26, 4634👍, 0💬

How To Define an Anonymous Procedure with Variables
How To Define an Anonymous Procedure with Variables? - Oracle DBA FAQ - Creating Your Own PL/SQL Procedures and Functions Anonymous procedure is a procedure without any name. If you have some variables to declare, you can define an anonymous procedure by using the DECLARE keyword in SQL*Plus as show...
2007-04-26, 4672👍, 0💬

How To Create a Stored Procedure
How To Create a Stored Procedure? - Oracle DBA FAQ - Creating Your Own PL/SQL Procedures and Functions A stored procedure is a procedure with a specified name and stored into the current database. If you want to create a stored procedure, you can use the CREATE PROCEDURE statement. The example scrip...
2007-04-26, 4938👍, 0💬

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