qdb_collation_ext()

Change the runtime configuration of a user-defined collation sequence

Synopsis:

#include <qdb/qdb.h>

int qdb_collation_ext( qdb_hdl_t *db, void *data, int nbytes, int reindex ); 

Arguments:

db
A pointer to the database handle.
data
A pointer to memory containing arbitrary configuration data followed by the name of the collation being configured. The data and collation name must be separated by the AT sign (@).
The data portion of the argument is optional; if you don't provide data, the QDB service resets the configuration of the named collation to its default setting. If you do provide data, it must be in the format expected by the collation's setup function.
nbytes
The length of data, in bytes.
reindex
A flag to indicate if QDB should reindex any database indexes that would be affected by changing the collations. If any indexes exist that have a COLLATE component, then these must be regenerated to reflect the potentially new sorting order.

Library:

qdb

Description:

This function configures a specific user-defined collation sequence registered for a database. To be registered, this sequence must be listed under the Collation option in the database's configuration object. The setup() function of the collation is invoked with the specified data and nbytes, and any error raised by that function is returned to the client.

The data argument contains the setup data as well as the collation name, with both items separated by an AT sign (@). The format of the setup data is based on the implementation of the setup function. Thus, you can use any data format so long as it's supported by the named collation sequence. For example, you can pass zh_CN as data to the icu collation by passing zh_CN@icu into data.

You can include @ characters in the data. If you do, QDB looks for the last @ and treats this as the delimiter marking the start of the collation name. So you could also provide the following data to the icu collation, with this data argument: zh@collation=pinyin@icu

If you don't provide any data and name only the routine (e.g., by providing a data value of icu), QDB resets the collation to its default setting. For details on implementing setup functions, which read this data to configure collation routines, see Collation routines.

Returns:

0
Success.
-1
An error occurred (errno is set).

Classification:

QNX Neutrino

Safety:  
Interrupt handler No
Signal handler No
Thread Yes