Getting SQL Query column names as variable
Posted: Mon Nov 09, 2015 8:51 pm
Hi all, I am dealing with a DB2 table that has a large number of columns what would be nice to do is get a dump of the data from a table into either a CSV or an XML file with the column names included. Is there an easy way to do this.
If I cannot do that can I get the column names as collection of data so that the index of the collection matches its prospective value.
So,for instance --
${colName[3]} = 'Addr1'
${data[3]} = '90210 Mulholland Dr.'
So that if I do a SELECT * on the table and I can get a count of the fields it is a simple matter to do a data dump of the table.
If I cannot do that can I get the column names as collection of data so that the index of the collection matches its prospective value.
So,for instance --
${colName[3]} = 'Addr1'
${data[3]} = '90210 Mulholland Dr.'
So that if I do a SELECT * on the table and I can get a count of the fields it is a simple matter to do a data dump of the table.