Checkboxes & Arrays
933825Apr 27 2012 — edited Apr 28 2012Hello everyone,
I am a student working on a group project for school. Long story short, I have an anonymous PL/SQL block that inserts data in two different tables based on the user's input: http://apex.oracle.com/pls/apex/f?p=35780:3:1690079353270601:::::
The problem I have is accessing the array that is created with the checkboxes. This is the PL/SQL code that I have:
DECLARE
MID MOVIE.MOVIE_ID%TYPE := MOVIE_SEQ.NEXTVAL;
BEGIN
INSERT INTO MOVIE VALUES(MID, :P3_TITLE, :P3_YEAR, :P3_MPAA_RATING, :P3_RUNTIME, :P3_CRITICS_CONSENSUS, :P3_THEATER_RELEASE_DATE, :P3_DVD_RELEASE_DATE, :P3_SYNOPSIS, :P3_STUDIO);
FOR i IN 1..v('P3_GENRE').COUNT LOOP
INSERT INTO MOVIE_GENRE VALUES(MID, i);
END LOOP;
END;
With that code, I get the following errors:
ORA-06550: line 6, column 29: PLS-00487: Invalid reference to variable 'NEW <expression>'
ORA-06550: line 6, column 3: PL/SQL: Statement ignored
The checkbox is named P3_GENRE, and I want to extract the checked IDs and insert them into the MOVIE_GENRE table. Everything but the checkbox/array lines work. Help? :(
Edited by: 930822 on Apr 27, 2012 7:36 PM