# 22. Virtuoso Functions Guide - composite_ref

Chapter Contents | Prev | Next
Keyword Search:
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
vt_batch_update
vt_drop_ftt
composite
composite_ref
contains
vt_batch
vt_batch_d_id
vt_batch_feed
vt_batch_feed_offban...
vt_create_text_index
vt_is_noise
Hashing / Cryptographic
LDAP
Locale
Mail
Miscellaneous
Number
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

## composite_ref

get member of a composite object
integer composite_ref (in c any, in nth integer);
Parameters
nth – integer
Return types

The type returned is the type of the composite member referred to.

Description

composite_ref returns the nth element of the composite. The index is 0 based.

Errors

22023 | FT002 | composite expected for composite ref |
22003 | FT003 | composite index out of range %d for length %d |

Examples
Simple example

Get first member of a composite consisting of VARCHAR values.

    SQL> select composite_ref (composite ('Miles','Herbie','Wayne','Ron','Tony'), 0);
    callret
    VARCHAR
    _______________________________________________________________________________

    Miles

    1 Rows. -- 4 msec.

See Also

The Composite Data Type for a definition of the properties of composite objects.

The function composite.