# 22. Virtuoso Functions Guide - sinv_create_key_mapping

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
Hashing / Cryptographic
LDAP
Locale
Mail
Miscellaneous
Number
Remote SQL Data Source
Replication
SOAP
SQL
__any_grants
close
collation_define
complete_table_name
delay
end_result
exec
exec_next
exec_result
exec_result_names
identity_value
name_part
registry_get
registry_get_all
registry_name_is_pro...
registry_remove
registry_set
result
result_names
row_count
sequence_get_all
sequence_next
sequence_remove
sequence_set
set_identity_column
set_row_count
set_user_id
signal
sinv_create_inverse
sinv_create_key_mapp...
sinv_drop_inverse
sys_stat_analyze
sys_stat_histogram
table_drop_policy
table_set_policy
username
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

## sinv_create_key_mapping

Creates a key mapping function & table (as described in the doc section SQL Inverse Functions).
sinv_create_key_mapping (in map_name varchar, in part_defs any, in do_drops integer := 1);
Parameters
map_name – (string) the name of the mapping. This becomes the name of the forward function (from parts to single int value) and participates in the name of the lookup table (like MAP_<map_name>)
part_defs – contains an array of name/type pairs describing the parts of the mapping. The types are used in the MAP table as column types and the type names are used in naming the referse functions (one for each part) like : <map_name>_<part_name>
do_drops – integer (0, 1, 2 : default value 1) this controls how the function will go about dropping the already existing objects:

- 0 - don't issue any DROP TABLE/PROCEDURE/INVERSE calls, just the CREATE statements
- 1 - do the DROPs before issuing the actual CREATE statements
- 2 - do *only* the DROPs without the CREATEs.

See Also

sinv_create_inverse, sinv_drop_inverse