Previous Next

PL/SQL Functions, SQL Operators:

There are quite a few user-accessible PL/SQL functions and SQL operators implemented for the cartridge. All are stateless. All of the PL/SQL functions are contained in a PL/SQL package called 'ddpackage'. This package is owned by 'c$dcischem'. Privileges required to access these functions are granted by the 'daycart' role.

The default installation (create.sql) also creates public synonyms for the package 'ddpackage' and all of the operators described herein. Hence, from any Oracle user, one can access the functions and operators by the signature documented below (eg: select tanimoto(...) from table rather than select c$dcischem.tanimoto(...) from table).

The one place where synonyms aren't allowed is in indextype specifications; hence you must refer to indextypes by their full names when creating indexes as a user other than c$dcischem (eg. create index <name> on small(smi) indextype is c$dcischem.ddblob).

String Data Handling:

Daycart supports both VARCHAR2 and CLOB string datatypes interchangeably in all the Daycart functions, operators, and index searches. At runtime Oracle uses argument overloading to transparently handle the strings arguments passed into the Daycart functions.

The only time that the developer needs to consider the string types passed to Daycart functions is for functions which return strings. Since Oracle doesn't transparently handle returned types, the developer must be aware of the string type returned from a function. Consider the function fsmi2cansmi(), which is documented as the following:

function ddpackage.fsmi2cansmi ( 
             smiles IN VARCHAR2_OR_CLOB,
             type IN NUMBER 
         ) 
    => VARCHAR2_OR_CLOB

Internally, there are two separate entrypoints provided within Daycart:

function ddpackage.fsmi2cansmi (
             smiles IN VARCHAR2,
             type IN NUMBER
         )
    => VARCHAR2

function ddpackage.fsmi2cansmi (
             smiles IN CLOB,
             type IN NUMBER
         )
    => CLOB

Note that if the string argument passed into smi2cansmi() is a VARCHAR2, then the function will always return a VARCHAR2. Similarly, if the string argument is a CLOB, the function will always return a CLOB.

In general, Daycart functions which return strings will return the same string type which was passed into the function as the 'key' string parameter. In the above example, it is obvious that since the smiles input argument is being operated on, that the type returned should match the input smiles type.

The only Daycart functions which take multiple input strings and also return a string are the partnorm(), atomnorm(), and bondnorm() functions. For these three functions, the 'key' argument is the ntuple-list data. This is the data being operated on in the function and hence is the input string type which determines the returned type.

General Purpose Functions:

The general purpose functions are typically used for debugging only. Operators and public synonyms are not created for these functions during the installation. Hence, the functions fsetdebug(), ftestlicense(), and finfo() must be referenced by their fully-qualified names (eg. c$dcischem.ddpackage.ftestlicense()).

function ddpackage.fsetdebug ( 
             value IN NUMBER
         )
    => NUMBER

Controls the level of detail of messages logged to the file: "/tmp/extproc.log". Sets the new value of the logging level to 'value'. Returns the prior value. Valid values are integers the range of 0 - 9.

    0 - No logging at all.
    1 - Error messages only (the default value).
    5 - Warnings and errors.
    9 - Notes, warnings, and errors.

This value is set on a per-session basis. Other values are reserved for future use.

function ddpackage.ftestlicense (
             product IN VARCHAR2_OR_CLOB
         )
    => NUMBER

Checks the cartridge license. Takes an input parameter, which is the license type to check. [ In the current release, the only recognized value is 'daycart' ]. Returns 1 if the Daylight cartridge has a valid license, and 0 otherwise.

The license is contained in a special table which must be created and populated at cartridge install time.

function ddpackage.finfo (
             which in VARCHAR2_OR_CLOB
         )
    => VARCHAR2_OR_CLOB

Returns informational strings from DayCart. Valid input parameters are:

    'toolkit_version' -  Returns the current Daylight Toolkit version.
    'daycart_version' -  Returns the cartridge executable version.
    'extproc_pid'     -  Returns the extproc process ID for this DayCart session.
    'hostid'          -  Returns the hardware hostid used for generation of the
                         license key.
function ddpackage.fsetinfo (
             which in VARCHAR2_OR_CLOB
         )
    => NUMBER

Allows the user to set session-level options in DayCart. Valid input parameters are:

    'vcs_table_cache={on|off}' - Sets the state of the cache of the 
                                 salt and transform tables.
    'default_fpsize={nbits}'   - Sets the default number of bits for
                                 all fingerprint operations.  Valid
                                 values are 32 - 16384.

Molecule / Reaction Functions:

function ddpackage.fsmi2cansmi (
             smiles IN VARCHAR2_OR_CLOB,
             type IN NUMBER
         )
    => VARCHAR2_OR_CLOB

operator smi2cansmi (
             smiles IN VARCHAR2_OR_CLOB,
             type IN NUMBER
         )
     => VARCHAR2_OR_CLOB

Canonicalize an input SMILES. Returns a canonical SMILES string. Type is either 0 or 1, for unique or absolute SMILES, respectively.

function ddpackage.fsmi2xsmi (
             smiles IN VARCHAR2_OR_CLOB,
             type IN NUMBER,
             explicit IN NUMBER
         )
    => VARCHAR2_OR_CLOB

operator smi2xsmi (
             smiles IN VARCHAR2_OR_CLOB,
             type IN NUMBER,
             explicit IN NUMBER
         )
    => VARCHAR2_OR_CLOB

Return an exchange SMILES. Returns a SMILES string which is semantically identical to the input but which does not use Daylight-specific aromaticity conventions. Type is either 0 or 1, for unique or absolute SMILES, respectively. When 'explicit' is 1, it supplies hydrogen count and other atomic properties explicitly for every atom. Note that exchange SMILES are not canonical; the same input molecule or reaction may return different exchange SMILES depending on the input order to this function.

function ddpackage.fsmi2netch (
             smiles IN VARCHAR2_OR_CLOB
         )
    => NUMBER

operator smi2netch (
             smiles IN VARCHAR2_OR_CLOB
         )
    => NUMBER

Return the net charge of the molecule or reaction.

function ddpackage.fsmi2hcount (
             smiles IN VARCHAR2_OR_CLOB
         )
    => NUMBER

operator smi2hcount (
             smiles IN VARCHAR2_OR_CLOB
         )
    => NUMBER

Return the total hydrogen count for the molecule or reaction.

function ddpackage.fsmi2mf (
             smiles IN VARCHAR2_OR_CLOB
         )
    => VARCHAR2_OR_CLOB

operator smi2mf (
             smiles IN VARCHAR2_OR_CLOB
         )
    => VARCHAR2_OR_CLOB

Returns the molecular formula string for the molecule or reaction.

function ddpackage.fsmi2amw (
             smiles IN VARCHAR2_OR_CLOB
         )
    => NUMBER

operator smi2amw (
             smiles IN VARCHAR2_OR_CLOB
         )
    => NUMBER

Return the average molecular weight for a molecule or reaction. The weight used for any atoms which do not have specified isotopes is the average atomic weight. The weight used for atoms with a specified isotope is the high precision molecular weight for that atom. For example, "c1ccccc1" returns 78.1184, the average molecular weight, while "[1H][12c]1[12c]([1H])[12c]([1H])[12c]([1H])[12c]([1H])[12c]1[1H]" returns 78.0469502, the high precision molecular weight for that particular isotope.

function ddpackage.fsmi2graph (
             smiles IN VARCHAR2_OR_CLOB
         )
    => VARCHAR2_OR_CLOB 

operator smi2graph (
             smiles IN VARCHAR2_OR_CLOB
         )
    => VARCHAR2_OR_CLOB 

Return the hydrogen- and charge-suppressed canonical graph string for a given molecule or reaction.

function ddpackage.fvcs_desalt(
             smiles IN VARCHAR2_OR_CLOB,
             type IN NUMBER,
             class IN NUMBER(7,0)
         )
    => VARCHAR2_OR_CLOB

operator vcs_desalt(
             smiles IN VARCHAR2_OR_CLOB,
             type IN NUMBER,
             class IN NUMBER(7,0)
         )
    => VARCHAR2_OR_CLOB

Removes molecule fragments found in the c$dcischem.salts table from the SMILES. Type is either 0 or 1, for unique or absolute SMILES, respectively. The class value is the class of salts entries used from the salts table. All of the structures in the salts table with the given class are checked against the input SMILES and if found, they are removed.

function ddpackage.fvcs_normalize(
             smiles IN VARCHAR2_OR_CLOB,
             type IN NUMBER,
             class IN NUMBER(7,0)
         )
    => VARCHAR2_OR_CLOB

operator vcs_normalize(
             smiles IN VARCHAR2_OR_CLOB,
             type IN NUMBER,
             class IN NUMBER(7,0)
         )
    => VARCHAR2_OR_CLOB

Performs a SMIRKS-based structure normalization on the input SMILES. All of the SMIRKS from the c$dcischem.transform table with the given class are applied to the input molecule. The resulting molecule is output as a canonical SMILES. Type is either 0 or 1 for unique or absolute SMILES, respectively.

Fingerprint Functions:

function ddpackage.fsmi2fp (
             smiles IN VARCHAR2_OR_CLOB,
             min IN NUMBER,
             max IN NUMBER,
             nbits IN NUMBER
         )
    => VARCHAR2_OR_CLOB 

operator smi2fp (
             smiles IN VARCHAR2_OR_CLOB,
             min IN NUMBER,
             max IN NUMBER,
             nbits IN NUMBER
         )
    => VARCHAR2_OR_CLOB 

Returns the ASCII fingerprint for a given molecule or reaction. Min and max are the minimum and maximum pathlengths, respectively, and size is the number of bits in the fingerprint.

function ddpackage.fsmi2xfp (
             smiles IN VARCHAR2_OR_CLOB,
             min IN NUMBER,
             max IN NUMBER,
             nbits IN NUMBER
         )
   => VARCHAR2_OR_CLOB 

operator smi2xfp (
             smiles IN VARCHAR2_OR_CLOB,
             min IN NUMBER,
             max IN NUMBER,
             nbits IN NUMBER
         )
    => VARCHAR2_OR_CLOB 

Return the ASCII difference fingerprint for a given molecule or reaction. Min and max are the minimum and maximum pathlengths, respectively, and size is the nubmer of bits in the fingerprint.

function ddpackage.ffoldfp (
             fpstr IN VARCHAR2_OR_CLOB,
             nbits IN NUMBER,
             dens IN NUMBER
         )
    => VARCHAR2_OR_CLOB

operator foldfp (
             fpstr IN VARCHAR2_OR_CLOB,
             nbits IN NUMBER,
             dens IN NUMBER
         )
    => VARCHAR2_OR_CLOB

Fold the given fingerprint to the minimum appropriate size or density, whichever is limiting, and returns the new, folded fingerprint.

function ddpackage.fbitcount (
             fpstr IN VARCHAR2_OR_CLOB
         )
    => NUMBER

operator bitcount (
             fpstr IN VARCHAR2_OR_CLOB
         )
    => NUMBER

Return the number of bits on in the fingerprint.

function ddpackage.fnbits (
             fpstr IN VARCHAR2_OR_CLOB
         )
    => NUMBER

operator nbits (
             fpstr IN VARCHAR2_OR_CLOB
         )
    => NUMBER

Return the total size of the fingerprint, in bits. In the current Daylight toolkit this will always be a power of two.

function ddpackage.fisfp (
             fpstr IN VARCHAR2_OR_CLOB
         )
    => NUMBER

operator isfp (
             fpstr IN VARCHAR2_OR_CLOB
         )
    => NUMBER

Return 1 if the string is a fingerprint, 0 otherwise. The syntax of a fingerprint can never be confused with a valid SMILES. This is the bit of cleverness which allows us to overload the searching functions.

function ddpackage.fatomnorm (
             smiles IN VARCHAR2_OR_CLOB,
             list IN VARCHAR2_OR_CLOB,
             ntuple IN NUMBER,
             isotype IN NUMBER
         )
    => VARCHAR2_OR_CLOB

operator atomnorm (
             smiles IN VARCHAR2_OR_CLOB,
             list IN VARCHAR2_OR_CLOB,
             ntuple IN NUMBER,
             isotype IN NUMBER
         )
    => VARCHAR2_OR_CLOB

function ddpackage.fbondnorm (
             smiles IN VARCHAR2_OR_CLOB,
             list IN VARCHAR2_OR_CLOB,
             ntuple IN NUMBER,
             isotype IN NUMBER
         )
    => VARCHAR2_OR_CLOB

operator bondnorm (
             smiles IN VARCHAR2_OR_CLOB,
             list IN VARCHAR2_OR_CLOB,
             ntuple IN NUMBER,
             isotype IN NUMBER
         )
    => VARCHAR2_OR_CLOB

function ddpackage.fpartnorm (
             smiles IN VARCHAR2_OR_CLOB,
             list IN VARCHAR2_OR_CLOB,
             ntuple IN NUMBER,
             isotype IN NUMBER
         )
    => VARCHAR2_OR_CLOB

operator partnorm (
             smiles IN VARCHAR2_OR_CLOB,
             list IN VARCHAR2_OR_CLOB,
             ntuple IN NUMBER,
             isotype IN NUMBER
         )
    => VARCHAR2_OR_CLOB

Returns a potentially reordered N-tuple string for the given list input parameter. The list string is a comma-separated list of data which is associated in order with the atoms, bonds or parts of the input SMILES. The list string is reordered based on the canonical atom, bond, or part ordering of the input SMILES. ntuple is the number of comma-separated values per atom, bond, or dot-separated part, and isotype is 0 for unique SMILES canonicalization and 1 for absolute SMILES canonicalization.

Comparison Functions:
function ddpackage.fexact (
             a IN VARCHAR2_OR_CLOB,
             b IN VARCHAR2_OR_CLOB
         )
    => NUMBER

operator exact (
             a IN VARCHAR2_OR_CLOB,
             b IN VARCHAR2_OR_CLOB
         )
    => NUMBER

Returns 1 if the two input strings are identical, 0 otherwise. The operator is optionally backed by the ddexact indextype.

function ddpackage.fgraph (
             smiles1 IN VARCHAR2_OR_CLOB,
             smiles2 IN VARCHAR2_OR_CLOB
         )
    => NUMBER

operator graph (
             smiles1 IN VARCHAR2_OR_CLOB,
             smiles2 IN VARCHAR2_OR_CLOB
         )
    => NUMBER

Returns 1 if the two input SMILES share the same canonical graph, 0 otherwise. The operator is optionally backed by the ddgraph indextype.

function ddpackage.ftautomer (
             smiles1 IN VARCHAR2_OR_CLOB,
             smiles2 IN VARCHAR2_OR_CLOB
         )
    => NUMBER

operator tautomer (
             smiles1 IN VARCHAR2_OR_CLOB,
             smiles2 IN VARCHAR2_OR_CLOB
         )
    => NUMBER

Returns 1 if the two input SMILES share the same canonical graph, net charge, and total hydrogen count, 0 otherwise. The operator is optionally backed by the ddgraph indextype.

function ddpackage.fusmiles (
             smiles1 IN VARCHAR2_OR_CLOB,
             smiles2 IN VARCHAR2_OR_CLOB
         )
    => NUMBER

operator usmiles (
             smiles1 IN VARCHAR2_OR_CLOB,
             smiles2 IN VARCHAR2_OR_CLOB
         )
    => NUMBER

Returns 1 if the two input SMILES share the same unique canonical smiles, 0 otherwise. The operator is optionally backed by the ddgraph indextype.

function ddpackage.fasmiles (
             smiles1 IN VARCHAR2_OR_CLOB,
             smiles2 IN VARCHAR2_OR_CLOB
         )
    => NUMBER

operator asmiles (
             smiles1 IN VARCHAR2_OR_CLOB,
             smiles2 IN VARCHAR2_OR_CLOB
         )
    => NUMBER

Returns 1 if the two input SMILES share the same absolute canonical smiles, 0 otherwise. The operator is optionally backed by the ddgraph indextype.

function ddpackage.fcomponent (
             smiles1 IN VARCHAR2_OR_CLOB,
             smiles2 IN VARCHAR2_OR_CLOB
         )
    => NUMBER

operator component (
             smiles1 IN VARCHAR2_OR_CLOB,
             smiles2 IN VARCHAR2_OR_CLOB
         )
    => NUMBER

Returns 1 if smiles2 (a molecule SMILES) is a component of smiles1 (any SMILES), otherwise returns 0. Also returns false if smiles2 is not a single-component query. The last example in the table below illustrates this problem. The operator is optionally backed by the ddrole indextype. A component is a single dot-separated part of a larger molecule or reaction SMILES. Some examples follow:

smiles1 smiles2  Returns
CCCCCC1
CCC.CCCNCCC1
CCC.CCCNCCCN1
CCC>>CCCNCCC1
CCC>>CCCNCCCN1
CCC.CCCNCCC.CCCN0
function ddpackage.freactant (
             smiles1 IN VARCHAR2_OR_CLOB,
             smiles2 IN VARCHAR2_OR_CLOB
         )
    => NUMBER

operator reactant (
             smiles1 IN VARCHAR2_OR_CLOB,
             smiles2 IN VARCHAR2_OR_CLOB
         )
    => NUMBER

function ddpackage.fagent (
             smiles1 IN VARCHAR2_OR_CLOB,
             smiles2 IN VARCHAR2_OR_CLOB
         )
    => NUMBER

operator agent (
             smiles1 IN VARCHAR2_OR_CLOB,
             smiles2 IN VARCHAR2_OR_CLOB
         )
    => NUMBER

function ddpackage.fproduct (
             smiles1 IN VARCHAR2_OR_CLOB,
             smiles2 IN VARCHAR2_OR_CLOB
         )
    => NUMBER

operator product (
             smiles1 IN VARCHAR2_OR_CLOB,
             smiles2 IN VARCHAR2_OR_CLOB
         )
    => NUMBER

Returns 1 if smiles2 (a molecule SMILES) is a component of smiles1 (a reaction SMILES) with the appropriate role, otherwise returns 0. The operators are optionally backed by the ddrole indextype.

function ddpackage.fcontains (
             smiles1 IN VARCHAR2_OR_CLOB,
             smiles2 IN VARCHAR2_OR_CLOB
         )
    => NUMBER

function ddpackage.fcontains (
             smiles1 IN VARCHAR2_OR_CLOB,
             smiles2 IN VARCHAR2_OR_CLOB,
             count IN NUMBER
         )
    => NUMBER

operator contains (
             smiles1 IN VARCHAR2_OR_CLOB,
             smiles2 IN VARCHAR2_OR_CLOB
         )
    => NUMBER

operator contains (
             smiles1 IN VARCHAR2_OR_CLOB,
             smiles2 IN VARCHAR2_OR_CLOB,
             count IN NUMBER
         )
    => NUMBER

Returns 1 if smiles1 contains smiles2; that is, smiles2, assuming opened valences for all hydrogens, is a substructure of smiles1. The operator is optionally backed by the ddblob indextype.

The optional count argument is ignored in the functional forms. It is used in the index implementation as the desired number of hits to be returned. When used, the best 'count' hits will be returned that meet the search criteria.

function ddpackage.fisin (
             smiles1 IN VARCHAR2_OR_CLOB,
             smiles2 IN VARCHAR2_OR_CLOB
         )
    => NUMBER

function ddpackage.fisin (
             smiles1 IN VARCHAR2_OR_CLOB,
             smiles2 IN VARCHAR2_OR_CLOB,
             count IN NUMBER
         )
    => NUMBER

operator isin (
             smiles1 IN VARCHAR2_OR_CLOB,
             smiles2 IN VARCHAR2_OR_CLOB
         )
    => NUMBER

operator isin (
             smiles1 IN VARCHAR2_OR_CLOB,
             smiles2 IN VARCHAR2_OR_CLOB,
             count IN NUMBER
         )
    => NUMBER

Returns 1 if smiles2 contains smiles1; that is, smiles1, assuming opened valences for all hydrogens, is a substructure of smiles2. This functionality is identical to 'contains()' with the arguments swapped. The operator is optionally backed by the ddblob indextype.

The optional count argument is ignored in the functional forms. It is used in the index implementation as the desired number of hits to be returned. When used, the best 'count' hits will be returned that meet the search criteria.

function ddpackage.fmatches (
             smiles IN VARCHAR2_OR_CLOB,
             smarts IN VARCHAR2_OR_CLOB
         )
    => NUMBER

operator matches (
             smiles IN VARCHAR2_OR_CLOB,
             smarts IN VARCHAR2_OR_CLOB
         )
    => NUMBER

Returns 1 if the smarts expression matches the given SMILES, 0 otherwise. The operator is optionally backed by the ddblob indextype.

function ddpackage.feuclid (
             fp_or_smi1 IN VARCHAR2_OR_CLOB,
             fp_or_smi2 IN VARCHAR2_OR_CLOB
         )
    => NUMBER

function ddpackage.feuclid (
             fp_or_smi1 IN VARCHAR2_OR_CLOB,
             fp_or_smi2 IN VARCHAR2_OR_CLOB,
             count IN NUMBER
         )
    => NUMBER

operator euclid (
             fp_or_smi1 IN VARCHAR2_OR_CLOB,
             fp_or_smi2 IN VARCHAR2_OR_CLOB
         )
    => NUMBER

operator euclid (
             fp_or_smi1 IN VARCHAR2_OR_CLOB,
             fp_or_smi2 IN VARCHAR2_OR_CLOB,
             count IN NUMBER
         )
    => NUMBER

Return the euclidean distance between two fingerprints or SMILES. If both parameters are fingerprints and are not the same size (nbits()), then the larger will be folded automatically to match the size of the smaller before comparison. If one parameter is a SMILES, its fingerprint is generated automatically at the size of the other parameter. If both parameters are SMILES, then a fingerprint size of 512 bits is used. The returned value is a floating point number between 0.0 and 1.0. This is optionally backed by the ddblob indextype.

The optional count argument is ignored in the functional forms. It is used in the index implementation as the desired number of hits to be returned. When used, the best 'count' hits will be returned that meet the search criteria.

function ddpackage.ftanimoto (
             fp_or_smi1 IN VARCHAR2_OR_CLOB,
             fp_or_smi2 IN VARCHAR2_OR_CLOB
         )
    => NUMBER

function ddpackage.ftanimoto (
             fp_or_smi1 IN VARCHAR2_OR_CLOB,
             fp_or_smi2 IN VARCHAR2_OR_CLOB,
             count IN NUMBER
         )
    => NUMBER

operator tanimoto (
             fp_or_smi1 IN VARCHAR2_OR_CLOB,
             fp_or_smi2 IN VARCHAR2_OR_CLOB
         )
    => NUMBER

operator tanimoto (
             fp_or_smi1 IN VARCHAR2_OR_CLOB,
             fp_or_smi2 IN VARCHAR2_OR_CLOB,
             count IN NUMBER
         )
    => NUMBER

Return the tanimoto distance between two fingerprints or SMILES. If both parameters are fingerprints and are not the same size (nbits()), then the larger will be folded automatically to match the size of the smaller before comparison. If one parameter is a SMILES, its fingerprint is generated automatically at the size of the other parameter. If both parameters are SMILES, then a fingerprint size of 512 bits is used. The returned value is a floating point number between 0.0 and 1.0. This is optionally backed by the ddblob indextype.

The optional count argument is ignored in the functional forms. It is used in the index implementation as the desired number of hits to be returned. When used, the best 'count' hits will be returned that meet the search criteria.

function ddpackage.ftversky (
             fp_or_smi1 IN VARCHAR2_OR_CLOB,
             fp_or_smi2 IN VARCHAR2_OR_CLOB,
             alpha IN NUMBER,
             beta IN NUMBER
         )
    => NUMBER

function ddpackage.ftversky (
             fp_or_smi1 IN VARCHAR2_OR_CLOB,
             fp_or_smi2 IN VARCHAR2_OR_CLOB,
             alpha IN NUMBER,
             beta IN NUMBER,
             count IN NUMBER
         )
    => NUMBER

operator tversky (
             fp_or_smi1 IN VARCHAR2_OR_CLOB,
             fp_or_smi2 IN VARCHAR2_OR_CLOB,
             alpha IN NUMBER,
             beta IN NUMBER
         )
    => NUMBER

operator tversky (
             fp_or_smi1 IN VARCHAR2_OR_CLOB,
             fp_or_smi2 IN VARCHAR2_OR_CLOB,
             alpha IN NUMBER,
             beta IN NUMBER,
             count IN NUMBER
         )
    => NUMBER

Return the tversky distance between two fingerprints or SMILES. If both parameters are fingerprints and are not the same size (nbits()), then the larger will be folded automatically to match the size of the smaller before comparison. If one parameter is a SMILES, its fingerprint is generated automatically at the size of the other parameter. If both parameters are SMILES, then a fingerprint size of 512 bits is used. The returned value is a floating point number between 0.0 and 1.0. This is optionally backed by the ddblob indextype.

The optional count argument is ignored in the functional forms. It is used in the index implementation as the desired number of hits to be returned. When used, the best 'count' hits will be returned that meet the search criteria.

function ddpackage.ffingertest (
             fp_or_smi1 IN VARCHAR2_OR_CLOB,
             fp_or_smi2 IN VARCHAR2_OR_CLOB
         )
    => NUMBER

function ddpackage.ffingertest (
             fp_or_smi1 IN VARCHAR2_OR_CLOB,
             fp_or_smi2 IN VARCHAR2_OR_CLOB
             count IN NUMBER
         )
    => NUMBER

operator fingertest (
             fp_or_smi1 IN VARCHAR2_OR_CLOB,
             fp_or_smi2 IN VARCHAR2_OR_CLOB
         )
    => NUMBER

operator fingertest (
             fp_or_smi1 IN VARCHAR2_OR_CLOB,
             fp_or_smi2 IN VARCHAR2_OR_CLOB,
             count IN NUMBER
         )
    => NUMBER

Returns 1 if all of the bits in fp_or_smi2 are also present in fp_or_smi1. That is, the fingerprint from fp_or_smi2 represents a possible substructure of fp_or_smi1. If both parameters are fingerprints and are not the same size (nbits()), then the larger will be folded automatically to match the size of the smaller before comparison. If one parameter is a SMILES, its fingerprint is generated automatically at the size of the other parameter. If both parameters are SMILES, then a fingerprint size of 512 bits is used. The returned value is a floating point number between 0.0 and 1.0. This is optionally backed by the ddblob indextype.

The optional count argument is ignored in the functional forms. It is used in the index implementation as the desired number of hits to be returned. When used, the best 'count' hits will be returned that meet the search criteria.

Program Object Functions:

There are two lower-level functions which invoke program objects. It is expected that they will almost always be called from a PL/SQL wrapper layer, which would be responsible for packaging the communication between Oracle and the program object in a meaningful way. Hence, the default cartridge installation does not create operators for these two functions.

function ddpackage.fprogob (
             name IN VARCHAR2_OR_CLOB,
             message IN VARCHAR2_OR_CLOB
         )
    => VARCHAR2_OR_CLOB

Communicates with a program object running on the Oracle server. The parameter 'name' is the symbolic name of the program object. The table c$dcischem.progob contains the mappings of symbolic names to actual executable programs. The function fprogob() proceeds as follows:

  1. Looks up the symbolic name in the table c$dcischem.progob,
  2. If the executable is not already running, starts the program object,
  3. Parses the 'message' parameter into a sequence of strings,
  4. Sends the sequence of strings to the program object,
  5. Takes the returned sequence of strings and converts it into a newline delimited VARCHAR2_OR_CLOB,
  6. Returns the VARCHAR2_OR_CLOB string.

Valid delimiters for the lines in the 'message' parameter include the normal line-termination characters for UNIX, Mac, and PC: '\n', '\r', and '\r\n'. The function properly handles all three termination cases. The returned VARCHAR2_OR_CLOB string is delimited by UNIX line-termination '\n'.