Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

htp.p ability to find and replace

brian.mcginityFeb 20 2010 — edited Feb 24 2010
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
This post has been answered by MichaelS on Feb 20 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 24 2010
Added on Feb 20 2010
4 comments
1,745 views