Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I was wondering if there is a way to export the list of fields from a Table in the script. I know I could go use a Table Object with dimension $Field and export it, but I was wondering if there is a way to do this directly from the load script?
Thanks,
Mark
The script found here creates the table I am looking for which I can then store. Fast way to get all table and field names from an app
//Iterate through the loaded tables
For t = 0 to NoOfTables() - 1
//Iterate through the fields of table
For f = 1 to NoOfFields(TableName($(t)))
Tables:
Load
TableName($(t)) as Table,
TableNumber(TableName($(t))) as TableNo,
NoOfRows(TableName($(t))) as TableRows,
FieldName($(f),TableName($(t))) as Field,
FieldNumber(FieldName($(f),TableName($(t))),TableName($(t))) as FieldNo
Autogenerate 1;
Next f
Next t;
Sure this will store all of the fields and their values into a QVD,CSV,TXT file but I am wondering if anyone knows a way to export just the list of fields from a table. I am currently using the below script to store a list of all the field names as a variable but am getting stuck on how to get them into a table to export.
Let i = 0;
For i = 0 to NoOfFields('Test')
Let vField$(i)= FieldName(i,'Test');
Next i;
The script found here creates the table I am looking for which I can then store. Fast way to get all table and field names from an app
//Iterate through the loaded tables
For t = 0 to NoOfTables() - 1
//Iterate through the fields of table
For f = 1 to NoOfFields(TableName($(t)))
Tables:
Load
TableName($(t)) as Table,
TableNumber(TableName($(t))) as TableNo,
NoOfRows(TableName($(t))) as TableRows,
FieldName($(f),TableName($(t))) as Field,
FieldNumber(FieldName($(f),TableName($(t))),TableName($(t))) as FieldNo
Autogenerate 1;
Next f
Next t;