-
Composite Variable
references a data structure that contains multiple scalar variables
-
Concatening
join two strings
-
Cursor
points to memory location on DB server that the DBMS uses to process the query
-
Data Structure
Object made up of multiple data elements
-
-
Exception Handling
Gives users options for fixing errors in the EXCEPTION section
-
Exception Section
Triggered by EXCEPTION, contains error-handling statements
-
Execution Section
Starts with BEGIN
-
Explicit Cursor
Retreives and displays data in PL/SQL programs for a query that might retrieve multiple records or none at all
-
Function
program that receives one or more inputs (parameters) and returns a single output value
-
Implicit Cursor
points to a context area which contains info about the query (number of rows, etc.)
-
Implicit Data Conversion
Interpreter automatically converts a value datatype
-
Logic Error
Doesn't halt program, but produces incorrect result
-
Loop
Executes statements and evaluates an exit condition to determine if it should repeat or exit
-
PL/SQL Output Buffer
Memory area on DB server that stores output values before they are displayed to the user
-
Parse
Separating a single string of two data items via commas or spaces
-
Posttest Loop
- Executes 1 ore more commands before loop evaluates exit condittion for first time
- (Tests Post-action)
-
Predefined Exception
most common error in a program
-
Pretest Loop
Evaluates exit condition before executing any commands
-
Procedural Programming Language (PL)
Uses detailed, sequential instructions to process data
-
Reference Variables
Directly reference a specific DB column or row and assume that datatype
-
Scalar Variable
References a single value
-
Strongly Typed Language
Each variable must be declared before it can be used
-
Syntax Error
Command does not follow guidelines of programming language
-
Undefined Exception
Less common errors that do not have predefined names
-
Anonymous PL/SQL programs
programs you submit to the interpreter to run, but do not ineract with other program units
-
Client-side units
program units stored on client workstation and execute there
-
Composite Index
DB index table that contains up to 16 sorted columns that the DBMS can use for finding row location
-
DB Table Index
Distinct DB table that contains data values with corresponding columns that specify physical locations of records
-
Parameter Mode
Describes how program unit can change the parameter value
-
Procedure
Program unit that can receive multiple input parameters and return multiple output values or none at all
-
Public Variables
visible to many different PL/SQL programs
-
ROWID
specifies internal location of a record in the DB
-
Stored PL/SQL program units
Other PL/SQL programs can reference and other DB users can execute
-
PLSQL: VARCHAR2
Can store up to 32,767 characters
-
PLSQL: CHAR
fixed-length, if you put in less than the requested amount it pads the rest
-
PLSQL: INTERVAL
can be DAY TO SECOND or YEAR TO MONTH
-
Data Structure
Object made of multiple elements
-
PLSQL: Composite Variable types
Record, Table, VARRAY
-
-
%TYPE syntax
- variable_name table.column%type
- references a single field
-
%ROWTYPE syntax
variable_name table%rowtype
-
-
-
setting the buffer
SET SERVEROUTPUT ON SIZE 4000
-
TO_CHAR syntax
- TO_CHAR(input, 'output');
- TO_CHAR(2.98, '$999.99');
-
TO_DATE syntax
- TO_DATE('input', 'output')
- TO_DATE('07/14/2003', 'MM/DD/YYYY');
-
LTRIM(variable)
RTRIM(variable)
removes leading and trailing spaces
-
Function that finds the number of characters
LENGTH();
-
INSTR();
finds location of a substring within a string
-
SUBSTR( number, number);
Extracts characters from a string. First number is start point, second is endpoint
-
-
Loop Types
- Loop...Exit
- Loop...Exit When
- While...Loop
- FOR [counter IN x..y]
-
Implicit Cursor
- SELECT field
- INTO variable
- FROM table
- WHERE condition;
- (CAN ONLY RETURN ONE RESULT)
-
Explicit Cursor
- CURSOR name IS <select query>;
- OPEN name;
- LOOP
- FETCH name into variables;
- EXIT WHEN name%NOTFOUND;
- END LOOP;
- CLOSE name;
-
INDEX creation/deletion
- CREATE INDEX _____
- ON column
DROP INDEX ______
-
PROCEDURES
- CREATE OR REPLACE PROCEDURE ______
- (____ in/out NUMBER;)
- IS
- variables
- BEGIN
- EXCEPTION
- END;
-
FUNCTIONS
- CREATE OR REPLACE FUNCTION ______
- (parameters)
- RETURN DATATYPE
- IS
- BEGIN
- EXCEPTION
- END;
-
Inject table with new rows
INSERT INTO tablename (targets) VALUES (variables);
-
Remove row from table
DELETE FROM tablename;
|
|