www.openlinksw.com
docs.openlinksw.com

Book Home

Contents
Preface

Virtuoso Functions Guide

Administration
Aggregate Functions
Array Manipulation
BPEL APIs
Backup
Compression
Cursor
Date & Time Manipulation
Debug
Dictionary Manipulation
Encoding & Decoding
File Manipulation
Free Text
Hashing / Cryptographic
LDAP
Locale
Mail
Miscellaneous
Number
abs
atof
bit_and
bit_not
bit_or
bit_shift
bit_xor
ceiling
either
equ
exp
floor
isdouble
isfloat
isinteger
isnumeric
iszero
log
log10
lower
mod
power
randomize
rnd
sign
sqrt
trigonometric
RDF data
Remote SQL Data Source
Replication
SOAP
SQL
String
Transaction
Type Mapping
UDDI
User Defined Types & The CLR
Virtuoso Java PL API
Virtuoso Server Extension Interface (VSEI)
Web Server & Internet
XML
XPATH & XQUERY

Functions Index

either

conditionally return one of specified parameters
either (in cond any, in arg1 any, in arg2 any);
Parameters
cond – Anything
arg1 – Anything
arg2 – Anything
Return values

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

Description

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

Errors
SQLState Error Code Error Text Description

Examples
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.