I created a form where i add records to a child table. However I don’t want people to be able to edit the secondary key, only select it from the list of primary keys of the parent or something along those lines. How could i do that?
The tables:
CREATE TABLE CHAMPIONS (CNAME VARCHAR2(15) NOT NULL, PRICELEVEL NUMBER(1) NOT NULL, ROLE VARCHAR2(10) NOT NULL, HPLEVEL NUMBER(2) NOT NULL, ATKLEVEL NUMBER(2) NOT NULL, MAGICLEVEL NUMBER(2) NOT NULL, DIFFLEVEL NUMBER(2) NOT NULL);
CREATE TABLE SKINS (SNAME VARCHAR2(20) NOT NULL, CNAME VARCHAR2(15) NOT NULL, PRICELEVEL NUMBER(1) NOT NULL);
ALTER TABLE Champions ADD CONSTRAINT pk_Champions PRIMARY KEY (CNAME);
ALTER TABLE Skins ADD CONSTRAINT fk_Skins FOREIGN KEY (CNAME) REFERENCES champions(CNAME);
Too less information to be able to give an answer, but I can give it a try.
You can have
LOVs created in the detail table and have thatLOVdriven off of the parent tables primary key, also the text item with which you would be linking the LOV you need to put aWHEN-VALIDATE-ITEMtrigger with the same query as in theLOVsRECORD GROUPso that in case the user types instead of using theLOVyou can validate the input and then alert them in case of invalid input and fetch the correct master primary key in case of correct value entered.Below is how the datablock with the LOV buttons look like-
And below is the Trigger on the
STOREitem in the datablock-You can code the RG similarly as the query in the trigger considering your master table in the query.