CREATE_TABLE_FROM_MATRIX

This procedure creates a user-visible table from a matrix.

Usage

The CREATE_TABLE_FROM_MATRIX stored procedure has the following syntax:
CREATE_TABLE_FROM_MATRIX(mat_name,destination_table)
Parameters
mat_name
The name of the matrix to be copied.
Type: NVARCHAR(ANY)
destination_table
The name of the table to be generated.
Type: NVARCHAR(ANY)
Returns
BOOLEAN TRUE, if successful.

Details

This procedure creates a table, owned by the caller, having the following schema: (row INTEGER, col INTEGER, value DOUBLE PRECISION). The created table contains the matrix data in a row/column/value representation. This hides the implementation details of NZMatrix and provides data to the user via a table representation. This procedure exports all cells of the matrix.

Examples

CALL nzm..shape('1,2,3,4,5,6,7,8,9',3,3,'A'); 
CALL nzm..create_table_from_matrix('A', 'B'); 
select * from B order by row,col; 
CALL nzm..delete_matrix('A' );
drop table B;

 SHAPE
-------
 t
(1 row)

 CREATE_TABLE_FROM_MATRIX
--------------------------
 t
(1 row)

 ROW | COL | VALUE
-----+-----+------- 
   1 |   1 |     1
   1 |   2 |     2
   1 |   3 |     3
   2 |   1 |     4
   2 |   2 |     5 
   2 |   3 |     6
   3 |   1 |     7
   3 |   2 |     8
   3 |   3 |     9
(9 rows)

 DELETE_MATRIX
---------------
 t
(1row)