Friday, January 27, 2006

Reports with binds and versions

To add reports which have bind variables edit your UserReports.xml on linux this is found in ~/.raptor on windows this is in C:\Documents and Settings\[user]\.raptor If the file doesn't exist, within Raptor right click on the "User Defined Reports" and add either a folder or report this will get you the skeleton of the file.

Here's a very simple sql statement which has bind variables. Notice the sql has :BIND1. Then BIND1 is later defined as a bind with a name, description and tooltip. Also BIND1 can have a default value specified in the value tag. If the text "NULL_VALUE" is placed into the default, the prompt for binds will have the null checked.

Notes:

  • Currently there is a bug which requires there be no whitespace between the <binds><bind> and the </bind></binds> This all apply if there is 2 binds the </bind><bind> should have no whitepace. This will be fixed in the next drop.
  • If the reports are in anyway changed in raptor the results will be that the UserReports.xml will be regenerated without the extra information.



<report type="report" enable="true">
<name><![CDATA[Test Report]]></name>
<description><![CDATA[Kris's test report with binds]]></description>
<tooltip><![CDATA[Tooltip for when the bind name is hovered over]]></tooltip>
<query>
<sql><![CDATA[select :BIND1 from dual]]></sql>
<binds><bind id="BIND1">
<prompt><![CDATA[First Bind Variable]]></prompt>
<tooltip><![CDATA[Name or part of name to search for (case insensitive).]]></tooltip>
<value><![CDATA[NULL_VALUE]]></value>
</bind></binds>
</query>
</report>




Now you can also have report which execute difference sql depending on the version of the database. The only difference is in the query xml tag. By adding minversion="XX.ZZ", the query will be limited to run only in that version. I would recommend having a default query for other versions however if there is none the UI will state no applicable query is found for this version.


<report type="report" enable="true">
<name><![CDATA[Test Report]]></name>
<description><![CDATA[Kris's test report with binds]]></description>
<tooltip><![CDATA[Tooltip for when the bind name is hovered over]]></tooltip>
<query minversion="10.1">
<sql><![CDATA[select :BIND10 from dual]]></sql>
<binds><bind id="BIND10">
<prompt><![CDATA[First Bind Variable]]></prompt>
<tooltip><![CDATA[Name or part of name to search for (case insensitive).]]></tooltip>
<value><![CDATA[NULL_VALUE]]></value>
</bind></binds>
</query>
<query>
<sql><![CDATA[select :BIND_OTHER from dual]]></sql>
<binds><bind id="BIND_OTHER">
<prompt><![CDATA[First Bind Variable]]></prompt>
<tooltip><![CDATA[Name or part of name to search for (case insensitive).]]></tooltip>
<value><![CDATA[NULL_VALUE]]></value>
</bind></binds>
</query>
</report>

Wednesday, January 25, 2006

Custom Snippets in Raptor EA 3 v 897

Raptor EA 3 is out build #897. Here's how to add snippets in this build. Eventually a UI could be built around managing the snippets and maybe even subscribe via an rss feed but in the mean time give this a try.

Adding Custom Snippets:

raptor -Draptor.user.snippets=/home/klrice/snippets.xml
or edit the raptor.conf file and add
AddVMOption -Draptor.user.snippets=/home/klrice/snippets.xml


The snippets file should look like this:

<?xml version = '1.0' encoding = 'UTF-8'?>
<snippets>
<group category="Kris' custom snippets" language="PLSQL">
<snippet name="Select EMP" description="Too lazy to type it out">
<code><![CDATA[select * from scott.emp]]>
</snippet>
<snippet name="Select EMP Local" description="Too lazy to type it out">
<code><![CDATA[select * from emp]]>
</snippet>
</group>
<group category="Kris' other snippets" language="PLSQL">
<snippet name="Select DEPT" description="Too lazy to type it out">
<code><![CDATA[select * from scott.dept]]>
</snippet>
</group>
</snippets>

Furthurmore the snippets window will reload eveytime it's opened if the file changes.

The Results
custom_snippets.png

Wednesday, January 11, 2006

Raptor EA #2

Raptor Early Access V2 is out. Grab it here

Here's some stats.
over 100 fixes in EA #2

In 2 weeks time...
over 20,000 downloads in 2 weeks.
over 27,000 views on the forums. 6th in over DB category.