Thursday, November 13, 2008

Rendering Error: Unexpected element: :report

Ever seen the error "Unexpected element: :report" when trying to render a report in BI Publisher? This is due a a Bug/Feature where the "xmlns" attribute is not automatically inserted into the element in the xdo file for your report. To resolve the issue is quite simple.

1. Open the xdo file for you report in a text editor
2. Insert the following attribute into the element

xmlns="http://xmlns.oracle.com/oxp/xmlp"


The element should then look something like this:

<report version="1.1" xmlns="http://xmlns.oracle.com/oxp/xmlp" defaultDataSourceRef="dev">
...
</report>

Monday, November 10, 2008

Extract a line from a file

There are many times I need to extract a single line (or possibly group of lines) from a file (Usually when things have gone wrong).

The easiest way to do this is as follows:

awk 'NR==lineNumber{print;exit;} filename

Replacing:

  lineNumber - with the line you wish display

  filename - with the name of your file





I have also seen the following suggested:

sed 'lineNumberq;d' filename

Replacing:

  lineNumber - with the line you wish display

  filename - with the name of your file


After performance testing on a large file (~10,000,000+ lines) the awk command was found to be faster.

ls: Arg list too long

Ever seen the error "arg list too long" when issuing an ls with a wildcard? The simple way round this is as follows:


find . -name "regexp" -exec ls -l '{}' +

Where:

regexp is the regular expression you are searching for