tags:

views:

506

answers:

2

I'm optimising a bespoke database layer in a messaging system to increase performance.

I'm using the ORACLE OCI OCIDescribeAny function to get meta-data about the columns in a database table.

How do I check the meta-data using an OCI call to see if a column has a default value set (in its schema definition).

+1  A: 

You can find it in all_tab_columns or user_tab_columns because there you can find the column definitions.

tuinstoel
Thanks for the suggestion, however I'm looking for an OCI call to get the default status from the OCI data structures.I don't want to have to do an additional select on those tables to get the value for each column.
David
What is so bad about this additional select?
tuinstoel
I don't want the additional perfomance hit of doing another select on the database.
David
You only have to select it once. 'Cache' it in your client.
tuinstoel
+2  A: 

It seems you can't with the current API.

The Column Attributes section of the Call Interface Programmer's Guide has no reference to it.

The same question was also asked on OTN and the only reply was pointing out *_TAB_COLUMNS.

Alkini
Thanks for the answer Alan and the link to the Oracle forum.
David