retrieving foreigh key constraints automatically

  • Thread starter Thread starter user100
  • Start date Start date
U

user100

Hi experts,

If I'm using .net framework data provider for Oracle (oracleclient),
and
I would like to be able to retrieve all foreign key constraint
information, for
a table, how can I do that.

I can't add DataRelation first, because I won't know the specific
relations
of this table. It could be any table out of database of about a
hundred tables.

Do we have such a mechanism in .net, thats capable of pulling the
constaint information straight out of database, without explicitly
setting DataRelation first? (Like if i have a non-key column in a
particular table, i'd like to know if it's linked to the other table,
the other table's name and linking column, stuff like that. Basically,
foreigh key information).

FillSchema won't provide that.It gives the primary key info, but not
the
foreign key info for non-key columns.

Please advice on how to achieve that. I haven't been able to find
anything
yet.

thanks in advance,
user100
 
Hi,

You'll have to query the Oracle directly.
Try select * from sys.all_constraint.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top