dvd420 Posted January 9, 2009 Share Posted January 9, 2009 Hi, I want to describe a table. oci_execute() is not taking "DESC[RIBE]" as a valid query. So, I am using the following code for it: But I am unable to detremine if a field is NULL or NOT NULL. oci_field_is_null() is returning FALSE always. function desc_table($conn, $tab) { $stid = oci_parse($conn, "SELECT * FROM $tab"); $r = oci_execute($stid, OCI_DEFAULT); if (!$r) { $e = oci_error($stid); print $e['message']; } else { $ncols = oci_num_fields($stid); for ($i = 1; $i <= $ncols; $i++) { $column_name = oci_field_name($stid, $i); $column_type = oci_field_type($stid, $i); $column_size = oci_field_size($stid, $i); $column_nvl = oci_field_is_null($stid, $i); // Print .... } } } Link to comment https://forums.phpfreaks.com/topic/140119-how-to-describe-a-table-oci/ Share on other sites More sharing options...
dvd420 Posted January 9, 2009 Author Share Posted January 9, 2009 I think oci_field_is_null() is used for a perticular value. Link to comment https://forums.phpfreaks.com/topic/140119-how-to-describe-a-table-oci/#findComment-733132 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.