note 25288 deleted from function.ocicolumnname by didou
| From: | didou@php.net | Date: | Mon, 11 Aug 2003 21:23:36 +0000 |
| Subject: | note 25288 deleted from function.ocicolumnname by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-53913@lists.php.net to get a copy of this message | ||
Note Submitter:
----
As an former MySQL user, I used to use the keyword DESC in a query to get the fieldnames. DESC works
in SQL*Plus but not in standard Oracle SQL which is what is used in the OCI.
My worry was that trying to get column names with a SELECT statement would cause problems if the
table was empty and no results were returned. I tried it though and it is *NOT* a problem. Whether
rows are returned or not from your query, you can get the column names using OCIColumnName.
Just thought I'd point that out in case anyone else was about to spend a few minutes puzzling
over that.
Editor's Note:
........................
There is no need for DESCRIBing tables in Oracle. You can simply do a SELECT * FROM user_tables
WHERE table_name = 'table_name'; to get all the info relative to your tables.