Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle relations via ODBC / ORA OLE DB Provider

Re: Oracle relations via ODBC / ORA OLE DB Provider

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Tue, 03 Feb 2004 07:41:45 -0800
Message-ID: <1075822846.914075@yasure>


Jochen Rieseberg wrote:
> Hello all!
>
> i have to read out from MS Access / Visual Basic all tables, fields and
> relations of a big Oracle database using ADOX and the Oracle OLE DB
> Provider. No problem with tables and fields so far, but i do not know how to
> get the relations / foreign table / foreignkey. Can anybody help me??
>
> Jochen Rieseberg
> www.rieseberg.de

SELECT t.owner CHILD_OWNER,

t.table_name CHILD_TABLE,
t.constraint_name FOREIGN_KEY_NAME,
r.owner PARENT_OWNER,
r.table_name PARENT_TABLE,
r.constraint_name PARENT_CONSTRAINT

FROM user_constraints t, user_constraints r WHERE t.r_constraint_name = r.constraint_name
AND t.r_owner = r.owner
AND t.constraint_type='R'
AND t.table_name = <child_table_name>;

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Tue Feb 03 2004 - 09:41:45 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US