Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4042270
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T12:59:04+00:00 2026-05-20T12:59:04+00:00

I am trying to extract some meta data from Oracle about foreign keys. I

  • 0

I am trying to extract some meta data from Oracle about foreign keys. I am using the “all_constraints” to find all referential constraints information and “all_cons_columns” to find the actual columns. However, I can’t get the order of my columns in the foreign key.

Below are 4 example tables all with 3 columns. 3 of the tables reference the table “tab_d”, but the order of the columns in the foreign key differs. This order is not reflected in the “all_cons_columns” view, so is there another place where this information is available?

create table tab_d (
    col_a int,
    col_b int,
    col_c int,
    constraint tab_d_pk primary key (col_a, col_b, col_c)
);

create table tab_e (
    ref_col_a int,
    ref_col_b int,
    ref_col_c int,
    constraint tab_e_fk foreign key (ref_col_b, ref_col_c, ref_col_a)
        references tab_d(col_b, col_c, col_a)
);

create table tab_f (
    ref_col_a int,
    ref_col_b int,
    ref_col_c int,
    constraint tab_f_fk foreign key (ref_col_b, ref_col_c, ref_col_a)
        references tab_d(col_c, col_a, col_b)
);

create table tab_g (
    ref_col_a int,
    ref_col_b int,
    ref_col_c int,
    constraint tab_g_fk foreign key (ref_col_c, ref_col_b, ref_col_a)
        references tab_d(col_c, col_b, col_a)
);

The information i get from “all_cons_columns” is shown below and e.g. I my table “tab_g” where I thought position show the column order ref_col_c = 1, ref_col_b = 2 and ref_col_a = 3 it shows what order the column is in the primary key.

CONSTRAINT_NAME TABLE_NAME  COLUMN_NAME  POSITION
TAB_F_FK           TAB_F       REF_COL_A    2
TAB_F_FK           TAB_F       REF_COL_B    3
TAB_F_FK           TAB_F       REF_COL_C    1
TAB_E_FK           TAB_E       REF_COL_A    1
TAB_E_FK           TAB_E       REF_COL_B    2
TAB_E_FK           TAB_E       REF_COL_C    3
TAB_G_FK           TAB_G       REF_COL_A    1
TAB_G_FK           TAB_G       REF_COL_B    2
TAB_G_FK           TAB_G       REF_COL_C    3
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T12:59:05+00:00Added an answer on May 20, 2026 at 12:59 pm

    The order of the columns is reflected in the ALL_CONS_COLUMNS view – by the column called POSITION.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to extract some data from various HTML pages using a python program.
I am trying to extract some data from a website using a LINQ statement,
I am trying to extract some data from XML but when I execute the
I'm trying to extract data from a data file that's tab-delimited (in some parts),
I am trying to extract some data from a private forum. I created a
I'm trying to write a code to extract some form data from a HTML
I'm trying to extract all matches from a EBML definition, which is something like
I am trying to find a way to extract information about my tables in
I am trying to extract some parts of the Video: line from below text.
I am trying to extract some words from a string. The two cases look

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.