Jump to content

How to use Parameter's Length in SQL query


t.k

Recommended Posts

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

 

 

 

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...