Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DBMS_SQL and cursors

Status
Not open for further replies.

benbenben

IS-IT--Management
Nov 26, 2003
5
CA
Hi, I'm using DBMS to generate cursors and the output to htp using pl/sql.

Basically, I have a table of questions, eg:

id, q1a, q2a, q2b, q3, etc

and I'm displaying this on the web. It draws it in a table like this:



--variable = question name stuff here
-- parsing the dbms here
-- defining the columns here

loop
if dbms_sql.fetch_rows (c1) > 0 then
-- column value stuff here
htp.print('<tr>');
htp.print('<td>' || v_question || '</td>');
htp.print('</tr>');
else
exit;
end if;
end loop;




Because the select is fairly complex (using some decodes etc) I'm using DBMS_SQL so I can set the question name on the fly to a variable. However, It would be great if I could reuse the cursor every question, as opposed to having to define the columns (there's 7 of them) etc everytime I want to do it.

Any ideas? cheers ;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top