This chapter lists PL/SQL language elements and features supported in TimesTen. (In the Oracle Database documentation, many of these features are covered in "PL/SQL Language Elements" in Oracle Database PL/SQL Language Reference.)
Note that these are not supported in TimesTen:
Features: autonomous transactions, database links (dblinks), result cache, savepoints, triggers, user-defined objects or collections
While TimesTen does not support triggers, you can achieve similar functionality using XLA. See "XLA and TimesTen Event Management" in Oracle TimesTen In-Memory Database C Developer's Guide.
Statements: CREATE LIBRARY
, CREATE TYPE
, LOCK TABLE
, SAVEPOINT
, SET TRANSACTION
Pragmas: AUTONOMOUS_TRANSACTIONS
, RESTRICT_REFERENCES
, SERIALLY_REUSABLE
SYSTIMESTAMP
: TimesTen cannot support this because the return type, TIMESTAMP WITH TIME ZONE
, is not supported. As an alternative, you can use SELECT tt_sysdate FROM dual
using dynamic SQL:
declare ts timestamp; begin execute immediate 'select tt_sysdate from dual' into ts; -- ts has millisecond resolution end;
Table 8-1 PL/SQL language element and feature support in TimesTen
Feature name | Description | Example/comment |
---|---|---|
|
Recompiles a PL/SQL procedure, function, or package. |
Syntax and semantics are the same as in Oracle Database. For information about these statements, see "SQL Statements" in Oracle TimesTen In-Memory Database SQL Reference. |
|
Changes session parameters dynamically. |
In TimesTen, you can use For more information on this statement in TimesTen, see "ALTER SESSION" in Oracle TimesTen In-Memory Database SQL Reference. |
Assignment statement |
Sets current value of a variable, parameter, or element. |
|
Block declaration |
Declares a block, the basic unit of a PL/SQL source program. |
See "PL/SQL blocks". |
|
Select multiple rows. |
This clause can be used with the |
|
Executes a routine from within SQL. |
In TimesTen, use the |
|
Evaluates an expression, compares it against several values, and takes action according to the comparison that is true. |
|
|
Closes a cursor or cursor variable. |
See Example 2-17, "Using a cursor to retrieve information about an employee" (among others). |
Collection definition |
Specifies a collection, which is an ordered group of elements that are all of the same type. |
Examples include associative arrays (index-by tables or PL/SQL tables), nested tables, and varrays. TimesTen supports all three of these collection types in PL/SQL programs, but supports only associative arrays as bound parameters between PL/SQL and applications written in other languages (such as OCI or JDBC). |
Collection methods |
Built-in subprograms that operate on collections and are called using "dot" notation. |
See "Collection Methods" in Oracle Database PL/SQL Language Reference. Examples include |
Comments |
Text included within your code for explanatory purposes. |
Single-line and multi-line comments are supported. |
|
Ends the current transaction and makes permanent all changes performed in the transaction. |
See "COMMIT" in Oracle TimesTen In-Memory Database SQL Reference. Important: |
Connection attributes |
Equivalent to initialization parameters in Oracle Database. |
See "PL/SQL connection attributes". Also see "PL/SQL first connection attributes" and "PL/SQL general connection attributes" in Oracle TimesTen In-Memory Database Reference. |
Constant and variable declarations |
Specify constants and variables to be used in PL/SQL code, in the declarative part of any PL/SQL block, subprogram, or package. |
|
|
Exits the current iteration of a loop and transfers control to the next iteration. |
See "CONTINUE statement". |
|
Creates a PL/SQL function. |
See "PL/SQL procedures and functions". Also see "CREATE FUNCTION" in Oracle TimesTen In-Memory Database SQL Reference. You are not required to run |
|
These statements are used together to create a PL/SQL package definition and package body. |
See "PL/SQL packages". Also see "CREATE PACKAGE" and "CREATE PACKAGE BODY" in Oracle TimesTen In-Memory Database SQL Reference. You are not required to run |
|
Creates a PL/SQL procedure. |
See "PL/SQL procedures and functions". Also see "CREATE PROCEDURE" in Oracle TimesTen In-Memory Database SQL Reference. Note: You are not required to run |
|
Returns the current date in the session time zone. |
In TimesTen, this returns the current date in UTC (universal time). TimesTen does not support local time zones. |
Cursor attributes |
Appended to the cursor or cursor variable to return useful information about the execution of a data manipulation statement. |
Explicit cursors and cursor variables have four attributes: The implicit cursor (SQL) has additional attributes: See "Using the %ROWCOUNT and %NOTFOUND attributes" and "Using FORALL with SQL%BULK_ROWCOUNT". Also see "Named Cursor Attribute" in Oracle Database PL/SQL Language Reference. |
Cursor declaration |
Declares a cursor. To execute a multi-row query, TimesTen opens an unnamed work area that stores processing information. A cursor lets you name the work area, access the information, and process the rows individually. |
|
Cursor variables (REF CURSORs) |
Act as handles to cursors over SQL result sets. |
TimesTen supports See "PL/SQL REF CURSORs". |
|
Deletes rows from a table. |
See "DELETE" in Oracle TimesTen In-Memory Database SQL Reference. |
|
Removes a PL/SQL procedure, function, or package, as specified. |
Syntax and semantics are the same as in Oracle Database. You can refer to information about these statements in "SQL Statements" in Oracle TimesTen In-Memory Database SQL Reference. |
Error reporting |
(This is self-explanatory.) |
TimesTen applications report errors using Oracle Database error codes instead of TimesTen error codes. The error messages that accompany the error codes are either TimesTen error messages or Oracle Database error messages. |
|
Associates a user-defined exception with a TimesTen error number. |
See "EXCEPTION_INIT Pragma" in Oracle Database PL/SQL Language Reference. |
Exception definition |
Specifies an exception, which is a runtime error or warning condition. Can be predefined or user-defined. |
Predefined conditions are raised implicitly. User-defined exceptions are raised explicitly by the |
|
Builds and executes a dynamic SQL statement. |
TimesTen supports this as Oracle Database does to execute a SQL DML or DDL statement, execute a PL/SQL anonymous block, or call a PL/SQL stored procedure or function. See "Dynamic SQL in PL/SQL (EXECUTE IMMEDIATE statement)". In TimesTen, the |
|
Exits a loop and transfers control to the end of the loop. |
See Example 6-2, "Use ALTER SESSION to change attribute settings" (among others). |
Expression definition |
Specifies an expression, which is a combination of operands (variables, constants, literals, operators, and so on) and operators. The simplest expression is a single variable. |
See "Expressions" in Oracle Database PL/SQL Language Reference. |
|
Retrieves rows of data from the result set of a multi-row query. |
See Example 2-17, "Using a cursor to retrieve information about an employee" (among others). |
|
Bulk-binds input collections before sending them to the SQL engine. |
|
Function declaration and definition |
Specifies a subprogram or stored program that can be declared and defined in a PL/SQL block or package and returns a single value. |
In TimesTen, a stored function or procedure can be executed in an anonymous block or through a In TimesTen Classic, use the Also refer to the table entry below for "Procedure declaration and definition". |
|
Branches unconditionally to a statement label or block label. |
See "GOTO Statement" in Oracle Database PL/SQL Language Reference. |
|
Executes or skips a sequence of statements depending on the value of the associated boolean expression. |
|
|
Specifies whether a subprogram call is to be inline. |
See "INLINE Pragma" in Oracle Database PL/SQL Language Reference. |
|
Inserts one or more rows of data into a table. |
See "Example using the INSERT statement". Also see "INSERT" in Oracle TimesTen In-Memory Database SQL Reference. |
Literal declaration |
Specifies a numeric, character string, or boolean value. |
Examples: Numeric literal: 135 String literal: 'TimesTen' |
|
Executes a sequence of statements multiple times. Can be used, for example, in implementing a |
See Example 2-8, "Using a WHILE loop". Also see "Basic LOOP Statement" in Oracle Database PL/SQL Language Reference. |
|
Allows you to select rows from one or more sources for update or insertion into a target table. |
See "MERGE" in Oracle TimesTen In-Memory Database SQL Reference. |
Native dynamic SQL execution |
Processes most dynamic SQL statements through the |
See the |
|
This is a no-operation statement. Control is passed to the next statement without any action. |
See "NULL Statement" in Oracle Database PL/SQL Language Reference. |
|
Executes the query associated with a cursor. Allocates database resources to process the query, and identifies the result set. |
See Example 2-17, "Using a cursor to retrieve information about an employee". |
|
Executes the |
See "OPEN FOR Statement" in Oracle Database PL/SQL Language Reference. |
Package declaration |
Specifies a package, which is a database object that groups logically related PL/SQL types, items, and subprograms. |
In TimesTen Classic, use SQL statements See "PL/SQL packages". Also see "SQL Statements" in Oracle TimesTen In-Memory Database SQL Reference for information about the |
Procedure declaration and definition |
Specifies a subprogram or stored program that can be declared and defined in a PL/SQL block or package and performs a specific action. |
In TimesTen, a stored procedure or function can be executed in an anonymous block or through a In TimesTen Classic, use the Also refer to the table entry above for "Function declaration and definition". |
|
Stops normal execution of a PL/SQL block or subprogram and transfers control to an exception handler. |
|
Record definition |
Defines a record, which is a composite variable that stores data values of different types (similar to a database row). |
|
|
Immediately completes the execution of a subprogram and returns control to the invoker. Execution resumes with the statement following the subprogram call. |
See "RETURN Statement" in Oracle Database PL/SQL Language Reference. |
|
Specifies the variables in which to store the values returned by the statement to which the clause belongs. |
See "RETURNING INTO clause" and "Examples using RETURNING INTO". |
|
Undoes database changes made during the current transaction. |
See "ROLLBACK" in Oracle TimesTen In-Memory Database SQL Reference. Important: |
|
Provides a record type that represents a row in a database table. |
See Example 2-2, "Assigning values to variables with the assignment operator". |
|
Retrieves values from one row of a table ( |
See Example 2-3, "Using SELECT INTO to assign values to variables". Also see "Processing Query Result Sets" in Oracle Database PL/SQL Language Reference. |
|
Returns a character string containing the phonetic representation of a |
See "SOUNDEX" in Oracle TimesTen In-Memory Database SQL Reference. |
SQL cursor |
Either explicit or implicit, handles the result set of a |
|
|
Returns number code of the most recent exception. |
Given the same error condition, error codes returned by the built-in function This is also noted in "TimesTen error messages and SQL codes". |
|
Returns the error message associated with the error-number argument. |
Given the same error condition, error messages returned by the built-in function This is also noted in "TimesTen error messages and SQL codes". |
Supplied packages |
These are PL/SQL packages supplied with the database. |
TimesTen provides a subset of the Oracle Database PL/SQL supplied packages. |
System tables and views |
These are tables and views provided with the database for administrative purposes. |
TimesTen supports a subset of the Oracle Database system tables and views. See "System Tables and Views" in Oracle TimesTen In-Memory Database System Tables and Views Reference. |
Returns statistics about library cache performance and activity. |
See "ttPLSQLMemoryStats" in Oracle TimesTen In-Memory Database Reference. Note: In Oracle Database, the |
|
|
Lets you use the data type of a field, record, nested table, database column, or variable in your own declarations, rather than hardcoding the data type. Particularly useful when declaring variables, fields, and parameters that refer to database columns. |
|
|
Updates the values of one or more columns in all rows of a table or in rows that satisfy a search condition. |
See "UPDATE" in Oracle TimesTen In-Memory Database SQL Reference. |