Primary Key / Foreign Key relationship

Hi Folks,
I have a MASTER_TABLE which has master values . This table has two fields, STATUS & STATUS_TEXT,  Key field is STATUS.
This is a check table for another table INSTANCE_TABLE which also has field STATUS; this is not a key field though.
The requirement is: If I  attempt to delete a STATUS value from MASTER_TABLE, it should not allow me if there is any record in INSTANCE_TABLE which has the same STATUS value. Is there a way to establish such a relationship between the two tables?
Thank you for the help!
Sid

Hi Friend,
Only through table Maintaince only it can be acheived , by table relatio it can not be  .
because as you know the  non primary key cannot be be  check table field  .means
In Mater table STATUS is primary key so you are  making it as check table field to  Insance table  STATUS Field.
But  in Instance table is not a primary key so , without primary key you will not be able to  do the foriegn key relation to the master table ,so that  it will not be check table becs of that they check will not happen for your  scenario  . to acheieve this you need to either make your STATUS field in Instance table also as primary key and  do the foerign key relationship with  Master table  .
Or else  write an event in the table maintainance  .
Regards,

Similar Messages

  • Lack of Primary and Foreign Keys and Efficiency

    I am reverse engineering a Maximo database. I am shock that it does not have Primary or foreign keys define for 590 out of 620 tables.
    My question is does the lack of Primary and Foreign key relationships adversely impact the efficiency of an Oracle database? I think it does IBM techs do not think it does.
    Anyone has the answer?

    does the lack of Primary and Foreign key relationships adversely impact the efficiency of an Oracle database? Not necessarily. There are many large OLTP databases that do not define PKs and FKs.
    It is true that the presence of constraint defintions is used by the optimizer. However,
    what matters is how the application is written and how the optimizer handles it.
    Remember that Oracle Databases have been in production since before constraint definitions were introduced.
    Hemant K Chitale
    Edited by: Hemant K Chitale on Jun 9, 2010 10:05 AM

  • Can I create constraints "Primary key - Foreign key" on materialized views?

    Hello!
    Can I create constraints "Primary key - Foreign key" on materialized views like on tables?
    My purpose - is to make DB schema "COPY" with set of materialized views or tables, which take data from time to time from other tables situated.into another schema "ORIGINAL".
    Also - I want to use reporting tool, like Crystal Reports, to make nice reports from schema "COPY". To make nice reports, I need primary-foreign relationships between materialized views or tables in schema "COPY".
    Is it possible to use materialized views?
    Or I should use only tables to get such result?
    Thank you in advance.
    Edited by: kogotok1 on Dec 3, 2010 5:01 PM

    What happens when you try it? Or search the manuals.
    http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/statements_6002.htm#i2105365
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10706/repmview.htm#REPLN360

  • Basic doubt about Primary Key/Foreign Key in Oracle Tables

    Hi,
    I have a doubt whether Primary Keys/Foreign Keys are allowed in Oracle. Some of the people I know are telling me that Oracle does not encourage having Primary Keys/Foreign keys in its database tables.
    However if I go to the ETRM and look for information about some of the Oracle Tables, I am informed that Primary Keys do exist. However I am being told that ETRM is not a reliable way of having correct information about table structure.
    It would be great if any one of you provides me with some insight in this. Any pointers to a document would be great.
    Thanks

    It is not that PK/FKs are disallowed in Oracle Apps (there are some on the standard Oracle Apps tables), but they are typically not used. I am not positive what the logic behind this is, but my guess is that it was party due to the earlier versions of Oracle Apps pre-dating declarative database referential integrity in Oracle DB and also on performance issues with the standard referential integrity with the earlier versions of declarative database referential integrity.
    As far as eTRM is concerned - I understood that the data is based on a design repository rather than a physical Oracle Apps DB. So all of the information in there is logically correct, but not necessarily enforced via the standard Oracle DB declarative referential integrity (rather by the application code or APIs).

  • Basic doubt about Primary Keys/Foreign Keys in Oracle Tables

    Hi,
    I have a doubt whether Primary Keys/Foreign Keys are allowed in Oracle or not. I have been informed that Oracle does not encourage having Primary Keys/Foreign keys in its database tables. Instead it urges users to have unique constraints on the requisite columns.
    However if I go to the ETRM and look for information about some of the Oracle Tables, I am informed that Primary Keys do exist. At the same time, I am being told that ETRM is not a reliable way of having correct information about table structure (at least the Primary Key information).
    It would be nice if any one of you provides me with some insight in this. Any pointers to a document would be welcome.
    Thanks

    FYI,
    There is seprate forum for Core Sql quieries
    PL/SQL
    Thanks

  • PRIMARY KEY-FOREIGN KEY 관계 찾기(MASTER TABLE CONSTRAINT 정보 찾는 SQL)

    제품 : ORACLE SERVER
    작성날짜 : 2003-06-19
    PRIMARY KEY-FOREIGN KEY 관계 찾기
    =================================
    PURPOSE
    이 자료는 MASTER TABLE CONSTRAINT 정보를 찾는 SQL이다.
    Explanation
    SCOTT의 EMP table의 Foreign Key와 부모 제약 조건을 찾으려면
    다음의 질의문을 사용하여 찾을 수 있다.
    SQL> alter table dept add constraint dept_pk primary key (deptno);
    Table altered.
    SQL> alter table emp add constraint emp_dept_fk foreign key(deptno)
    references dept(deptno);
    Table altered.
    SQL> select c.constraint_name as "foreign key",
    p.constraint_name as "referenced key",
    p.constraint_type,
    p.owner,
    p.table_name
    from dba_constraints c, dba_constraints p
    where c.owner = 'SCOTT'
    and c.table_name = 'EMP'
    and c.constraint_type = 'R'
    and c.r_owner = p.owner
    and c.r_constraint_name = p.constraint_name;
    foreign key referenced key C OWNER TABLE_NAME
    EMP_DEPT_FK DEPT_PK P SCOTT DEPT
    Example
    none
    Reference Documents
    <Note:1010844.6>

    I don't have intimate knowledge of SQL Server, but to me, your code seems reasonable. I guess there is some "fine point" (a bug?) to using self referenceing foreign keys in SQL Server. It doesn't seem plausible that the error originates with the driver, unless it's a very intelligent kind of driver.
    A "Gordian Knot" kind of solution to your problem is to ask whether you really need the foreign key constraint in the db schema. Is the table used by something other than your EJB? Anyway, putting logic responsible for the correct functioning of your EJB into the db schema is often a bad practice, as it makes the code harder to understand, maintain, port etc.

  • Lost about 60-75% of my primary and foreign keys when Migrating from SQL Server 7

    Hi All,
    I did an almost successful migration between SQL Server 7.0 and Oracle9i.
    What happened:
    I seem to have lost my primary and foreign keys in the migration. The funny thing is when I viewed the constraints and indexes in Toad, they were there. However when I tried to enabled those constraints nothing happened.
    I really don't know how I can fixed this, but I don't understand why I didn't get a warning or an error message in the Migration Workbench (latest version).
    I did ignore the following errors, could that have anything to do with the keys being lost.
    Failed to create User:omwb_emulation; ORA-1920: user name "OMWB_EMULATION" conflicts with another user or role name
    Failed to create User:guest;ORA-01920: user name "GUEST" conflicts with another user or role name
    These users do not own any objects therefore I ignored them.
    Please advise
    Thanks

    Hi Joe,
    Not sure why you are able to see these objects and yet not able to enable them. Did you encounter any errors during the create Oracle Model phase?? Did you encounter any errors during the final Migrate phase?
    Also, it is really important to have a tablespace created before an attempt is made to create tables and indexes in the destination Oracle database.
    Regards
    John

  • Primary and Foreign Keys

    I've attempted to identify a primary and foreign key in these two tables, but I am getting a bunch of errors re duplicate keys and column names needing to be unique. Can someone explain to me what I am doing wrong? I have watched numerous tutorials. Perhaps
    the primary and foreign key I have identified don't meet the criteria?
    CREATE TABLE StockNames
    -- Added Primary key to [stock_symbol]
    [stock_symbol] VARCHAR(5) NOT NULL CONSTRAINT PK_stock_symbol PRIMARY KEY,
    [stock_name] VARCHAR(150) NOT NULL,
    [stock_exchange] VARCHAR(50) NOT NULL,
    GO
    stock_symbol stock_name stock_exchange
    AEA American External Accessories NYSE
    ASP All Sports Portal NYSE
    AIT Anthony Interest Technology NYSE
    ATV American Technology Vehicles NYSE
    ACM Anderson Charles and Mitchell NYSE
    ACH American Career Helpers NYSE
    AVA Alleviate America NYSE
    and the second table
    CREATE TABLE DailyPricesA (
    [stock_symbol] VARCHAR (5) NOT NULL CONSTRAINT FK_stocksymbol REFERENCES [StockNames]([stock_symbol]),
    [date] VARCHAR (15) NOT NULL,
    [stock_price_open] FLOAT (53) NOT NULL,
    [stock_price_high] FLOAT (53) NOT NULL,
    [stock_price_low] FLOAT (53) NOT NULL,
    [stock_price_close] FLOAT (53) NOT NULL,
    [stock_volume] INT NOT NULL,
    [stock_price_adj_close] FLOAT (53) NOT NULL,
    stock_exchange stock_symbol date stock_price_open stock_price_high stock_price_low stock_price_close stock_volume stock_price_adj_close
    NYSE AEA 8/02/2010 4.42 4.42 4.21 4.24 205500 4.24
    NYSE AEA 5/02/2010 4.42 4.54 4.22 4.41 194300 4.41
    NYSE AEA 4/02/2010 4.55 4.69 4.39 4.42 233800 4.42

    Hi Stan,
    I have removed "stock_exchange" - that removed that error. These are the other errors I am experiencing:Msg
    2714, Level 16, State 6, Line 8
    There is already an object named 'DailyPricesA' in the database.
    Msg 2714, Level 16, State 6, Line 36
    There is already an object named 'StockNames' in the database.
    Msg 2627, Level 14, State 1, Line 47
    Violation of PRIMARY KEY constraint 'PK__StockNam__117C59C768B2BB7F'. Cannot insert duplicate key in object 'dbo.StockNames'. The duplicate key value is (AA).
    The statement has been terminated.
    Msg 1913, Level 16, State 1, Line 54
    The operation failed because an index or statistics with name 'SNIndex' already exists on table 'DailyPricesA'.
    And the code:
    USE NYSEDatabaseProject
    -- Drop the table to clean up database.
    --DROP TABLE DailyPricesA
    --GO
    -- Create the table.
    CREATE TABLE DailyPricesA (
    [stock_symbol] VARCHAR (5) NOT NULL CONSTRAINT FK_stocksymbol REFERENCES [StockNames]([stock_symbol]),
    [date] VARCHAR (15) NOT NULL,
    [stock_price_open] FLOAT (53) NOT NULL,
    [stock_price_high] FLOAT (53) NOT NULL,
    [stock_price_low] FLOAT (53) NOT NULL,
    [stock_price_close] FLOAT (53) NOT NULL,
    [stock_volume] INT NOT NULL,
    [stock_price_adj_close] FLOAT (53) NOT NULL,
    -- Add a foreign key.
    -- [stock_symbol] VARCHAR (5) NOT NULL CONSTRAINT FK_stocksymbol REFERENCES [StockNames]([stock_symbol]),
    BULK INSERT DailyPricesA
    from 'C:\Users\fenwky\NYSE_daily_prices_A.csv'
    -- firstrow = 2 skips the header row, field terminator =',' deterines the separator, and rowterminator defines where the row ends
    with (firstrow = 2, fieldterminator = ',', rowterminator = '\n')
    GO
    -- Create an index named DPAIndex, for the columns stock_symbol//'DPAIndex' already exists on table 'DailyPricesA'
    --CREATE INDEX DPAIndex
    --ON DailyPricesA (stock_symbol);
    -- Drop the table to clean up database.
    -- DROP TABLE StockNames
    -- GO
    CREATE TABLE StockNames
    -- Added Primary key to [stock_symbol]
    [stock_symbol] VARCHAR(5) NOT NULL CONSTRAINT PK_stock_symbol PRIMARY KEY,
    [stock_name] VARCHAR(150) NOT NULL,
    [stock_exchange] VARCHAR(50) NOT NULL,
    GO
    -- Insert the CSV into the table named Stocknames
    BULK INSERT StockNames
    from 'C:\Users\fenwky\NYSE_stock_names.csv'
    -- firstrow = 2 skips the header row, field terminator =',' deterines the separator, and rowterminator defines where the row ends
    with (firstrow = 2, fieldterminator = ',', rowterminator = '\n')
    GO
    -- Create an index named SNIndex, for the columns stock_symbol and stock_exchange.
    CREATE INDEX SNIndex
    ON DailyPricesA (stock_symbol);
    -- Select all from DailyPricesA
    select * from StockNames

  • Primary key foreign key remove problem

    hi expretrs,
    I create 5 tables in ddic.
    1. zpr_cmp Company Master
    2. zpr_dpt Department Master
    3. zpr_dsg Designation Master
    4. zpr_emp Employee master.
    5. zpr_slm Salary Master.
    Foreign key reference in zpr_emp from table 1,2 and 3 created and
    table zpr_emp has
    cmpcd, Company Code
    empcd, Employee Code
    dptcd , Department Code
    dsgcd Designation Code
    as key fields.
    I have upload data and create module pool and reports.
    My problem that hr person say that we want to change deptcd/dsgcd of employee (zpr_emp) and
    dptcd and dsgcd is as key fields in zpr_emp when i change the table zpr_emp and remove
    two key fields dptcd/dsgcd and active error display.
    I also try with se14 (Activate and Adjust database) but error still.
    how can i remove key field from zpr_emp and active table without loss data and without any change of
    module pool/reports
    pl. help

    Diagnosis
    ZPR_EMP table is defined as a check table. For reasons of consistency, changes to the primary key of the table are not allowed.
    Procedure
    If it is essential that you change the primary key, you must delete the relevant foreign keys. Refer to the where-used list to find all tables containing a field that is checked against this table. Delete the foreign keys for these fields.
    If necessary, maintain the deleted foreign keys again.
    Value table - It's a field in a domain it helps in domain level data validation.
    Check table - unlike value table it helps in feild level data validation.
    The relational data model contains not only tables, but also relationships between tables. These relationships are defined in the ABAP/4 Dictionary by foreign keys. An important function of foreign keys is to support data integrity in the relational data model. Foreign key fields may assume only those values allowed by the check table, in other words, values occurring in the primary key of the check table.
    A foreign key provides a link between two tables, for eg.,T1 and T2 by including a reference in table T1 to the primary key of table T2. For this purpose, Foreign key fields assigned to the primary key fields of T2 are included in T1. Table T1, which is the one being checked, is called a foreign key table, and table T2 is called a check table. The terms dependent (foreign key) table and referenced (check) table are also used.
    VALUE TABLE:If the domain of the check field has a value table, this is proposed by the system as check table in the foreign field maintenance. The key fields of the value table are in this case assigned fields of the foreign key table with the same domain. These fields may assume only those values allowed by the value table.
    The value range of the domain can be defined by specifying value table.All table fields referring to this domain can then be checked against the corresponding field of this value table.In order the check can be executed, a foreign key must be defined for the value table.

  • Primary key foreign key dependencies

    hi gems...
    I have a table with composite primary key (COL1, COL2)..
    create table TABLE1 (COL1, COL2);
    alter table TABLE1 add constraint PK_TABLE1 primary key (COL1, COL2);
    Now i am trying to make another table which will refer to the COL1 of the first table.
    create table TABLE2 (COL3, COL4);
    alter table TABLE2 add constarint FK_TABLE2 (COL3) references TABLE1(COL1);
    but it is failing with "no matching unique or primary key" error.

    You have created a composite primary key, so there must be composite foreign key that references the composite primary key. You cannot create Foreign key that references to single column of the composite primary key.

  • Oracle 9i primary and foreign key constraint

    I had created table in the following way
    create table dept(deptno number,dname varchar2(20));
    create table emp(empno number primary key,ename varchar2(25), deptno number references dept(deptno));
    One can get constraint name and constraint type from user_constraints table. But I want to know name of the column of table from which column is used as foreign key in another table. How to get such information?

    SQL> Select *From user_cons_columns  A
      2   Where Constraint_Name In (Select r_Constraint_Name
      3                           From User_Constraints B
      4        Where Table_Name='EMP'
      5          And Constraint_Type='R'
      6          Group By r_Constraint_Name
      7          )
      8  /
    OWNER                          CONSTRAINT_NAME                TABLE_NAME                     COLUMN_NAME                       
    SCOTT                          PK_DEPTNO                      DEPT                           DEPTNO                             Edited by: babaravi on Oct 5, 2009 3:34 PM

  • [JPA] Primary key = Foreign key = Failure.

    Hello:
    I've a question regarding the Java Persistence API and a DB design which I'm facing just now. I'm making JPA entities based on a DB schema which is already created. Although sometimes it's not a good idea, I'm going to use a simplified example so you can understand it easily and help me (if you want, of course).
    Let's suppose that I've a table of discs (called "disc", built into a class as "Disc.class") and another one of used discs (called "disc_used", built as "DiscUsed.class"). The first one employs a composite key formed by columns "key1" and "key2". The second one employs the same primary key (conceptually, not physically) which, at the same time, is foreign key respect to the first table.
    I've used the @EmbeddedId annotation on the first case and built a class for the composite key (called "DiscPK.class"). I've done the same task for the second table (calling it "DiscUsedPK.class"). I also have added the corresponding mappings between both classes (of type @OneToOne). This design pattern works fine when employing "Disc.class", but not "DiscUsed.class". I've came to the conclusion that it's because of using the same fields to make an @EmbeddedId and map the @OneToOne relation.
    I've been taking a deep look to the possible annotations which JPA offers, but I've not found anything useful.
    In the past I faced another problem with JPA and composite keys, which made me come to the conclusion that it was my DB design what was faulty (I was combining an auto-numerical field with others to make a composite key, which helped me to understand the logic but was absurd and against the relational logic). May it be a similar misconception on the DB design? I mean, since both tables represent different concepts (discs and used discs), each one with their own attributes (columns), Should the second table use its own auto-numerical primary key instead of re-use the foreign key? Would it be the right approach according to the relational logic?
    Obviously, modifying the original DB by hand and adding its own primary key, it works flawless. However I still need to know the truth (other-way I won't be able to sleep :P ).
    Thank you for your help and interest.

    gimbal2: I'm really sorry, but I didn't get any e-mail notification about your message :S . After having looked for help on several places on the Internet I finally decided not to employ exactly the same columns for a primary key if they were already being employed by a foreign key. The answer from javaUserMuser has also left this matter clarified to me. Thanks for your time also ;) .
    javaUserMuser: I thought that was a problem from my implementation. If it's a common case, then I guess that I did right choosing the easy "path" for one time :) . I agree with you, it's a big frustration. But since I depend on the JPA for my projects, I'll try to set my mind to avoid always this match and employ another primary key instead. Thank you a lot for your explanation :D .

  • Mapping in OWB with primary key and foreign key relationship

    Hi all,
    I am new to this datawarehousing field. I have just started my career. I have to now create a mapping in owb where a table has a field which is a primary key of another table in the same staging area. If you guys could help me out with the a method it can be created that would be very helpful to me.
    I thought of 2 ideas,
    1. If I can use a look up, but then I am not sure if i can use a lookup for primary key, foreign key relationship. If I can use also, I do not know how to use that.
    2. What if I can directly take that the first table and link the primary key of that table to the second table which uses that primary key of the first table as one of its fields.
    I do not know how feasible these methods are. Please guys help me out.
    Thanks in advance.

    I have a similar case where table a and table b having relation but table a got inserted with data and table b is empty so there no values for foriegn key column in table b to realte with table a.
    Now i want to load table b foriegn key with primary key column values of table a.
    how can we do this in owb
    thanks
    kumar

  • Primary key and Foreign key on same column

    Hi, I am able to create below tables , primary and foreign keys as below.
    But Is this valid design? Can I define a column (ckey2 in table "child") as
    primary key and as well as foreign key?
    CREATE TABLE parent (
    col1 NUMBER,
    col2 NUMBER
    CREATE TABLE child (
    ckey1 NUMBER,
    ckey2 NUMBER,
    ckey3 NUMBER
    alter table parent add constraint parent_pk primary key( col1 );
    alter table child add constraint child_pk primary key( ckey2 );
    alter table child add constraint child_fk foreign key( ckey2 ) references parent( col1);
    Thanks.

    Can I define a column (ckey2 in table "child") as primary key and as well as foreign key?You mean you want to define a one-to-one relationship between parent and child tables.. why would you want to do that ? You might as well merge the 2 tables into one.

  • TIPS(9):PARENT-CHILD(FOREIGN KEY) 관계를 갖는 MASTER TABLE의 PRIMARY KEY 확인.

    제품 : SQL*PLUS
    작성날짜 : 1996-10-21
    TIPS(9) : PARENT-CHILD관계를 갖는 TABLE의
    PRIMARY key, FOREIGN key의 COLUMN 명과 POSITION 확인
    ==============================================================
    ** Name : Show_Position.Sql
    ** Usage : @Show_Positions Parent_Table Child_Table
    ** Description : Shows Primary And Foreign Key Positions
    ** WARNING : 이 문장은 해당 Table의 Constraint생성시 Naming
    ** Convention을 따른 경우에 적용되도록 되어 있다.
    SET VERIFY OFF
    CLEAR BREAK
    BREAK ON CONSTRAINT_NAME ON TABLES
    SELECT SUBSTR(CONSTRAINT_NAME,1,27) CONSTRAINT_NAME,
    SUBSTR(TABLE_NAME,1,15) TABLES,
    SUBSTR(COLUMN_NAME,1,15) COL_NAME,
    SUBSTR(POSITION,1,3) POSITION,
    SUBSTR(OWNER,1,7) OWNER
    FROM USER_CONS_COLUMNS
    WHERE TABLE_NAME = UPPER('&1')
    AND CONSTRAINT_NAME LIKE 'PK%'
    UNION
    SELECT SUBSTR(CONSTRAINT_NAME,1,27) CONSTRAINT_NAME,
    SUBSTR(TABLE_NAME,1,15) TABLES,
    SUBSTR(COLUMN_NAME,1,25) COL_NAME,
    SUBSTR(POSITION,1,3) POSITION,
    SUBSTR(OWNER,1,7) OWNER
    FROM USER_CONS_COLUMNS
    WHERE TABLE_NAME = UPPER('&2')
    AND CONSTRAINT_NAME LIKE 'FK%'
    ORDER BY 1 DESC , 4 ASC;
    < 실행 예 >
    SQL> @SHOW_POSITIONS EMP_SERVICE EMP_SERVICE_LOG
    CONSTRAINT_NAME TABLES COL_NAME POS
    PK_EMP_SERVICE EMP_SERVICE EMP_ID 1
    CUST_ID 2
    FK_EMP_SERVICE_LOG_EC EMP_SERVICE_LOG EMP_ID 1
    CUST_ID 2

    제품 : SQL*PLUS
    작성날짜 : 1996-10-21
    TIPS(9) : PARENT-CHILD관계를 갖는 TABLE의
    PRIMARY key, FOREIGN key의 COLUMN 명과 POSITION 확인
    ==============================================================
    ** Name : Show_Position.Sql
    ** Usage : @Show_Positions Parent_Table Child_Table
    ** Description : Shows Primary And Foreign Key Positions
    ** WARNING : 이 문장은 해당 Table의 Constraint생성시 Naming
    ** Convention을 따른 경우에 적용되도록 되어 있다.
    SET VERIFY OFF
    CLEAR BREAK
    BREAK ON CONSTRAINT_NAME ON TABLES
    SELECT SUBSTR(CONSTRAINT_NAME,1,27) CONSTRAINT_NAME,
    SUBSTR(TABLE_NAME,1,15) TABLES,
    SUBSTR(COLUMN_NAME,1,15) COL_NAME,
    SUBSTR(POSITION,1,3) POSITION,
    SUBSTR(OWNER,1,7) OWNER
    FROM USER_CONS_COLUMNS
    WHERE TABLE_NAME = UPPER('&1')
    AND CONSTRAINT_NAME LIKE 'PK%'
    UNION
    SELECT SUBSTR(CONSTRAINT_NAME,1,27) CONSTRAINT_NAME,
    SUBSTR(TABLE_NAME,1,15) TABLES,
    SUBSTR(COLUMN_NAME,1,25) COL_NAME,
    SUBSTR(POSITION,1,3) POSITION,
    SUBSTR(OWNER,1,7) OWNER
    FROM USER_CONS_COLUMNS
    WHERE TABLE_NAME = UPPER('&2')
    AND CONSTRAINT_NAME LIKE 'FK%'
    ORDER BY 1 DESC , 4 ASC;
    < 실행 예 >
    SQL> @SHOW_POSITIONS EMP_SERVICE EMP_SERVICE_LOG
    CONSTRAINT_NAME TABLES COL_NAME POS
    PK_EMP_SERVICE EMP_SERVICE EMP_ID 1
    CUST_ID 2
    FK_EMP_SERVICE_LOG_EC EMP_SERVICE_LOG EMP_ID 1
    CUST_ID 2

Maybe you are looking for