Create a table with below columns,
table name: users
User_id
Request_id
Create a procedure for inserting data into the above table, the input will be pi_user_id, pi_request_id for the proc and the format of the input parameters will be as below,
pi_user_id = 111;
pi_request_id = '10,20,30,40';
pi_request_id will be passed as comma seperated values from UI. You have to split it and store each value as single row into the table.
After inserting, if I query the table, it should be as below,
User_id Request_id
111 10
111 20
111 30
111 40
I have created the table and Procedure. Updating the proc below
CREATE OR REPLACE procedure insertusers(
p_user_id IN USERS.USER_ID%TYPE
p_request_id IN USERS.REQUEST_ID%TYPE)
IS
BEGIN
INSERT INTO users ("USER_ID", "REQUEST_ID")
VALUES (p_user_id, p_request_id);
COMMIT;
END;
So I should add the condition to make the comma separated values into each individual row as shown above. Please help me with this question? Thank you..