Archive for the ‘Oracle’ Category

XSLProcessor.setParam

Tuesday, June 1st, 2004

The XSLProcessor.setParam(uri, name, value) allows you so set the value of a top-level stylesheet parameter.

The uri parameter is the namespace URI of the paramater name, which by the XSLT 1.0 specification is a qualified name.

That means that you can have:

    <xsl:stylesheet xmlns:foo="urn:foo" xmlns:bar="http://bar.com/params" ...>
    <xsl:param name="foo:param1"/>
    <xsl:param name="bar:param2"/>
    <xsl:param name="param3"/>

so the parameter names can be namespace-qualified, where the namespace prefix is a shortcut syntax for referring to the fully-specified namespace URI.

So, to set values for all three of these parameters above, you would do:

    xslProc.setParam("urn:foo","param1","'val1'");
    xslProc.setParam("http://bar.com/params","param2","'val2'");
    xslProc.setParam("","param3","'val3'");

The parameter value is expected to be a valid XPath expression (note that string literal values would therefore have to be explicitly quoted)

[Gleaned from mailing list email from Steve Muench and documentation]

Regular Expressions in PL/SQL

Friday, September 5th, 2003

A new feature for Oracle 10g [1] for PL/SQL is “Regular Expressions.”:http://otn.orcle.com/oramag/oracle/03-sep/o53sql.html As you know regular expressions are very powerful, almost too powerful, and I know a bit about them, but can’t use them at all. Except now it will be my job to know it, because lots of PL/SQL programmers are going to be asking how to use it, and they’ll be finding lots of interesting bugs in the way obscure expressions don’t do it quite like Perl does it.

We’ve got some new functions that you can stick in your SQL statements such as

SELECT ename FROM emp WHERE REGEXP_LIKE(empno, ‘[0-9]{3}-[0-9]{4,4}’);

btw, with XML DB (9iR2) you can use xpath expressions in your where statements too

select P.PODOCUMENT
from PURCHASEORDER P
where P.PODOCUMENT.extract(’/PurchaseOrder/Reference/text()’).getStringVal() =
‘BLAKE-2001062514034298PDT’;

A neat trick is that if you use a regular expression a lot you can use a functional index to improve the performance.

[1] What’s 10g I here you ask? Well, it is another marketing term for the next version of the database. We had version 8, and then there was the dot com boom and 8i was invented. This actually deserved an x.1 version increase. But then we had 9i, which was something like 8.2, and now 10g could 8.3. Only 10 sells better than 8.3, and a different letter, an interestingly different letter to i, sells better again. Apparently. Anyway, the G stands for grid, and it is all about Grid computing which is the Next Big Thing. Apparently.

Building a Code-Analysis Utility

Friday, March 7th, 2003

??Steven Feuerstein?? starts a series of articles on a PL/SQL code analysis Utility. Whilst the actual code might be of the greatest use, I am greatly interested in the process he is following.

In the first article he finds out whether he can gather in enough information to build the application he wants to. Finding one such package (DBMS_DESCRIBE) is very difficult to work with, he builds a wrapper round it to make it easy to use.

As someone who is being _forced_ to learn PL/SQL at the moment (I never did care for its syntax; it seemed alien) it is useful to see.

Oracle to buy BEA?

Tuesday, January 28th, 2003

Reports that Larry Ellison is bored after his yacht race. Oracle might buy business software maker BEA Systems Inc.

Follow the instructions to the letter

Wednesday, January 8th, 2003

Sometimes I wonder if anyone every reads what they have written. I’m installing a 9.2.0.2 patchset for my Oracle database and following the instructions.

  1. Log in to the oracle account and make sure the environment is set to the correct ORACLE_HOME and ORACLE_SID.
  2. Uncompress and untar the downloaded patch set file into a new directory.
  3. Shut down the existing Oracle Server instance with normal or immediate priority. I.e.: Shutdown all instances (cleanly). If running Real Application Clusters, stop all listener, agent and other processes running in or against the ORACLE_HOME to be installed into.
  4. Drop the xmlconcat function by running the following commands:

    * drop public synonym xmlconcat;
    * drop function xmlconcat;

So, how am I supposed to do that exactly, what with the database nicely shutdown?

*sigh*

Oracle 9i Release 2 XML DB

Tuesday, August 13th, 2002

A review of Oracle’s 9i XML DB at Bright Eyed Mister Zen:

“Oracle 9i is now by every definition that I know of, a native XML database.”