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 8524141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:36:23+00:00 2026-06-11T07:36:23+00:00

as we know PK and FKs type must be same, the size CAN be

  • 0

as we know PK and FKs type must be same, the size CAN be different in Oracle

  1. find all the foreign keys,
  2. find all the PK them are referenced to
  3. compare the length
  4. use the PK’s length as standard if FK is short.

anyone got the script?

  • 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-06-11T07:36:25+00:00Added an answer on June 11, 2026 at 7:36 am
    SELECT cc.table_name,
           CC.COLUMN_NAME,
           TCF.DATA_TYPE || '(' || TCF.DATA_PRECISION || ',' || TCF.DATA_SCALE || ')' DTYPE1,
           rcc.table_name AS r_table_name,
           RCC.COLUMN_NAME AS R_COLUMN_NAME,
           TCP.DATA_TYPE || '(' || TCP.DATA_PRECISION || ',' || TCP.DATA_SCALE || ')' DTYPE2,
           cc.position
    FROM   user_constraints c
           JOIN user_cons_columns cc ON c.owner = cc.owner AND c.constraint_name = cc.constraint_name
           JOIN USER_CONS_COLUMNS RCC ON C.OWNER = RCC.OWNER AND C.R_CONSTRAINT_NAME = RCC.CONSTRAINT_NAME AND CC.POSITION = RCC.POSITION
           JOIN USER_TAB_COLS TCF ON TCF.TABLE_NAME = CC.TABLE_NAME AND TCF.COLUMN_NAME = CC.COLUMN_NAME
           JOIN USER_TAB_COLS TCP ON TCP.TABLE_NAME = RCC.TABLE_NAME AND TCP.COLUMN_NAME = RCC.COLUMN_NAME
    WHERE TCF.DATA_TYPE || '(' || TCF.DATA_PRECISION || ',' || TCF.DATA_SCALE || ')' != TCP.DATA_TYPE || '(' || TCP.DATA_PRECISION || ',' || TCP.DATA_SCALE || ')'
    ORDER BY c.constraint_name, cc.table_name, cc.position;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know you can use a javascript to do this <script type=text/javascript> touchMove =
Anyone know where I can find a C# implementation of eksblowfish crypt? Thanks
I know you can not set a key value dynamically, but what about the
Anyone know how I can make a login button in Ruby on Rails for
I know there are lots of tools on the net that can make our
I know I can add an element using javascript by: document.createElement('input'); But I want
I know that question has been repeatedly asked in different ways, but I tried
Anyone know how i can have a PHP file automatically loaded on the server.
I'm trying to use foreign keys properly to maintain data integrity. I'm not really
I know that this isn't exactly normalised, but bringing all of the localised data

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.