How to get Constraints with OCI?
Date: Wed, 3 Aug 1994 19:45:33 GMT
Message-ID: <sjsCtz5Jx.E0J_at_netcom.com>
Can anyone help me. I need to retrieve integrity constraints from the oracle
database into a C program using OCI. I tried using the Data Dictionary
(Oracle v6) with the following select statement:
select B.table_name,B.column_name,B.position from all_constraints A, all_cons_columns B where A.table_name = 'xxxxxxx' and A.constraint_type = 'P' and A.constraint_name = B.constraint_name order by position;
This functioned to bring back the table,column and position of the primary key members into C program variables, but the query took too long. There must be a more direct an or faster way then by using these data dictionary views. Maybe there is a more efficient way to query them that I am not thinking of, any help will be greatly appreciated.
Also, I will also be querying in the foreign key and unique key constraints into other program variables, so maybe there is even a better way that will combine all of these into one select statement with several fetches that load the appropriate values into appropriate program variables on each fetch?
Thanks in advance
-- ------------------------------------------------------------------ Steve Schow | But you don't need to use the claw, if you sjs_at_netcom.com | pick the pear with the big paw paw......Received on Wed Aug 03 1994 - 21:45:33 CEST
(415) 354-4908 | Have I given you a clue......?
800-722-2007x4908 | - Baloo the Bear ------------------------------------------------------------------