Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi experts,
what are the table functions? give me an example of each and every one.
Hi Mani,
Check this functions
The table functions return information about previously loaded data tables.
Returns the name of the field with the specified number within a previously loaded table.
If the function is used within a load statement, it must not reference the table currently being loaded.
Examples:
LET a = FieldName(4,'tab1');
T1:
Load a, b, c, d from abc.csv
T2:
Load FieldName (2, 'T1') Autogenerate 1;
FieldNumber('field ' ,'TableName')
Returns the number of a specified field within a previously loaded table.
If the function is used within a load statement, it must not reference the table currently being loaded.
Examples:
LET a = FieldNumber('Customer','tab1');
T1:
Load a, b, c, d from abc.csv
T2:
Load FieldNumber ('b', 'T1') Autogenerate 1;
Returns the number of fields in a previously loaded table.
Examples:
LET a = NoOfFields('tab1');
Load *, NoOfFields( ) from abc.csv;
Returns the number of rows (records) in a previously loaded table.
If the function is used within a load statement, it must not reference the table currently being loaded.
Examples:
LET a = NoOfRows('tab1');
Load * from abc.csv where NoOfRows( )<30;
Returns the number of tables previously loaded.
Returns the name of the table with the specified number.
If the function is used within a load statement, it must not reference the table currently being loaded.
Returns the number of the specified table.
If the function is used within a load statement, it must not reference the table currently being loaded.
Just to add:
Function | Syntax | Front End | Back End |
FieldName | str FieldName (field_number, table_name) | No | Yes |
FieldNumber | int FieldNumber (field_name, table_name) | No | Yes |
NoOfFields | int NoOfFields (table_name) | No | Yes |
NoOfRows | int NoOfRows (table_name) | Yes | Yes |