FOREING KEY URGENT

Hello.
I create a view to unite two tables, I want to know if the primary key of the view can index it as foreing key in another table to create a relationship master -details.
I thank the collaboration that you can lend me

At data base level you cannot do that.
But in the form you can create a master/detail relation ship.

Similar Messages

  • Create Foreing Key to one table in different dataBase

    Hi, I need create a reference to one table in other database. I understand that Database Link can be used to connect me to other database but when I am creating the foreing key in my table, I can see only the tables in the schemas that have my data base not the other schemas. I created a connection with database link but I do not see the form to make reference to this connection from the create table wizard. I am using Oracle 9i and the client is 9.01.01.
    Thanks in advance,
    Mónica Alarcón

    We cannot use tables in another table to enforce data integrity. This makes a lot of sense if you think about what would happen if the remote database goes down.
    If you want to do this, then you need to use replication (materilaized view) to bring the parent table's data into the locaL database.
    Cheers, APC

  • REFs vs. Foreing Key.

    Hi,
    I am new in ORACLE Objects technology.
    In my database i have two tables and i want to connect them. I usually use the primary-foreing key concept.
    I want to know if REF has best perfomance than foreing key? or the only advantage is the deref functionality of SQL?
    Does somebody know something about it?
    Thanks
    Fernando Fiszman

    I'll disagree with that.
    A REF is very much like a foreign key. The REF is more flexible because a REF of a particular type is not limited to pointing to exactly one table as a FK is. But a FK is more stabile because it's validity is guaranteed, whereas a REF can dangle. The impact of this is that the REF will support a wider variety of modelling scenarios, but may suffer from integrity problems unless you SCOPE the REF, in which case it is very much like an FK as it must point to exactly one table.
    The REF is a pointer who's VALUE is hidden from the user, which violates Codd's information principle. This will be an issue during replication and data migration. De-referencing REFs is very much like the 'pointer chasing' that was so prevalent in pre-relational databases. The relational equivalent of 'de-referencing a REF' is joining a foreign key to it's associated primary key and returning the row of the parent table.
    Anyway, while I guess it is true that an FK and a REF are different beasts, they are very similar, and it is not incorrect to view them as related.
    Chris

  • Insufficient privileges in Foreing Key

    I created a table in user2 schema (Oracle 8.1.5)
    Create table test (company number(2));
    Then i try to add a foreing key
    ALTER TABLE test
    ADD ( FOREIGN KEY (company)
    REFERENCES otheruser.COMPANY);
    I always get the ORA-01031 error (insufficient privileges)
    user2 is DBA and otheruser too. I tried all the grant options...
    Can anyone give me a detail script...
    Thanks.
    Antonio

    I think you are not having alter any table privilege, Any how
    here is the syntax:
    Alter table test add constraint fk_test foreign key(company)
    references otheruser.table_name(col_name);
    Regards,
    G. Rajakumar.

  • Foreing key between schemas

    I'm trying to create a foreing key constraint, between tables in diferents schemas. but i get ora-01031 insufficient privileges error, which is the system privilege that i need?

    At data base level you cannot do that.
    But in the form you can create a master/detail relation ship.

  • Change account assignment for posting key-urgent

    Dear expert,
    please advice, when running mb30, in accounting doc for material xxx we want to change account for posting key 91 with other account since the old one is blocked.How to change this account assignment then?
    Thank you

    Hi
    I am not sure whether MB30 Tcode exist. anyways, if you are sure of the Movement type with which your document is getting posted, then you can get the details of the Transaction in the OMWN. In OMWN please select the Movement type and you will see all the Tr Keys.
    Or you can get into OMWB and select Simulation. Give the material, plant and movemnet type and then select the account assignments you will have all the information.
    Regards
    Nambi

  • Foring Key Columns

    After usage of Database Design Transformer I've accept Server Model Diagramm without FK Columns. All FK and relation in ER is OK.
    When I've generate DDL scripts for tables I have not seen this columns eather.
    Whats wrong (excluding my english :))?

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Gints Plivna ([email protected]):
    A little bit didn't understand
    1. If You haven't FK columns and Foreign Keys on tables You cannot generate tables with them :)
    2. If You have these columns and keys then check options -> general options -> database -> "generate integrity constraints" and "foreign key generation requires join table" assuming you are using Design Editor 6.xxx
    <HR></BLOCKQUOTE>
    Thank You for help, but problem occured when'
    I use Transformer. I try to solve it by Your advise, but it only possible if Database Design Transformer uses Design Editor Preferences.
    I did not generate tables I've jult look through DDL scripts and have not found any FK columns.
    The main problem is 'I have not ANY FK columns in my Server Model Diagramm'
    Thanks & Regards
    Viktor
    null

  • Foreing key 와 Primary key 비교해서 결과 추출

    안녕하세요
    참조 하고 있는 테이블을 비교하고 싶어서요.
    A테이블의 . pk 컬럼과 B테이블의 fk. 컬럼이 서로 부모,자식으로
    연결되었다고 가정하면 두 테이블을 비교해서 다른 컬럼(즉 Foreign key이 깨진것)
    을 확인하고 싶어요.....간단하면서 막상 할려니 머리를 헤매네요...
    ( FILES.filesid 와 ITEM.itemsno)를 조인해서 한쪽에 없는 값을
    리스트로 출력할려구요..
    글 수정:
    user541094

    원래 포럼에 너무 제가 글을 많이 써서 자제를 하려고 했는데..
    temp관련해서 스크립트를 실수해서 글 수정하다가..
    답변드립니다.
    부모자식관계는 아래와 같이 확인하시면 됩니다.
    dept테이블의 deptno 컬럼을 pk로 하고, emp테이블에서 dept의 deptno 컬럼을 reference해서 사용합니다.
    즉 부모가 dept 테이블 이고 자식이 emp 테이블
    ### dept(deptno가 pk) -< emp(deptno가 fk)
    SQL> alter table dept add constraints pk_deptno primary key (deptno);
    Table altered.
    Elapsed: 00:00:00.40
    SQL> alter table emp add constraints fk_deptno
    2 foreign key (deptno)
    3 references dept
    4 /
    ## fk_const_to.sql
    DOC
    file: fk_const.sql
    자신의 테이블에서 다른 테이블의 pk를 받아서 FK가 되는 경우,
    자식을 넣으면 부모가 출력
    dept(deptno가 pk) -< emp(deptno가 fk) 일 경우 emp를 넣으면
    dept 테이블 출력
    set line 132
    col owner format a10 heading 'Pk_owner'
    column table_name format a15 heading 'Pk_table'
    column const_name format a15 heading 'Pk_const'
    column referencing_table format a25 heading 'Ref_Table'
    column referencing_table format a15 heading 'Fk_Table'
    column foreign_const format a15 heading 'Fk_Const'
    column fk_status format a8 heading 'Fk_Status'
    column key_column format a8 heading 'Key_col'
    column validated format a8 trunc
    column DEFERRED format a8 trunc
    column DEFERRABLE format a8 trunc
    select a.owner,
    a.table_name,
    a.constraint_name const_name,
    b.table_name referencing_table,
    b.constraint_name foreign_const,
    c.column_name key_column,
    b.status fk_status,
    b.validated ,
    b.deferred,
    b.deferrable
    from dba_constraints a, dba_constraints b, all_cons_columns c
    where
    a.owner=b.owner and a.owner=c.owner
    and a.constraint_name= c.constraint_name
    and a.constraint_name = b.r_constraint_name
    and b.table_name = upper('&table_name')
    and b.constraint_type = 'R'
    and a.owner not in ('SYS','SYSTEM','OUTLN','PERFSTAT')
    order by 1,2,3,4
    clear columns
    - 결과
    Enter value for table_name: emp
    old 16: and b.table_name = upper('&table_name')
    new 16: and b.table_name = upper('emp')
    PK owner PK_table PK_const Fk_Table Fk_Const Key_col Fk_Statu VALIDATE DEFERRED DEFERRAB
    SCOTT DEPT PK_DEPTNO EMP FK_DEPTNO DEPTNO ENABLED VALIDATE IMMEDIAT NOT DEFE
    ## fk_const_from.sql
    DOC
    file: fk_const_from.sql
    다른 테이블의 fk가 자신의 테이블의 pk를 reference하는 경우,
    부모를 넣으면 자식이 출력,
    dept(deptno가 pk) -< emp(deptno가 fk) 일 경우 dept를 넣으면
    emp 테이블 출력
    set line 132
    col owner format a10 heading 'Pk_owner'
    column table_name format a15 heading 'Pk_table'
    column const_name format a15 heading 'Pk_const'
    column referencing_table format a25 heading 'Ref_Table'
    column referencing_table format a15 heading 'Fk_Table'
    column foreign_const format a15 heading 'Fk_Const'
    column fk_status format a8 heading 'Fk_Status'
    column key_column format a8 heading 'Key_col'
    column validated format a8 trunc
    column DEFERRED format a8 trunc
    column DEFERRABLE format a8 trunc
    select a.owner,
    a.table_name,
    a.constraint_name const_name,
    b.table_name referencing_table,
    b.constraint_name foreign_const,
    c.column_name key_column,
    b.status fk_status,
    b.validated ,
    b.deferred,
    b.deferrable
    from dba_constraints a, dba_constraints b, all_cons_columns c
    where
    a.owner=b.owner and a.owner=c.owner
    and a.constraint_name= c.constraint_name
    and a.constraint_name = b.r_constraint_name
    and a.table_name = upper('&table_name')
    and b.constraint_type = 'R'
    and a.owner not in ('SYS','SYSTEM','OUTLN','PERFSTAT')
    order by 1,2,3,4
    clear columns
    Enter value for table_name: dept
    old 16: and a.table_name = upper('&table_name')
    new 16: and a.table_name = upper('dept')
    PK owner PK_table PK_const Fk_Table Fk_Const Key_col Fk_Statu VALIDATE DEFERRED DEFERRAB
    SCOTT DEPT PK_DEPTNO EMP FK_DEPTNO DEPTNO ENABLED VALIDATE IMMEDIAT NOT DEFE

  • Foreing keys works only when created as CAPITAL?

    Hello,
    When working with HTML DB tutorial, I have noticed that foreign keys works only when I do create them as CAPITAL. I did create some foreign keys manually, and when I was trying "query by example" it did not work correctly unles I did re-create the foreign keys using all captials in their name. Why is it that?
    Thank you,
    DanielD

    I let it dry out more and it started working. It still has a quirk or two but I can live with it.

  • Account key and Accrual key  Urgent

    Hi Friends
    Where I can define account keys and accrual key for external service pricing procedure. Need your help ASAP.
    Regards
    Vivek

    hi,
    Account key:
    1. spro --> sales and distribution --> basic functions --> account assignment and costing --> revenue account determination --> define and assign account keys.
    2. In the pricing procedure , for that condition type, you will mention that ( if you want to post it into separate G/L account then) you will assign account key and accurals.
    hope this may help you,
    regards,
    Srinivas

  • How to disable "Enter" key - urgent

    - i have on my site one site password protected. Now i don't want that users cann use Enter key when they write password. Only when the click with mouse. For that i have onClick="..."
    How can i disable only enter key?
    Thanks

    Don't want the user to press the Enter key... who
    thinks up these ideas anyway? It never ceases to
    amaze me.Internet team in one of my early carrer companies were having problems with a search field on their web project... When the user pressed enter they were getting an error, but it worked when they clicked with the mouse.
    So they decided to remove the ability of the user to press enter, rather than figure out what was wrong and fix it... But they couldn't figure out how to disable the enter button either, so they just put red text below the search field asking users to click on the button and not to press enter...
    How the hell do some people get in the door in Software Companies?

  • Foreing Key association didn't create for mysql database

    Hi,
    I Am new to adf business components. I Am using jdeveloper 11g and mysql5.1 i tried just create one master detail entry, but i can't create association entity class using adf business components. How can i create this? Please help me.
    Thanks advance...

    ํำํyes, I already delete the file. However, I try to create new blank file and named it as <SID>ALRT.LOG. After that I try to switch log file, nothing write onto this file. I also restart database after create new blank file and nothing happen. I will wait for an hour as you comment and will update the status.
    Thanks in advance.

  • In JDO, can a foreign key be part of a primary key?

    Hi, it's possible to have a foreing key a part of a primary key in JDO?
    The JDO checker is complaining about that. It says "Primary key field 'person' cannot declare relationship".
    For example, if I have an entity 'Person' (id, name) and and entity 'Pet' (name, age). Can I have the primary key of 'Person' (id) as a foreign key in 'Pet', and can I have a compound primary key in 'Pet' with 'name' and 'id' as the compound key?
    Thanks in advance.
    Rafael

    Hi Dino,
    First of all, thank you very much for your answer.
    I read the article, but the solution proposed isn’t clear to me. The theorical solution is: “You'll have to map the foreign key columns to individual simple fields in your class rather than a single related object. At runtime, you can use the values of these fields to construct an application identity instance, which you can then use to fetch the related object”
    I don’t understand the second sentence… how would I fecht the related object at runtime?
    Did you try it? Could you please send me an example? I change the type of my attributes to primitive types, and I left my .jdo and .map files as if those attributes were only primary keys… how would I specify the relation at runtime with the other table?
    My email is [email protected], I would really appreciate your help.
    Best regards,
    Isidro

  • Populating custom foreign key using EIM Import

    Hi,
    This is regarding a requirement wherein we are trying to populate the custom foreign key in the siebel base table using the EIM import.
    The table being used are as .
    S_CL_PTCL_LS ----> having vanilla PRDINT_ID foreing key to S_PROD_INT
    S_CL_PTCL_LSXM--> Created custom colum x_prod_id as foreing key to S_PROD_INT
    using EIM_CL_PTCL_LS ---> Created mapping for the custom foreign key field to resolve the UK cols.(NAME,BU_ID,VENDR_OU_ID)
    When we are executing the EIM import PRDINT_ID column foreing key to S_PROD_INT is getting resolved properly; however the custom column x_prod_id as foreing key to S_PROD_INT in S_CL_PTCL_LSXM is not getting resolved.
    The data for the resolution is same for both the mappings.
    Can some let me know if it is possible to do such import for custom foreign keys/this import is only possible for the vanilla foreign key refrences.
    Warm Regards,
    Ashutosh

    Hi,
    I think the custom FK may be a mistake.
    PAR_ROW_ID is the foreign key from S_CL_PTCL_LSXM to S_CL_PTCL_LS. You don’t have to create your own FK to do something that Siebel provides OOTB.
    Please check that you really need the custom FK. I don't think you do. You should simply join to S_CL_PTCL_LS and then to S_PROD_INT. This is Siebel Tools 101 but I have seen this mistake many times.
    Robert
    Robert Ponder
    Lead Architect and Director
    Ponder Pro Serve
    cell: 770.490.2767
    fax: 770.412.8259
    email: [email protected]
    web: www.ponderproserve.com
    Edited by: Robert Ponder on Dec 27, 2010 8:48 AM
    Edited by: Robert Ponder on Dec 27, 2010 8:50 AM

  • Hi All,How2 delete a pkey for std table and add 2 new primary keys

    Hi All,
            How2 delete a pkey for std table and add 2 new primary key fields .Please provide me the required procedure .
    Thanks&Regards.
    Bharat.

    Hi Bharat,
    First thing is you need to have the access key to change any standard dictionary object/standard programs/ standard transactions.You may get this from your basis person after getting approval from your respective manager.But changing or modifying the standard object is not recommended, but if there is no alternate to meet the business requirement then we have to follow this way only.
    Next, you need to check whether this table's primary key is being used in any other table as foreing key or not. If there is, then you must remove this relation and then you can delete the unncessary primary key field from that table.Finally you can add the two new fields and set them as primary key, save, check for any errors and activate.
    Hope this helps.
    Please reward if useful.
    Thanks,
    Srinivasa

Maybe you are looking for

  • Why does iphoto keep shuting down after Lion upgrade

    Why won't Iphoto load since upgrading to Lion?

  • Help resizing window using PS CS4 on PC

    I am trying to figure out a way to put 4 or 6 images on my screen and be able to move them around to compare them. Am using Photoshop CS4 on PC and XP Home. I open 4 or 6 files and float all in windows. I then zoom out and make 1 image smaller, so it

  • Help resolve please

    Hi all, Please can anyone help with resolving the errors below? SQL> shutdown abort ORACLE instance shut down. SQL> startup mount ORACLE instance started. Total System Global Area 118255568 bytes Fixed Size 282576 bytes Variable Size 83886080 bytes D

  • Time Machine backups excluded files

    After six months of normal operation, without any reason Time Machine backups large dimension VM Parallels files even if path of these files have been excluded in TM preferences and in Parallels Desktop 6 setup. Such excluded files are located in /Us

  • Omg pls help me!!

    I have an 80g ipod classic, and i'm using a pc. Itunes was working fine then one day it stopped connecting to my ipod. Windows recognizes it's there but no itunes. Pls help Hope this helps too... Microsoft Windows XP Home Edition Service Pack 2 (Buil