htp.p ability to find and replace
Is it possible, in a procedure to use htp.p() to write data, and then a few lines later remove it?
For example:
begin
htp.p(‘This is a test. [junk] This is only a test’);
- - - - - do something here so that [junk] would not be pushed to the browser
end;
My purpose for this is to create a <query> tag that I’ll use in psp pages. So I’ll be able to do this in a psp page:
<query name=”q1”>
select col from table where 1 = 1
<% if true then %>
and col = <%= bind(‘number’, 1) %>
<% end if %>
</query>
<%= materialize_query(‘q1’) %>
<table>
<% for z in (select * from q1) loop %>
<tr><td><%= z.col %></td></tr>
<% end loop; %>
</table>
I’m thinking of the mechanics of how to do it. Procedure materialize_query needs to look at the htp buffer and extract out the query string, then execute it. The bind function would store the bind information and return a “:b1”. I’m not sure how to manipulate the htp buffer.
Edited by: brian.mcginity on Feb 20, 2010 7:49 AM
Edited by: brian.mcginity on Feb 20, 2010 7:50 AM
making code readable