Name

either — conditionally return one of specified parameters

Synopsis

either ( in cond any ,
in arg1 any ,
in arg2 any );

Description

either returns a copy of arg1 if cond is something else than integer 0 (zero). Otherwise, a copy of arg2 is returned.

Parameters

cond

Anything

arg1

Anything

arg2

Anything

Return values

A copy of arg1 or arg2, which could be of any type.

Errors

Table24.26.Errors signalled by either and stringdate

SQLState Error Code Error Text Description

Examples

Example24.97.Simple Example

SQL> select either (mod (1, 2), 'odd', 'even');
callret
VARCHAR
_______________________________________________________________________________

odd

1 Rows. -- 33 msec.
SQL> select either (isnull (strstr ('Simurg', 'imu')), 'imu not found', 'imu found');
callret
VARCHAR
_______________________________________________________________________________

imu found

1 Rows. -- 4 msec.