I have scoured the internet with no luck. I have attached links to the practice set I am working on, but I am creating a stored procedure that needs to update a row after checking if a foreign key from the one table matches with a corresponding primary key in another table. I'll attach my code so far (which isn't much), but I am honestly lost. I know how to create foreign key constraints like:
ALTER TABLE DRIVE
ADD CONSTRAINT TRUCK_NUM_FK FOREIGN KEY (TRUCK_NUM) REFERENCES TRUCK;
But I don't know how to do these things and more from a stored procedure. Thank you!
Practice Description: http://tinypic.com/r/2djxq4w/8 http://tinypic.com/r/sq61i1/8
CREATE OR REPLACE PROCEDURE TRUCK_RETURN (TR_NUM IN NUMBER,TR_MILE IN NUMBER) AS
BEGIN
IF
UPDATE