spacedancer
Programmer
I am trying to insert a comment in a Likes table for a focus group, and the comment is supposed to go to the specific university that the user selects from the list, but instead it inserts itself in all of the universities.
how can i specify in my insert query so that the comment goes only to the university selected from the list?
here is my query:
INSERT INTO gv_likes (f_id, u_id, l_id, l_participants, l_comment)
VALUES ('#FORM.f_id#', '#FORM.u_id#', '#VARIABLES.l_id#',
'#FORM.l_participants#', '#FORM.l_comment#')
here are some table codes to make it more understandable:
create table gv_focus_group
(
f_id VARCHAR2(35),
f_demographics VARCHAR2(100),
f_name VARCHAR2(40),
CONSTRAINT gv_focus_group_PK PRIMARY KEY (f_id)
);
create table gv_university
(
f_id VARCHAR2(35),
u_id VARCHAR2(35),
u_name VARCHAR2(100),
CONSTRAINT gv_university_PK PRIMARY KEY (u_id),
FOREIGN KEY (f_id) REFERENCES gv_focus_group(f_id) ON DELETE CASCADE
);
create table gv_likes
(
f_id VARCHAR2(35),
u_id VARCHAR2(35),
l_id VARCHAR2(35),
l_participants NUMBER(4),
l_comment VARCHAR2(300),
CONSTRAINT gv_ikes_PK PRIMARY KEY(l_id),
FOREIGN KEY (f_id) REFERENCES gv_focus_group(f_id),
FOREIGN KEY (u_id) REFERENCES gv_university(u_id) ON DELETE CASCADE
);
Thank you!
how can i specify in my insert query so that the comment goes only to the university selected from the list?
here is my query:
INSERT INTO gv_likes (f_id, u_id, l_id, l_participants, l_comment)
VALUES ('#FORM.f_id#', '#FORM.u_id#', '#VARIABLES.l_id#',
'#FORM.l_participants#', '#FORM.l_comment#')
here are some table codes to make it more understandable:
create table gv_focus_group
(
f_id VARCHAR2(35),
f_demographics VARCHAR2(100),
f_name VARCHAR2(40),
CONSTRAINT gv_focus_group_PK PRIMARY KEY (f_id)
);
create table gv_university
(
f_id VARCHAR2(35),
u_id VARCHAR2(35),
u_name VARCHAR2(100),
CONSTRAINT gv_university_PK PRIMARY KEY (u_id),
FOREIGN KEY (f_id) REFERENCES gv_focus_group(f_id) ON DELETE CASCADE
);
create table gv_likes
(
f_id VARCHAR2(35),
u_id VARCHAR2(35),
l_id VARCHAR2(35),
l_participants NUMBER(4),
l_comment VARCHAR2(300),
CONSTRAINT gv_ikes_PK PRIMARY KEY(l_id),
FOREIGN KEY (f_id) REFERENCES gv_focus_group(f_id),
FOREIGN KEY (u_id) REFERENCES gv_university(u_id) ON DELETE CASCADE
);
Thank you!