note 25288 modified in function.ocicolumnname by maxim

From: Date: Fri, 16 May 2003 01:19:58 +0000
Subject: note 25288 modified in function.ocicolumnname by maxim
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-48073@lists.php.net to get a copy of this message
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. --was-- 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. http://www.php.net/manual/en/function.ocicolumnname.php

« previous php.notes (#48073) next »