This article will cover the syntax of the ‘SQLColumns’ regular script statement

This statement is used to get fields with information about database columns.

Statement syntax

SQLcolumnsThis is the whole command, there isn’t any additional input required. The command must be placed after a valid database connection has been made.

Example

The statement is used to return information about a postgreSQL database. The results are filtered down to specific information about a single table’s columns. 

LIB CONNECT TO 'Public:PostgreSQL_public';
DATA:
Load *;
SQLColumns;
ITEM_DETAILS_INFO:
Load
	TABLE_NAME, 
    COLUMN_NAME, 
    DATA_TYPE, 
    TYPE_NAME
RESIDENT DATA
WHERE TABLE_NAME = 'item_details';
DROP TABLE DATA;

Result

The data is loaded into a table ‘ITEM_DETAILS_INFO’.