Test a value and replace the content

Test a value and replace the content

Post by Stepha » Sat, 12 Jul 2003 17:59:13



Hi,

I can't remember the  SQL String function with 3 args that tests a value :

("text to test", "test" , "value is the test is OK")

if "text to test" = "test" the function returns "value is the test is OK"
else the function returns "text to test"

Thanks in advance,

Stephane.

 
 
 

Test a value and replace the content

Post by Pablo Sanche » Sat, 12 Jul 2003 21:09:00




Quote:> Hi,

> I can't remember the SQL String function with 3 args that tests a
> value :

> ("text to test", "test" , "value is the test is OK")

> if "text to test" = "test" the function returns "value is the test
> is OK" else the function returns "text to test"

I think you're thinking of the Oracle function DECODE() which does
this.  You can do this now in Sybase (and Oracle) using the CASE()
statement.
--
Pablo Sanchez, Blueoak Database Engineering
http://www.blueoakdb.com