

You can declare an associative array type and then an associative array in PL/SQL as in the following example (note the INDEX BY): declare Indexes are stored in sort order, not creation order. For example, there could be an array of department managers indexed by department numbers. The values must be simple scalar values of the same data type. In TimesTen, for associative array binding (but not for use of associative arrays only within PL/SQL), the keys, or indexes, must be integers ( BINARY_INTEGER or PLS_INTEGER). This enables arrays of data to be passed efficiently between an application and the database.Īn associative array is a set of key-value pairs.

Using as sociative arrays from applicationsĪssociative arrays, formerly known as index-by tables or PL/SQL tables, are supported as IN, OUT, or IN OUT bind parameters in TimesTen PL/SQL, such as from an OCI, Pro*C/C++, or JDBC application. You can use collections to move data in and out of TimesTen tables using bulk SQL. (See "Using associative arrays from applications" below.) > DBMS_OUTPUT.PUT_LINE (TO_CHAR(staff(i)) ||Īny collections can be passed between PL/SQL subprograms as parameters, but in TimesTen only associative arrays can be passed between PL/SQL and applications written in other languages. > WHERE employees.employee_id = staff(i) > SELECT last_name, first_name INTO lname, fname FROM employees > TYPE staff_list IS TABLE OF employees.employee_id%TYPE This example declares collection type staff_list as a table of employee_id, then uses the collection type in a loop and in the WHERE clause of the SELECT statement. For more information, see Data Type Synonyms (Transact-SQL).Example 3-2 Using a PL/SQL collection type
#Sql data type for an icollections iso#
SQL Server provides data type synonyms for ISO compatibility. For more information, see Precision, Scale, and Length (Transact-SQL).

For more information about alias data types, see CREATE TYPE (Transact-SQL). Alias data types are based on the system-supplied data types. You can also define your own data types in Transact-SQL or the Microsoft. SQL Server supplies a set of system data types that define all the types of data that can be used with SQL Server. A data type is an attribute that specifies the type of data that the object can hold: integer data, character data, monetary data, date and time data, binary strings, and so on. In SQL Server, each column, local variable, expression, and parameter has a related data type. Applies to: SQL Server (all supported versions) Azure SQL Database Azure SQL Managed Instance Azure Synapse Analytics Analytics Platform System (PDW)
