Hi Eswar,
I am not that sure with the function support of Castor ATM but we plan a
big refactoring of the OQL engine for 1.1 release.
Until that time I suggest you one of 2 workarounds:
1. Use SQL passthrough queries like:
CALL SQL select ... from ... where AS <classname>
Please take care that the number and sequence of the select columns
are similar to those of a OQL query for the requested class.
2. Create a view that offers the columns that include function calls:
select *, CONCAT(TO_CHAR(qtr_year),TO_CHAR(quarter)) as YEAR_QTY
from mpmweb.mpm_coding
Use this view in the castor mapping.
Hope that helps.
Ralf
Easwaran Nampoothiri schrieb:
Hi,
I am sure Castor supports the “functions” like TO_CHAR(), CONCAT() etc..
But I am not able to use it properly , can anybody suggest one example .
*SQL:*
* *
SELECT distinct(metric_name)
FROM mpmweb.mpm_coding
WHERE market_name = 'SCORECARD'
AND CONCAT(TO_CHAR(qtr_year),TO_CHAR(quarter)) BETWEEN
CONCAT(TO_CHAR(2004),TO_CHAR(3)) AND CONCAT(TO_CHAR(2005),TO_CHAR(1));
*OQL:*
* *
*aQuery = db.getOQLQuery(" SELECT metricList FROM
com.cummins.mpm.domain.MeasurementWeightList metricList "*
* + " WHERE metricList.marketName =
$1 AND metricList.metricName != $4 AND
concat(to_char(metricList.quarter),to_char(metricList.quarterYear))
between $2 AND $3 ");*
aQuery.bind(marketName.trim());
aQuery.bind(fromQtrYear);
aQuery.bind(toQtrYear);
aQuery.bind(pbit);
Any help really appreciated !!!
rgrds
J Easwar
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Information transmitted by this EMAIL is proprietary to iGATE Group of Companies and is intended for use only by the individual
or entity to whom it is addressed and may contain information that is privileged, confidential, or exempt from disclosure under
applicable law. If you are not the intended recipient of this EMAIL immediately notify the sender at iGATE or [EMAIL PROTECTED]
and delete this EMAIL including any attachments
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:
[EMAIL PROTECTED]
-------------------------------------------------