Larry
Hi,
I Have a sql statement that needs to be plugged into an sqlmap. Basically, I want to pass the entire sql. The final sqlmap will look like this:
<select id="queryInterfaceBacklogs_DUAL" resultMap="interface_backlog_result" cacheModel="interface_backlog_cache
?sqlstatement?
<select>
and the 'statement' will be the select statement below. Is this possible in iBatis? Can you tell me how I would go about doing this? An example would be greatly appreciated.
Many thanks!
Sam
select
interface_name as SYSTEM_NAME,
sum(backlog_val) as BACKLOG_VAL,
sum(backlog_last1) as BACKLOG_LAST1,
sum(backlog_last2) as BACKLOG_LAST2,
sum(backlog_last3) as BACKLOG_LAST3
from
(
select
a.interface_name,
sum(decode(i.BACKLOG_VAL,'',0,i.BACKLOG_VAL)) as BACKLOG_VAL,
sum(decode(i.BACKLOG_LAST1,'',0,i.BACKLOG_LAST1)) as BACKLOG_LAST1,
sum(decode(i.BACKLOG_LAST2,'',0,i.BACKLOG_LAST2)) as BACKLOG_LAST2,
sum(decode(i.BACKLOG_LAST3,'',0,i.BACKLOG_LAST3)) as BACKLOG_LAST3
from [EMAIL PROTECTED] i,
( select distinct interface_name
from [EMAIL PROTECTED]
where category='Provisioning'
)a
where SYSTEM_NAME is not null
and a.interface_name = i.system_name
group by a.interface_name
UNION ALL
select
a.interface_name,
sum(decode(i.BACKLOG_VAL,'',0,i.BACKLOG_VAL)) as BACKLOG_VAL,
sum(decode(i.BACKLOG_LAST1,'',0,i.BACKLOG_LAST1)) as BACKLOG_LAST1,
sum(decode(i.BACKLOG_LAST2,'',0,i.BACKLOG_LAST2)) as BACKLOG_LAST2,
sum(decode(i.BACKLOG_LAST3,'',0,i.BACKLOG_LAST3)) as BACKLOG_LAST3
from [EMAIL PROTECTED] i,
( select distinct interface_name
from [EMAIL PROTECTED]
where category='Provisioning'
)a
where SYSTEM_NAME is not null
and a.interface_name = i.system_name
group by a.interface_name
)
group by interface_name