Thursday, June 28, 2012

How to store text that exceeds the VARCHAR2 limit in Oracle?

VARCHAR2 is limited to 4000 bytes. To store text data which exceeds that limit, use a column of type CLOB (Character Large Object), which can hold text up to 4GB.

This is used to store full text of executed SQLs in V$SQL table.

Ref:
http://www.orafaq.com/wiki/CLOB

How to view the data dictionary in an Oracle DB?

Run sql:
SELECT * FROM dictionary;

Wednesday, June 27, 2012

What are the differences of Field, Variable and Parameter in Jasper Reports?

Field: A value from the datasource. e.g. if the datasource is a resultset then this will represents a particular field of a result row.

Variable: A variable inside the report that is used for tasks such as counting (e.g. page number) and etc.

Parameter: A value sent from the java program that calls the jasper file. 

Ref:
http://jasperforge.org/uploads/publish/jasperreportswebsite/trunk/tutorial.html

Friday, June 1, 2012

How to test a webservice from linux command line?

Use cURL

First create the soap request file named soap-request.xml.
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetWeather xmlns="http://www.webserviceX.NET">
<CityName>Milan</CityName>
<CountryName>Italy</CountryName>
</GetWeather>
</soap:Body>
</soap:Envelope>
Then use the following curl command to send the request...
curl -H "Content-Type: text/xml; charset=utf-8" \
-H "SOAPAction:http://www.webserviceX.NET/GetWeather" \
-d@soap-request.xml \
http://www.webservicex.net/globalweather.asmx \
> output.xml

Ref:
http://curl.haxx.se/docs/manpage.html
http://josephscott.org/archives/2011/10/timing-details-with-curl/