0

I use Ibatis version 1.6

I know that ibatis can read value from array parameter. This is my code

SELECT count(1)
  FROM
    TB_R_SW103_TAM r
  WHERE
    AND convert(DATE,r.TAM_APPROVED_DATE) between convert(DATE, #[0]#)
    AND convert(DATE, #[1]#)

But I need to check the value first, if it's empty or not.

SELECT count(1)
  FROM
    TB_R_SW103_TAM r
  WHERE
    <isNotEmpty prepend="" property="[0]">
       AND convert(DATE,r.TAM_APPROVED_DATE) between convert(DATE, #[0]#)
       AND convert(DATE, #[1]#)
    </isNotEmpty>

But when I do this I got an error.

An object or column name is missing or empty. For SELECT INTO statements, verify each column has a name. For other statements, look for empty alias names. Aliases defined as "" or [] are not allowed. Change the alias to a valid name.

How can I do that? For some reasons, I have to use array as my parameter to that query. Is it possible?

Please I need some help here good guys.

HadidM
  • 65
  • 6

1 Answers1

0

Ooopss my bad.

Apparently I use CDATA tag before my query.

I put my query in xml file. And to simplify my query, I use CDATA tag to avoid using special char for "<" etc.

After I close CDATA Tag before Ibatis Code, everythings going well.

Thank you so much my good guys.

HadidM
  • 65
  • 6