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
dict_dec_or_remove
dict_duplicate
dict_get
dict_inc_or_put
dict_iter_next
dict_iter_rewind
dict_list_keys
dict_new
dict_put
dict_remove
dict_size
dict_to_vector
Encoding & Decoding
File Manipulation
Free Text
Hashing / Cryptographic
LDAP
Locale
Mail
Miscellaneous
Number
Phrases
RDF data
Remote SQL Data Source
Replication
SOAP
SQL
String
Transaction
Type Mapping
UDDI
User Defined Types & The CLR
VAD
Virtuoso Java PL API
Virtuoso Server Extension Interface (VSEI)
Web & Internet
XML
XPATH & XQUERY

Functions Index

dict_list_keys

Returns an array of all keys stored in the given dictionary.
vector dict_list_keys (inout dict dictionary, in destructive any);
Description

The function returns an array of all keys stored in the given dictionary, ignoring dependent parts of key-value pairs. This is especially useful when dictionary is used to form a set of distinct keys, when dependent parts are fake (typically zeroes). If the destructive parameter is 1 or 2 then the function may avoid copying of keys to the resulting array by moving them out from the dictionary. This is faster but the dictionary will become empty at the end of operation. The destructive parameter equal to 1 does not have any effect if the dictionary is used as a value of more than one variable. Thus it is safe to make this parameter equal to 1 as soon as the variable passed to the function as dict is no longer in use after the function call and there's no need to inspect the whole program to check if other variables may be affected. The parameter equal to 2 ignores the presence of multiple variables so the operation may cause unexpected results in other fragments of code that share the dictionary.

The created array can not be longer than the system limit and even if it is below limit but longer than hundreds of thousands items then memory allocation can be inefficient. If the dictionary can be large and it is possible to process the content of the dictionary in parts, consider using dict_destructive_list_rnd_keys() instead.

Parameters
dict – The dictionary to scan
destructive – Flag that indicates whether the dictionary can be cleaned during the operation (0 = never clean, 1 = only if there is no other variables, 2 = clean unconditionally).
Return Types

The function returns a vector.

See Also

dict_new

dict_zap

dict_put

dict_get

dict_remove

dict_inc_or_put

dict_dec_or_remove

dict_size

dict_duplicate

dict_to_vector

dict_destructive_list_rnd_keys

dict_iter_rewind

dict_iter_next