If you're using mysql try a 'DESCRIBE TABLE' query first.
If not mysql find a similar command in your database and use that first, Once you have the name and position of the column names you can do what you want with them While associating them to the data in the subsequent select statement quite easily. I usually accomplish this by putting my describe statement results in has that has an index number and Column name and using the index nuumber of the select results to associate them however I need. Dan > > > > Thanks Dave > But i made the mistake of caling it a table but actually it > is a view and table_info ethod does not work for that. Also i > tried to run table_info for a table but it does not return > the column names. > There is a column info method for tables to do this. But it > does not work for views. Please help manisha > > Dave K <[EMAIL PROTECTED]> wrote: > Manisha > Hello > Hi > I am working with Perl CGi. There is a query where i have to > select all columns in a table and display the data on the web > page. the query is something like "select * from > But the problem is I am not able to get the column names. > I am using the DBI module. Is there a way to get column > names? I read the responses from Dan, Timothy and Brian, and > they all have sound advice. If you would like to see another > approach you can visit: http://www.geocities.com/k2001evad/pindex.html > and cut and paste scripts for Oracle, MySql and Postgres DBMS > that demonstrate another (not nessecarily better) way to get > meta data from those RDBMs. If your driver supports the > table_info method that may be the most direct way to get to > the column names. Check the DBI docs for more information. HTH > > > > > --------------------------------- > Do you Yahoo!? > Yahoo! Tax Center - forms, calculators, tips, and more >
