I’m trying to create a database web interface for inserting new data from web. Everything is a part of of Oracle sql database package Currently I have 2 procedures: procedure test2 should call procedure createplace using POST, but I keep getting error message. Can anyone explain where is the mistake and how to solve it?
PROCEDURE test2 IS
CURSOR c_data IS
SELECT place_id, city_id, place_name
FROM places;
v_place_id NUMBER;
v_city_id NUMBER;
v_place_name VARCHAR2(100); -- Adjust the size as needed
BEGIN
menu(2);
htp.htmlopen; -- generates <HTML>
htp.headopen; -- generates <HEAD>
htp.headclose; -- generates </HEAD>
htp.bodyopen; -- generates <BODY>
-- Create an HTML form
htp.formopen('POST', 'CREATEPLACE');
htp.p('Place ID:');
htp.formText('place_id', v_place_id);
htp.br;
htp.p('City ID:');
htp.formText('city_id', v_city_id);
htp.br;
htp.p('Place Name:');
htp.formText('place_name', v_place_name);
htp.br;
htp.formsubmit('Submit');
htp.formclose;
htp.bodyclose; -- generates </BODY>
htp.htmlclose; -- generates </HTML>
END test2;
PROCEDURE CREATEPLACE (
p_place_id IN NUMBER,
p_city_id IN NUMBER,
p_place_name IN VARCHAR2
) AS
BEGIN
-- Increment the ID and insert a new record
INSERT INTO Places (Place_id, city_id, place_name)
VALUES (p_place_id, p_city_id, p_place_name);
END CREATEPLACE;