ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Abeyratne, Sam" <sam.abeyra...@cingular.com>
Subject RE: Is there a way to remove the quotation marks that ibatis inserts when using #[]# on the <iterate> tag?
Date Mon, 18 Apr 2005 19:51:05 GMT
Hey Brandon,

I downloaded your latest build and tried using ?[]? While passing a
ListArray, but I am getting the following error:

Cause: java.sql.SQLException: ORA-01729: database link name expected


Any ideas?
Thanks!
Sam


<select id="queryInterfaceBacklogs_DUAL" parameterClass="java.util.List"
resultMap="interface_backlog_result"
cacheModel="interface_backlog_cache">
      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
      (
      <iterate open="(" close=")" conjunction="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 INTERFACE_STATUS i,
          ( select distinct interface_name
          from interface@?[]?
          where category='Provisioning'
          )a
        where SYSTEM_NAME is not null
        and a.interface_name = i.system_name
        group by a.interface_name
        </iterate>
      )
      group by interface_name
  </select>




from INTERFACE_STATUS i,           ( select distinct interface_name
from interface@?[1]?           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   

2005-04-18 11:23:26,118 [HttpRequestHandler-74] DEBUG
java.sql.PreparedStatement - {pstm-100007} Parameters: []

2005-04-18 11:23:26,118 [HttpRequestHandler-74] DEBUG
java.sql.PreparedStatement - {pstm-100007} Types: []

2005-04-18 11:23:26,769 [HttpRequestHandler-74] DEBUG
com.ibatis.common.jdbc.SimpleDataSource - Returned connection 169 to
pool.

2005-04-18 11:23:26,779 [HttpRequestHandler-74] ERROR pmt.BaseDAO.class
- Exception caught in performDualQuery

com.ibatis.common.jdbc.exception.NestedSQLException:   
--- The error occurred while applying a parameter map.  
--- Check the queryInterfaceBacklogs_DUAL-InlineParameterMap.  
--- Check the statement (query failed).  
--- Cause: java.sql.SQLException: ORA-01729: database link name expected

Caused by: java.sql.SQLException: ORA-01729: database link name expected
at
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQuery
WithCallback(GeneralStatement.java:180)



-----Original Message-----
From: Brandon Goodin [mailto:brandon.goodin@gmail.com] 
Sent: Monday, April 18, 2005 10:16 AM
To: ibatis-user-java@incubator.apache.org
Subject: Re: Is there a way to remove the quotation marks that ibatis
inserts when using #[]# on the <iterate> tag?

Sam,

$[]$ should work. I tested it this weekend and it worked fine.

Brandon

On 4/18/05, Abeyratne, Sam <sam.abeyratne@cingular.com> wrote:
> Hi Brice,
> 
> That does not work. Simply because I am passing a list array. And for
a
> List the ibatis syntax is #[]#. I tried doing something like #?[]?#
but
> that does not work.
> 
> Thanks!
> Sam
> 
> -----Original Message-----
> From: Brice Ruth [mailto:bdruth@gmail.com]
> Sent: Friday, April 15, 2005 6:32 PM
> To: ibatis-user-java@incubator.apache.org
> Subject: Re: Is there a way to remove the quotation marks that ibatis
> inserts when using #[]# on the <iterate> tag?
> 
> use $ in place of the #, that way it won't be quoted.
> 
> On 4/15/05, Abeyratne, Sam <sam.abeyratne@cingular.com> wrote:
> >
> >
> >
> > I want to use the <iterate> tag to create an sql statement.
> >
> >
> >
> > If I have something like table_name@#[]# and the first value in the
> list for
> > example is database1, it really translates to
table_name@'database1'.
> This
> > fails because of the single quotes. Is there a way to remove these
> single
> > quotes? Meaning, translate table_name@#[]# to table_name@mmsdev1?
> >
> >
> >
> > Any assiatnce would be much appreciated!
> >
> > Thanks!
> >
> > Sam
> 
> --
> Brice Ruth
> Software Engineer, Madison WI
> 
>



Mime
View raw message