How to use Parameter's Length in SQL query

1

How to use Parameter's Length and substring for parameter's length in SQL query?

I want to swith WHERE clause by length of parameter.

like this;

SELECT XXX FROM ZZZZ

WHERE

   if length of $P{A} >= 10 then 

      WHERE fieldA = substring( $P{A}, 10, (length of $P{A} - 10) )

   else

      WHERE fieldA = $P{A}

   endif

 

 

 

t.k's picture
t.k
7
Joined: Jan 29 2014 - 12:42am
Last seen: 2 months 1 week ago

0 Answers:

No answers yet
Feedback
randomness