If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > How to create html form using loop?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-18-03, 09:13
Giedre Giedre is offline
Registered User
 
Join Date: Sep 2003
Location: Lithuania
Posts: 4
How to create html form using loop?

Hello

Maybe someone has faced such a problem?

It's simple to create html form, when a table has few fields. But there are more than 200 fields in my tables! So, a way like below becomes unpleasant .

CREATE OR REPLACE PROCEDURE pr_name
(
id1 in varchar2 default null,
id2 in char default null
)
IS
begin
<...>
htp.bodyopen;
htp.p('<FORM>');
htp.tableOpen;
htp.p(' <TR><TD>NAME=id1 VALUE='||id1||'></TD>
<TD>NAME=id2 VALUE='||id2||'></TD></TR> ');
htp.bodyclose;
<...>
end;
/

I had an idea to put this : <TD>NAME=id1 VALUE='||id1||'>
in the loop. But then i cannot find how to define VALUE!

of course, i can put the name of parameters in varray. So, NAME it's not a problem longer: NAME=my_varray(i). But the VALUE is still a headache!

I will appreciate any suggestion.
Thanks.
Reply With Quote
  #2 (permalink)  
Old 09-19-03, 06:06
Lazy Lazy is offline
Registered User
 
Join Date: Sep 2003
Location: Brussel
Posts: 52
Re: How to create html form using loop?

Make use of the possibilitys of cursors. Read the data from your table into a cursor and then loop the cursor. There's a specific cursorloop (a kind of for loop). Something like ...

CURSOR <cursorname> IS
SELECT <blabla>
FROM <blabla>;

put the cursor in the DECLARE part of the code. Now you can loop the cursor like this:

FOR <name> IN <cursorname> LOOP
htp.print( <name>.<column selected in table>);
END LOOP;
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On