var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: LET clause in combination with IN
in my User Definied Function, I would like to define a variable with a LET clause:
In the User Defined Function, I want to check, if a String(of type VARCHAR) has at lease one book(one number in the variable Books):
LET Books = (#1#, #39#, #40#, #55#)
But it didnt work. How can I express this in SQL:
if(Books IN myString) then 'direct'
if there is at least one of these book numbers, write 'direct'
Thank you guys.
Give an example of myString to make it easier to understand ..
You may try
It is not very clear how you get the value of Books - i mean, where it comes from.
IF (LOCATE(myString,Books)>0) then direct
Also, what version of DB2 and Platform are you on?
Visit the new-look IDUG Website
, register to gain access to the excellent content.
thank you for the reply.
myString is a column from type VARCHAR which looks like this:
I would like to define a variable Books like this:
LET Books = (#1#, #40#)
And now, if there is at least one number from Books in myString, it should just write 'direct'. You have an idea?
in my User Definied Function, I have coded this:
It run succesfully. But this one went wrong:
case when(...) then 'write_something'
Does it have something to do with BEGIN ATOMIC or return?
if(...) then 'write_something'