SQL-J Language Reference,
Page 115 of 118


[top]
[prev]
[next]
Documentation Top
Global Index
Reference Manual
TOC Index
Grammar index
Developer's Guide
TOC Index
Tuning Cloudscape
TOC Index

INSTANCEOF Expression

An INSTANCEOF expression evaluates to a BOOLEAN. It returns TRUE if the type of the expression is an implementation or subtype of the JavaClassName type. If the expression evaluates to NULL, the INSTANCEOF expression returns FALSE.

Syntax

Expression INSTANCEOF [ JavaClassName | ClassAlias ]

NEW: The INSTANCEOF operator works with the new class alias construct. See “CREATE CLASS ALIAS statement”.

In the situation in which a class alias and a Java class name shared the same name, Cloudscape finds the Java class name first.

Example

SELECT * FROM People
WHERE person INSTANCEOF JBMSTours.serializabletypes.Adult
-- Adult is a class alias
SELECT * FROM People
WHERE person INSTANCEOF Adult
-- Verifying the type of a class’s field
SELECT customized_tour->begin INSTANCEOF java.sql.Date
FROM CustomizedTours
[top]
[prev]
[next]


Cloudscape Version 3.0
For technical support, go to: www.cloudscape.com and click Support.
Copyright © 1998 and 1999 Cloudscape, Inc. All rights reserved.