Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi community,
I am sure there is a way, but can someone let me know if I would like to get a list of field name of a table in a load script, how would l do that? For example, I have a resident table TABLE_A, and I would like to query all of its fields, and store it in another resident table.
Thank you.
This will work for a table named "Customers"
FOR i = 1 to NoOfFields('Customers')
Fields:
LOAD
FieldName($(i),'Customers') as FieldName
AutoGenerate 1
;
NEXT i
-Rob
Like this, using '*' ?
Tab2:
Load * resident TABLE_A;
Table1:
load * from Table1;
Table2:
load * resident Table1;
store Table2 into D:\Table2.qvd (qvd);
Drop table Table1;
I think this just loads Table_A into Tab2. What I need is, suppose TABLE_A has 50 columns ('COL1',...,'COL50'), I would like to create a table with 1 column and 50 rows where row1 = 'COL1', row2 = 'COL2' and so forth.
hi
try to use Crosstable concept
I used crosstable which somewhat works, but just wondering if there is a function or another way to get the list of fields.
hi
try according to this
Crosstable(NewCol, value)
load
Rowno() as key,
Col1,
Col2,
Col3,
..
..
..
Col50
Resident tablename;
Have you tried transposing the fields?
Hi there,
I am sure what you mean by "transposing the fields"? Are you referring to Crosstable functionality?
Hi Shyamal,
sorry, I meant "not sure". Typo.