HomeMogDBMogDB StackUqbar
v5.0

Documentation:v5.0

Supported Versions:

Other Versions:

Support table()

Availability

This feature is available since MogDB 5.0.0.

Introduction

table function is used to the collection of multiple columns of the type of table data to return to the results, such as querying the same as the ordinary table query the result of the return of the set.

Benefits

Enhance MogDB compatibility with Oracle to reduce application migration costs.

Constraints

  • table function returns the field, if it is a single column, there is no type of field name, then the query result of the field name is COLUMN_VALUE

Syntax Description

SELECT * FROM TABLE(array['a','b']);
DECLARE
BEGIN
FOR rec IN (SELECT * FROM TABLE(xxx)) LOOP
...
END LOOP;
END;

Example

SELECT * FROM TABLE( array[ 1, 2, 3]);
 column_value 
--------------
            1
            2
            3
( 3 rows)

SELECT TABLE( array[ 1, 2, 3, null, 4, null, null, 5, 6]);
 column_value 
--------------
            1
            2
            3
             
            4
             
             
            5
            6
( 9 rows)
Copyright © 2011-2024 www.enmotech.com All rights reserved.