Background:
I'm working on an insert page where the user can enter a movie title with corresponding info, including director name, writer name, and actors' names. Most movie info is in a movie table. There is a person table that includes an sequence PK, first name, last name and bio for all people (directors, writers, actors) and a role table (director=1, writer=2, actor=3). Finally there is a person_role_movie table ('Person: Ed Wood has the role: director for movie: Plan 9').
Problem:
I've got the movie title, release date, etc. input going into the movie table. But for the person info- I need a query to say:
If the combination of input: director_firstname and director_lastname does not match a current combination of firstname + lastname matching a person_id in the person table, make a new record and enter it. Whether it does or not, locate the person_id for the person and link it to the current movie_id and the director job_role_id.
Can anyone help me? I'm not very good at this stuff, as you might have guessed.
I'm working on an insert page where the user can enter a movie title with corresponding info, including director name, writer name, and actors' names. Most movie info is in a movie table. There is a person table that includes an sequence PK, first name, last name and bio for all people (directors, writers, actors) and a role table (director=1, writer=2, actor=3). Finally there is a person_role_movie table ('Person: Ed Wood has the role: director for movie: Plan 9').
Problem:
I've got the movie title, release date, etc. input going into the movie table. But for the person info- I need a query to say:
If the combination of input: director_firstname and director_lastname does not match a current combination of firstname + lastname matching a person_id in the person table, make a new record and enter it. Whether it does or not, locate the person_id for the person and link it to the current movie_id and the director job_role_id.
Can anyone help me? I'm not very good at this stuff, as you might have guessed.