billycairn
Technical User
Hi
I have a web application which pulls images from a table and displays the results in a web page - works fine. I want to be able to pass the table name to the procedure at runtime - user clicks on a form option and the option populates the value for the table name which is used in the cursor which loops through the table. Can anyone advise me on the syntax. Or an alternative method. Code is below.
OS - Windows for development, Solaris for the live db.
Oracle 10g 1.0.2
---------code-------------
CREATE OR REPLACE procedure display_pdf_list_asTable
is
--create a cursor of the pdfs in the table
CURSOR pdf_cur
is
select * from <hard coded table name>;
pdf_rec pdf_cur%ROWTYPE;
BEGIN
-- htlm stuff to set up page
OPEN pdf_cur;
LOOP
FETCH pdf_cur into pdf_rec;
EXIT when pdf_cur%notfound;
-- generate more html for the page based on the table
END LOOP;
CLOSE pdf_cur;
END;
-------------end code--------------
It's the hard coded table name I want to pass at runtime. Any advice?
Cheers
BC
I have a web application which pulls images from a table and displays the results in a web page - works fine. I want to be able to pass the table name to the procedure at runtime - user clicks on a form option and the option populates the value for the table name which is used in the cursor which loops through the table. Can anyone advise me on the syntax. Or an alternative method. Code is below.
OS - Windows for development, Solaris for the live db.
Oracle 10g 1.0.2
---------code-------------
CREATE OR REPLACE procedure display_pdf_list_asTable
is
--create a cursor of the pdfs in the table
CURSOR pdf_cur
is
select * from <hard coded table name>;
pdf_rec pdf_cur%ROWTYPE;
BEGIN
-- htlm stuff to set up page
OPEN pdf_cur;
LOOP
FETCH pdf_cur into pdf_rec;
EXIT when pdf_cur%notfound;
-- generate more html for the page based on the table
END LOOP;
CLOSE pdf_cur;
END;
-------------end code--------------
It's the hard coded table name I want to pass at runtime. Any advice?
Cheers
BC