Build an HTML report
HelloWe have a list of Developer SQL problems where people I work with are the problems of logging with SQL developer affecting productivity.
A comment, is that it is not a report that will find text in PLSQL, data Dictioniary and all the objects at once.
I thought that it would be very simple create a report that will cover this so I started to create a report customized with dbms_output mode output as follows:
declare
l_dd NUMBER: = 0;
CURSOR c1 IS
Select "owner."
initcap (object_type) 'Object_Type,.
object_name 'parameter. "
initcap (Status) "Status."
created 'Date_Created ',.
NVL (last_ddl_time, created) "Last_DDL."
owner sdev_link_owner,
object_name sdev_link_name,
object_type sdev_link_type
of sys.all_objects
where substr (object_name, 1, 4). = "BIN$.
and substr (object_name, 1, 3). = ' DR.$ ".
and (instr (upper (parameter), upper (:SearchString)) > 0)
and rownum < 50
order by owner, object_type, object_name;
Start
dbms_output.put_line ('< html > < body >');
dbms_output.put_line ('& lt; h1 > Multi Object Search & lt; / h1 > ');
dbms_output.put_line ('& lt; h2 > search string:' |: SearchString |) "& lt; (/ h2 > ');
dbms_output.put_line ('& lt; h3 > object search & lt; / h3 > < table border = 1 > < tr > < th > object < /th > < /tr > name ');
for c1_rec in c1
loop
dbms_output.put_line ('< tr >');
dbms_output.put_line ('< td >');
dbms_output.put_line (c1_rec.' Object_name');
dbms_output.put_line ('< table >');
dbms_output.put_line ('< /tr >');
end loop;
dbms_output.put_line ('< /table >');
dbms_output.put_line (' < body / > < / html > ');
end;
The problem is when I run the report I get the error:
ORA-01006: there is no bind variable
But, if I remove the line
and (instr (upper (parameter), upper (:SearchString)) > 0)
It works as expected.
Clearly, the binding variable exists because it is used in this line of code:
dbms_output.put_line ('& lt; h2 > search string:' |: SearchString |) "& lt; (/ h2 > ');
Anyone know what I am doing wrong?
Thank you
Robert
Published by: RobertMetcalf on June 2, 2011 16:42
Published by: RobertMetcalf on June 2, 2011 16:43
Published by: RobertMetcalf on June 2, 2011 16:43
Hi Robert,.
I got it working by avoiding multiple references to a connection variable
(this is a known bug in the spreadsheet which is also your example only appear in the reports).
declare
l_dd NUMBER: = 0;
mySearch varchar2 (1000): =: SearchString.
at the top and then use mySearch instead of: SearchString.
-Turloch
Team SQLDeveloper
declare
l_dd NUMBER :=0;
mySearch varchar2(1000) := :SearchString;
CURSOR c1 IS
select owner "Owner",
initcap(object_type) "Object_Type",
object_name "Object_Name",
initcap(status) "Status",
created "Date_Created",
nvl(last_ddl_time,created) "Last_DDL",
owner sdev_link_owner,
object_name sdev_link_name,
object_type sdev_link_type
from sys.all_objects
where substr(object_name,1,4) != 'BIN$'
and substr(object_name,1,3) != 'DR$'
and (instr(upper(object_name),upper(mySearch)) > 0)
and rownum<50
order by owner, object_type, object_name;
begin
dbms_output.put_line('<html><body>');
dbms_output.put_line('<h1>Multi Object Search</h1>');
dbms_output.put_line('<h2>Search String:' || mySearch || '</h2>');dbms_output.put_line('<h3>Object Search</h3><table border=1><tr><th>Object Name</th></tr>');
for c1_rec in c1
loop
dbms_output.put_line('<tr>');
dbms_output.put_line('<td>');
dbms_output.put_line(c1_rec."Object_Name");
dbms_output.put_line('</td>');
dbms_output.put_line('</tr>');
end loop;
dbms_output.put_line('</table>');dbms_output.put_line('</body></html>');
end;
Edited by: Turloch O'Tierney June 8, 2011 03:54 (for html breakouts)
Tags: Database
Similar Questions
Maybe you are looking for
-
MacBook Pro does not detect monitor Dell through CDM
Guys, a few weeks ago I asked a question if bolt of lightning 2 CDM-compatible monitors. You guys lied. I got the Dell P2715Q today and I have connected to the computer with the USB cable I had Plug and cable thunderbolt. I did everything, but my Mac
-
Bookmarks into folders disappeared?
Alright. So I've had this problem for a little while now. xD and its starting to get kind of annoying. I have most of my favorites sorted in folders and others for easy access, when I need to look for some. For one reason or another, two weeks ago. T
-
Manager fingerprint access Truesuite do not work with IE8 and Firefox 3.0
Hello: I installed the latest version 2.5.29.0 and does not work with firefox 3.0. If someone has tested with IE8? Thank you. Post edited by: pedroae
-
page_fault_in_nopaged_area
page_fault_in_nopaged_area computer error will not start?
-
Photoimipact X 3 is not compatible with Windows 7
Original title: network programs network networking Internet Web site Site Web Web Site URL try to install Photoimpact x 3 but keep on getting a message that the program imconpatible for my computer.