Does Oracle have an equivalent of SQL Server’s table variables?

Yes.

Declare TABLE TYPE variables in a
PL/SQL declare block. Table variables
are also known as index-by table or
array. The table variable contains one
column which must be a scalar or
record datatype plus a primary key of
type BINARY_INTEGER. Syntax:

DECLARE
TYPE type_name IS TABLE OF
(column_type |
variable%TYPE |
table.column%TYPE
[NOT NULL]
INDEX BY BINARY INTEGER;

— Then to declare a TABLE variable of this type:
variable_name type_name;

— Assigning values to a TABLE variable:
variable_name(n).field_name :=
‘some text’; — Where ‘n’ is the
index value

Ref: http://www.iselfschooling.com/syntax/OraclePLSQLSyntax.htm

You might want to also take a look at Global Temporary Tables

Leave a Comment