Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> requesting Value of ID from Stored Procedure to JSP
Hi,
I am trying to use a Stored procedure called from a JSP to insert into a table (ultimately multiple tables).
I am inserting sequence.nextval into the ID field. I cannot figure out how to retrieve the actual VALUE of the id field that was just inserted out of the SP and display it on the JSP page. The JSP page will have another form on it that will need to insert a related record where the ID needs to the be the same value... so on this second form I have to set a hidden field to the value of the result of getting the ID from the SP.
Let's say I have a simple stored procedure such as:
create or replace procedure test_proc
(test_id_p in test.test_id%type,
test_name_p in test.test_name%type)
as
begin
insert into test(
test_id_seqence.nextval,
test_name)
values
(test_id_p,
test_name_p);
end test_proc;
How can I retrieve the value of test_id in this particular record that was inserted? I have tried placing test_id_p on the JSP but it always show null.
Thanks!
Jen
Received on Wed Jun 27 2001 - 12:32:33 CDT
![]() |
![]() |