{ ************************************************************************* }
{                                                                           }
{  Licensed Materials - Property of IBM and/or HCL                                     }
{                                                                           }
{  IBM Informix Dynamic Server                                              }
{  (c) Copyright IBM Corporation 1996, 2004 All rights reserved.            }
{  (c) Copyright HCL Technologies Ltd. 2017.  All Rights Reserved.             }
{                                                                           }
{ ************************************************************************* }
{                                                                           }
{   Title:      boot90.sql                                                  }
{                                                                           }
{   Description:                                                            }
{       Bootstrapping script for a 9.0 database, run during database        }
{       construction.                                                       }
{                                                                           }
{ ************************************************************************* }
{                                                                           }
{  ** IMPORTANT - PLEASE READ                                               } 
{                                                                           }
{     All types and routines referenced in this file must be prefixed       }
{     with the user name "informix". E.g., use "informix.boolean"           }
{     and not "boolean"                                                     }
{									    }
{     Also, please follow the formatting conventions!!!                     }
{                                                                           }
{ ************************************************************************* }

-- Add sysdomains view during database construction
create view informix.sysdomains (id, owner, name, type) as
       select extended_id, owner, name, type from informix.sysxtdtypes
              where domain = 'D';

grant select on informix.sysdomains to public as informix;

-- Create user predefined data types
create opaque type informix.lvarchar 
(
	internallength=variable,
	alignment = 1,
	maxlen = 2048
);

create opaque type informix.sendrecv 
(
	internallength=variable,
	alignment = 1,
	maxlen = 2048,
	cannothash
);

create opaque type informix.impexp 
(
	internallength=variable,
	alignment = 1,
	maxlen = 2048,
	cannothash
);

create opaque type informix.impexpbin
(
	internallength=variable,
	alignment = 1,
	maxlen = 2048,
	cannothash
);

create opaque type informix.boolean
(
	internallength=1,
	alignment = 1,
	passedbyvalue
);


create opaque type informix.pointer 
(
	internallength=4,
	alignment = 1,
	passedbyvalue
);

create opaque type informix.indexkeyarray
(
	internallength=variable,
	alignment = 4,
	maxlen = 1024,
	cannothash
);

-- Let us create the output function for this. We do not need an input function
create function informix.indexkeyarray_out(informix.indexkeyarray)
returning informix.lvarchar
external name '(indexkeyarray_out)' language C
not variant;

create function informix.indexkeyarray_send(informix.indexkeyarray)
returning informix.sendrecv
external name '(indexkeyarray_send)' language C
not variant;

create explicit cast (informix.indexkeyarray as informix.lvarchar
                with informix.indexkeyarray_out);

create explicit cast (informix.indexkeyarray as informix.sendrecv
                with informix.indexkeyarray_send);

-- Used to create the sysindexes view definition
create function informix.ikeyextractcolno(informix.indexkeyarray, integer)
returning smallint
external name '(ikeyextractcolno)' language C
not variant;

-- Default opclass for btrees: btree_ops
create opclass informix.btree_ops for btree
strategies (lessthan, lessthanorequal, equal, greaterthanorequal, greaterthan)
support (compare);

create opaque type informix.rtnparamtypes
(
	internallength=variable,
	alignment = 1,
	maxlen = 4096,
	cannothash
);

-- Let us create the output function for this. We do not need an input function
create function informix.rtn_param_out(informix.rtnparamtypes)
returning informix.lvarchar specific paramtypes_out 
external name '(rtn_param_out)' language C
not variant;

create cast (informix.rtnparamtypes as informix.lvarchar with informix.rtn_param_out);

{ ifx_param_ids, ifx_ret_ids, ifx_param_types, ifx_ret_types         }
{ functions to display the type identifiers or names of the          }
{ parameters and return types of routines. integer argument          }
{ is the procid, e.g. select ifx_ret_ids(procid) from sysprocedures; } 

create function informix.ifx_param_ids(integer)
returning informix.lvarchar
external name '(spr_param_ids)' language c;

create function informix.ifx_ret_ids(integer)
returning informix.lvarchar
external name '(spr_ret_ids)' language c;

create function informix.ifx_param_types(integer)
returning informix.lvarchar
external name '(spr_param_types)' language c;

create function informix.ifx_ret_types(integer)
returning informix.lvarchar
external name '(spr_ret_types)' language c;

create opaque type informix.selfuncargs
(
	internallength=24,
	alignment = 1,
	cannothash
);

create opaque type informix.blob
(
	internallength=72,
	alignment = 4,
	cannothash
);

create opaque type informix.clob
(
internallength=72,
	alignment = 4,
	cannothash
);

create opaque type informix.lolist
(
	internallength=variable,
	alignment = 4,
	maxlen = 2048,
	cannothash
);

-- lolist function and cast definitions
create function informix.lolist_in(informix.lvarchar) 
	returns informix.lolist
        external name '(lolist_in)'
        language C not variant;
 
create function informix.lolist_out(informix.lolist) 
	returns informix.lvarchar
        external name '(lolist_out)'
        language C not variant;
 
create function informix.lolist_send(informix.lolist) 
	returns informix.sendrecv
        external name '(lolist_send)'
        language C not variant;

create function informix.lolist_recv(informix.sendrecv) 
	returns informix.lolist
        external name '(lolist_recv)'
        language C not variant;

create implicit cast (informix.lvarchar as informix.lolist with 
	informix.lolist_in); 

create explicit cast (informix.lolist as informix.lvarchar with 
	informix.lolist_out); 

create implicit cast (informix.sendrecv as informix.lolist with 
	informix.lolist_recv); 

create explicit cast (informix.lolist as informix.sendrecv with 
	informix.lolist_send); 
 
-- booloen function definitions
create function informix.equal(informix.boolean, informix.boolean)
        returns informix.boolean
        external name '(boolean_equal)'
        language C not variant;
 
create function informix.notequal(informix.boolean, informix.boolean)
        returns informix.boolean
        external name '(boolean_notequal)'
        language C not variant;

create function informix.compare(informix.boolean, informix.boolean)
        returns integer
        external name '(boolean_compare)'
        language C not variant;

-- cast function definitions
create function informix.collcast(set) returns set
        external name '(collcast)' language C not variant;
create function informix.collcast(multiset) returns multiset
        external name '(collcast)' language C not variant;
create function informix.collcast(list) returns list
        external name '(collcast)' language C not variant;
create function informix.rowcast(row) returns row
        external name '(rowcast)' language C not variant;

-- Collection function definitions
create function informix.collectionoutput(set) returns informix.lvarchar
        external name '(collectionoutput)' language C not variant;
create function informix.collectionoutput(multiset) returns informix.lvarchar
        external name '(collectionoutput)' language C not variant;
create function informix.collectionoutput(list) returns informix.lvarchar
        external name '(collectionoutput)' language C not variant;

create function informix.collectioninput(informix.lvarchar) returns set
        external name '(collectioninput)' language C not variant;

-- Send/recv Collection Functions
create function informix.collectionrecv(informix.sendrecv) returns set
        external name '(collectionrecv)' language C not variant;

create function informix.collectionsend(set) returns informix.sendrecv
        external name '(collectionsend)' language C not variant;
create function informix.collectionsend(multiset) returns informix.sendrecv
        external name '(collectionsend)' language C not variant;
create function informix.collectionsend(list) returns informix.sendrecv
        external name '(collectionsend)' language C not variant;

-- Row Functions
create function informix.rowoutput(row) returns informix.lvarchar
        external name '(rowoutput)' language C not variant;

create function informix.rowinput(informix.lvarchar) returns row
        external name '(rowinput)' language C not variant;

create function informix.rowrecv(informix.sendrecv) returns row
        external name '(rowrecv)' language C not variant;

create function informix.rowsend(row) returns informix.sendrecv
        external name '(rowsend)' language C not variant;

create function informix.assign(row) returns row   
	external name '(rowassign)' language C not variant;

create function informix.destroy(row) returns row 
	external name '(rowdestroy)' language C not variant;

create function informix.compare(row, row) returns integer
	external name '(rowcompare)' language C not variant;

create function informix.equal(row, row) returns informix.boolean 
	external name '(rowequal)' language C not variant;

create function informix.notequal(row, row) returns informix.boolean 
	external name '(rownotequal)' language C not variant;

create function informix.assign(set) returns set 
	external name '(collectionassign)' language C not variant;
create function informix.assign(multiset) returns multiset
	external name '(collectionassign)' language C not variant;
create function informix.assign(list) returns list
	external name '(collectionassign)' language C not variant;

create function informix.destroy(set) returns set
	external name '(collectiondestroy)' language C not variant;
create function informix.destroy(multiset) returns multiset
	external name '(collectiondestroy)' language C not variant;
create function informix.destroy(list) returns list
	external name '(collectiondestroy)' language C not variant;

-- blob and clob support functions with informix.their associated casts

create function informix.blobinput(informix.lvarchar) returns informix.blob
	external name '(blob_input)'
	language c not variant;

create function informix.clobinput(informix.lvarchar) returns informix.clob
	external name '(clob_input)'
	language c not variant;

create implicit cast (informix.lvarchar as informix.blob with 
	informix.blobinput);

create implicit cast (informix.lvarchar as informix.clob with 
	informix.clobinput);

create function informix.bloboutput(informix.blob) returns informix.lvarchar
	external name '(blob_output)'
	language c not variant;

create function informix.cloboutput(informix.clob) returns informix.lvarchar
	external name '(clob_output)'
	language c not variant;

create explicit cast (informix.blob as informix.lvarchar with 
	informix.bloboutput);
create explicit cast (informix.clob as informix.lvarchar with 
	informix.cloboutput);

create function informix.blobrecv(informix.sendrecv) 
	returns informix.blob
	external name '(blob_recv)'
	language c not variant;

create function informix.clobrecv(informix.sendrecv) 
	returns informix.clob
	external name '(clob_recv)'
	language c not variant;

create implicit cast (informix.sendrecv as informix.blob with 
	informix.blobrecv);
create implicit cast (informix.sendrecv as informix.clob with 
	informix.clobrecv);

create function informix.blobsend(informix.blob) returns informix.sendrecv
	external name '(blob_send)'
	language c not variant;

create function informix.clobsend(informix.clob) returns informix.sendrecv
	external name '(clob_send)'
	language c not variant;

create implicit cast (informix.blob as informix.sendrecv with 
	informix.blobsend);
create implicit cast (informix.clob as informix.sendrecv with 
	informix.clobsend);

create function informix.blobimport(informix.impexp) 
	returns informix.blob
	external name '(blob_import)'
	language c not variant;

create function informix.clobimport(informix.impexp) 
	returns informix.clob
	external name '(clob_import)'
	language c not variant;

create implicit cast (informix.impexp as informix.blob with 
	informix.blobimport);
create implicit cast (informix.impexp as informix.clob with 
	informix.clobimport);

create function informix.blobexport(informix.blob) 
	returns informix.impexp
	external name '(blob_export)'
	language c not variant;

create function informix.clobexport(informix.clob) 
	returns informix.impexp
	external name '(clob_export)'
	language c not variant;

create implicit cast (informix.blob as informix.impexp with 	
	informix.blobexport);
create implicit cast (informix.clob as informix.impexp with 
	informix.clobexport);

create function informix.assign(informix.blob) 
	returns informix.blob
	external name '(blob_assign)'
	language c not variant;

create function informix.assign(informix.clob) 
	returns informix.clob
	external name '(clob_assign)'
	language c not variant;

create function informix.destroy(informix.blob) 
	returns informix.blob
	external name '(blob_destroy)'
	language c not variant;

create function informix.destroy(informix.clob) 
	returns informix.clob
	external name '(clob_destroy)'
	language c not variant;

create function informix.lohandles(informix.blob) 
	returns informix.lolist
	external name '(blob_handles)'
	language c not variant;

create function informix.lohandles(informix.clob) 
	returns informix.lvarchar
	external name '(blob_handles)'
	language c not variant;


-- blob and clob user functions

create function informix.filetoblob(informix.lvarchar, char(6)) 
	returns informix.blob
	external name '(blob_from_file)'
	language c variant;

create function informix.filetoclob(informix.lvarchar, char(6)) 
	returns informix.clob
	external name '(blob_from_file)' -- yes blob_from_file
	language c variant;

create function informix.filetoblob(informix.lvarchar, char(6), char(18), char(18)) 
	returns informix.blob
	external name '(blob_from_file_colspec)'
	language c variant;

create function informix.filetoclob(informix.lvarchar, char(6), char(18), char(18)) 
	returns informix.clob
	external name '(blob_from_file_colspec)'
	language c variant;

create function informix.lotofile(informix.blob, informix.lvarchar, char(6)) returns informix.lvarchar
	external name '(blob_to_file)'
	language c variant;

create function informix.lotofile(clob, informix.lvarchar, char(6)) returns informix.lvarchar
	external name '(blob_to_file)'
	language c variant;

create function informix.locopy(informix.blob) 	
	returns informix.blob
	external name '(blob_copy)'
	language c variant;

create function informix.locopy(informix.blob, char(18), char(18)) 
	returns informix.blob
	external name '(blob_copy_colspec)'
	language c variant;

create function informix.locopy(informix.clob) 	
	returns informix.clob
	external name '(blob_copy)'
	language c variant;

create function informix.locopy(informix.clob, char(18), char(18)) 
	returns informix.clob
	external name '(blob_copy_colspec)'
	language c variant;

create function informix.equal(informix.blob, informix.blob) 
	returns informix.boolean
	external name '(clob_equal)'
	language c variant;

create function informix.equal(informix.clob, informix.clob) 
	returns informix.boolean
	external name '(clob_equal)'
	language c variant;

create function informix.compare(informix.blob, informix.blob) 
	returns integer
        external name '(blob_cmp)'
        language C variant;

create function informix.compare(informix.clob, informix.clob) 
	returns integer
        external name '(blob_cmp)'
        language C variant;

{Types to support fastpathing of lo operations}
create opaque type informix.ifx_lo_spec
(
internallength = 160,
alignment = 8
);

create opaque type informix.ifx_lo_stat
(
internallength = 208,
alignment = 8
);

create function informix.send(informix.ifx_lo_spec) 
	returns informix.sendrecv
	external name '(send_ifx_lo_spec)' 
	language c not variant;

create function informix.send(informix.ifx_lo_stat) 
	returns informix.sendrecv
	external name '(send_ifx_lo_stat)' 
	language c not variant;

create function informix.recv_spec(informix.sendrecv) 
	returns informix.ifx_lo_spec
	external name '(recv_ifx_lo_spec)' 
	language c not variant;

create function informix.recv_stat(informix.sendrecv) 
	returns informix.ifx_lo_stat
	external name '(recv_ifx_lo_stat)' 
	language c not variant;

create cast (informix.ifx_lo_spec as informix.sendrecv with 
	informix.send);

create cast (informix.ifx_lo_stat as informix.sendrecv with 
	informix.send);

create implicit cast (informix.sendrecv as informix.ifx_lo_spec with 
	informix.recv_spec);
create implicit cast (informix.sendrecv as informix.ifx_lo_stat with 
	informix.recv_stat);

-- fastpath entry points to support client sblob I/O
create function informix.ifx_lo_create(ifx_lo_spec, integer, out informix.blob)
	returns integer
	external name '(sq_lo_create)' 
	language c; {this is variant}

create function informix.ifx_lo_open(informix.blob, integer)
	returns integer
	external name '(sq_lo_open)' 
	language c; {this is variant}

create function informix.ifx_lo_close(integer)
	returns integer
	external name '(sq_lo_close)' 
	language c;

create function informix.ifx_lo_truncate(integer, int8)
	returns integer
	external name '(sq_lo_truncate)' 
	language c;

create function informix.ifx_lo_alter(informix.blob, informix.ifx_lo_spec)
	returns integer
	external name '(sq_lo_alter)' 
	language c;

create function informix.ifx_lo_stat(integer, out informix.ifx_lo_stat)
	returns integer
	external name '(sq_lo_stat)' 
	language c;

create function informix.ifx_lo_tell(integer, out int8)
	returns integer
	external name '(sq_lo_tell)' 
	language c;

create function informix.ifx_lo_seek(integer, int8, integer, out int8)
	returns integer
	external name '(sq_lo_seek)' 
	language c;

create function informix.ifx_lo_filename(informix.blob, informix.lvarchar)
	returns informix.lvarchar
	external name '(sq_lo_filename)' 
	language c;

create function informix.ifx_lo_col_sbinfo(informix.lvarchar, out informix.ifx_lo_spec)
	returns integer
	external name '(sq_lo_col_sblobinfo_by_colname)' 
	language c;

{args: lofd, from-filename, file-flags, file-offset, nbytes}

create function informix.ifx_lo_from_file(int, informix.lvarchar, int, int, int)
	returns integer
	external name '(sq_lo_from_file)' 
	language c;

create function informix.ifx_lo_to_file(informix.blob, informix.lvarchar, int, out int)
	returns informix.lvarchar
	external name '(sq_lo_to_file)' 
	language c;

create function informix.ifx_file_to_file(informix.lvarchar, int, informix.lvarchar, int)
	returns informix.lvarchar
	external name '(sq_file_to_file)' 
	language c;

create function informix.dosyscast(informix.pointer, int, int)
	returning informix.pointer
	external name '(dosyscast)' 
	language C not variant;





create function informix.equal(char, char) returns informix.boolean
        specific ifx_char_equal
	with (commutator = equal, negator = notequal, class = 'CPU',
              not variant)
	external name '9' language builtin;

create function informix.equal(nchar(1), nchar(1)) returns informix.boolean
	specific ifx_nchar_equal
	with (commutator = equal, negator = notequal, class = 'CPU',
              not variant)
	external name '9' language builtin;

create function informix.equal(varchar(1), varchar(1)) returns informix.boolean
	specific ifx_varchar_equal
	with (commutator = equal, negator = notequal, class = 'CPU',
              not variant)
	external name '9' language builtin;

create function informix.equal(nvarchar(1), nvarchar(1)) 
        returns informix.boolean
	specific ifx_nvarchar_equal
	with (commutator = equal, negator = notequal, class = 'CPU',
              not variant)
	external name '9' language builtin;

create function informix.equal(smallint, smallint) returns informix.boolean
	specific ifx_smallint_equal
	with (commutator = equal, negator = notequal, class = 'CPU',
              not variant)
	external name '9' language builtin;

create function informix.equal(int, int) returns informix.boolean
	specific ifx_int_equal
	with (commutator = equal, negator = notequal, class = 'CPU',
              not variant)
	external name '9' language builtin;

create function informix.equal(int8, int8) returns informix.boolean
	specific ifx_int8_equal
	with (commutator = equal, negator = notequal, class = 'CPU',
              not variant)
	external name '9' language builtin;

create function informix.equal(decimal, decimal) returns informix.boolean
	specific ifx_decimal_equal
	with (commutator = equal, negator = notequal, class = 'CPU',
              not variant)
	external name '9' language builtin;

create function informix.equal(real, real) returns informix.boolean
	specific ifx_real_equal
	with (commutator = equal, negator = notequal, class = 'CPU',
              not variant)
	external name '9' language builtin;

create function informix.equal(float, float) returns informix.boolean
	specific ifx_float_equal
	with (commutator = equal, negator = notequal, class = 'CPU',
              not variant)
	external name '9' language builtin;

create function informix.equal(date, date) returns informix.boolean
	specific ifx_date_equal
	with (commutator = equal, negator = notequal, class = 'CPU',
              not variant)
	external name '9' language builtin;

create function informix.equal(datetime year to minute, 
                      datetime year to minute) returns informix.boolean
	specific ifx_datetime_equal
	with (commutator = equal, negator = notequal, class = 'CPU',
              not variant)
	external name '9' language builtin;

create function informix.equal(interval year to month, 
                      interval year to month) returns informix.boolean
	specific ifx_interval_equal
	with (commutator = equal, negator = notequal, class = 'CPU',
              not variant)
	external name '9' language builtin;

create function informix.equal(money, money) returns informix.boolean
	specific ifx_money_equal
	with (commutator = equal, negator = notequal, class = 'CPU',
              not variant)
	external name '9' language builtin;

create function informix.equal(references text, 
                      references text) returns informix.boolean
	specific ifx_text_equal
	with (commutator = equal, negator = notequal, class = 'CPU',
              not variant)
	external name '9' language builtin;

create function informix.equal(references byte, references byte) 
        returns informix.boolean
	specific ifx_byte_equal
	with (commutator = equal, negator = notequal, class = 'CPU',
              not variant)
	external name '9' language builtin;







create function informix.notequal(char, char) returns informix.boolean
	specific ifx_char_not_equal
	with (commutator = notequal, negator = equal, class = 'CPU',
              not variant)
	external name '26' language builtin;

create function informix.notequal(nchar(1), nchar(1)) returns informix.boolean
	specific ifx_nchar_not_equal
	with (commutator = notequal, negator = equal, class = 'CPU',
              not variant)
	external name '26' language builtin;

create function informix.notequal(varchar(1), varchar(1)) 
	returns informix.boolean
	specific ifx_varchar_not_equal
	with (commutator = notequal, negator = equal, class = 'CPU',
              not variant)
	external name '26' language builtin;

create function informix.notequal(nvarchar(1), nvarchar(1)) 
        returns informix.boolean
	specific ifx_nvarchar_not_equal
	with (commutator = notequal, negator = equal, class = 'CPU',
              not variant)
	external name '26' language builtin;

create function informix.notequal(smallint, smallint) returns informix.boolean
	specific ifx_smallint_not_equal
	with (commutator = notequal, negator = equal, class = 'CPU',
              not variant)
	external name '26' language builtin;

create function informix.notequal(int, int) returns informix.boolean
	specific ifx_int_not_equal
	with (commutator = notequal, negator = equal, class = 'CPU',
              not variant)
	external name '26' language builtin;

create function informix.notequal(int8, int8) returns informix.boolean
	specific ifx_int8_not_equal
	with (commutator = notequal, negator = equal, class = 'CPU',
              not variant)
	external name '26' language builtin;

create function informix.notequal(decimal, decimal) returns informix.boolean
	specific ifx_decimal_not_equal
	with (commutator = notequal, negator = equal, class = 'CPU',
              not variant)
	external name '26' language builtin;

create function informix.notequal(real, real) returns informix.boolean
	specific ifx_real_not_equal
	with (commutator = notequal, negator = equal, class = 'CPU',
              not variant)
	external name '26' language builtin;

create function informix.notequal(float, float) returns informix.boolean
	specific ifx_float_not_equal
	with (commutator = notequal, negator = equal, class = 'CPU',
              not variant)
	external name '26' language builtin;

create function informix.notequal(date, date) returns informix.boolean
	specific ifx_date_not_equal
	with (commutator = notequal, negator = equal, class = 'CPU',
              not variant)
	external name '26' language builtin;

create function informix.notequal(datetime year to minute, 
                         datetime year to minute) returns informix.boolean
	specific ifx_datetime_not_equal
	with (commutator = notequal, negator = equal, class = 'CPU',
              not variant)
	external name '26' language builtin;

create function informix.notequal(interval year to month, 
                         interval year to month) returns informix.boolean
	specific ifx_interval_not_equal
	with (commutator = notequal, negator = equal, class = 'CPU',
              not variant)
	external name '26' language builtin;

create function informix.notequal(money, money) returns informix.boolean
	specific ifx_money_not_equal
	with (commutator = notequal, negator = equal, class = 'CPU',
              not variant)
	external name '26' language builtin;

create function informix.notequal(references text, references text) 
        returns informix.boolean
	specific ifx_text_not_equal
	with (commutator = notequal, negator = equal, class = 'CPU',
              not variant)
	external name '26' language builtin;

create function informix.notequal(references byte, references byte) 
        returns informix.boolean
	specific ifx_byte_not_equal
	with (commutator = notequal, negator = equal, class = 'CPU',
              not variant)
	external name '26' language builtin;







create function informix.greaterthan(char, char) returns informix.boolean
        specific ifx_char_greater_than
	with (negator = lessthanorequal, class = 'CPU', not variant)
	external name '13' language builtin;

create function informix.greaterthan(nchar(1), nchar(1)) 
	returns informix.boolean
	specific ifx_nchar_greater_than
	with (negator = lessthanorequal, class = 'CPU', not variant)
	external name '13' language builtin;

create function informix.greaterthan(varchar(1), varchar(1)) 
	returns informix.boolean
	specific ifx_varchar_greater_than
	with (negator = lessthanorequal, class = 'CPU', not variant)
	external name '13' language builtin;

create function informix.greaterthan(nvarchar(1), nvarchar(1)) 
	returns informix.boolean
	specific ifx_nvarchar_greater_than
	with (negator = lessthanorequal, class = 'CPU', not variant)
	external name '13' language builtin;

create function informix.greaterthan(smallint, smallint) 
	returns informix.boolean
	specific ifx_smallint_greater_than
	with (negator = lessthanorequal, class = 'CPU', not variant)
	external name '13' language builtin;

create function informix.greaterthan(int, int) returns informix.boolean
	specific ifx_int_greater_than
	with (negator = lessthanorequal, class = 'CPU', not variant)
	external name '13' language builtin;

create function informix.greaterthan(int8, int8) returns informix.boolean
	specific ifx_int8_greater_than
	with (negator = lessthanorequal, class = 'CPU', not variant)
	external name '13' language builtin;

create function informix.greaterthan(decimal, decimal) 
	returns informix.boolean
	specific ifx_decimal_greater_than
	with (negator = lessthanorequal, class = 'CPU', not variant)
	external name '13' language builtin;

create function informix.greaterthan(real, real) returns informix.boolean
	specific ifx_real_greater_than
	with (negator = lessthanorequal, class = 'CPU', not variant)
	external name '13' language builtin;

create function informix.greaterthan(float, float) returns informix.boolean
	specific ifx_float_greater_than
	with (negator = lessthanorequal, class = 'CPU', not variant)
	external name '13' language builtin;

create function informix.greaterthan(date, date) returns informix.boolean
	specific ifx_date_greater_than
	with (negator = lessthanorequal, class = 'CPU', not variant)
	external name '13' language builtin;

create function informix.greaterthan(datetime year to minute, 
                            datetime year to minute) returns informix.boolean
	specific ifx_datetime_greater_than
	with (negator = lessthanorequal, class = 'CPU', not variant)
	external name '13' language builtin;

create function informix.greaterthan(interval year to month, 
                            interval year to month) returns informix.boolean
	specific ifx_interval_greater_than
	with (negator = lessthanorequal, class = 'CPU', not variant)
	external name '13' language builtin;

create function informix.greaterthan(money, money) returns informix.boolean
	specific ifx_money_greater_than
	with (negator = lessthanorequal, class = 'CPU', not variant)
	external name '13' language builtin;

create function informix.greaterthan(references text, references text) 
        returns informix.boolean
	specific ifx_text_greater_than
	with (negator = lessthanorequal, class = 'CPU', not variant)
	external name '13' language builtin;

create function informix.greaterthan(references byte, references byte) 
        returns informix.boolean
	specific ifx_byte_greater_than
	with (negator = lessthanorequal, class = 'CPU', not variant)
	external name '13' language builtin;










create function informix.lessthan(char, char) returns informix.boolean
	specific ifx_char_less_than
	with (negator = greaterthanorequal, class = 'CPU', not variant)
	external name '18' language builtin;

create function informix.lessthan(nchar(1), nchar(1)) returns informix.boolean
	specific ifx_nchar_less_than
	with (negator = greaterthanorequal, class = 'CPU', not variant)
	external name '18' language builtin;

create function informix.lessthan(varchar(1), varchar(1)) 
	returns informix.boolean
	specific ifx_varchar_less_than
	with (negator = greaterthanorequal, class = 'CPU', not variant)
	external name '18' language builtin;

create function informix.lessthan(nvarchar(1), nvarchar(1)) 
	returns informix.boolean
	specific ifx_nvarchar_less_than
	with (negator = greaterthanorequal, class = 'CPU', not variant)
	external name '18' language builtin;

create function informix.lessthan(smallint, smallint) returns informix.boolean
	specific ifx_smallint_less_than
	with (negator = greaterthanorequal, class = 'CPU', not variant)
	external name '18' language builtin;

create function informix.lessthan(int, int) returns informix.boolean
	specific ifx_int_less_than
	with (negator = greaterthanorequal, class = 'CPU', not variant)
	external name '18' language builtin;

create function informix.lessthan(int8, int8) returns informix.boolean
	specific ifx_int8_less_than
	with (negator = greaterthanorequal, class = 'CPU', not variant)
	external name '18' language builtin;

create function informix.lessthan(decimal, decimal) returns informix.boolean
	specific ifx_decimal_less_than
	with (negator = greaterthanorequal, class = 'CPU', not variant)
	external name '18' language builtin;

create function informix.lessthan(real, real) returns informix.boolean
	specific ifx_real_less_than
	with (negator = greaterthanorequal, class = 'CPU', not variant)
	external name '18' language builtin;

create function informix.lessthan(float, float) returns informix.boolean
	specific ifx_float_less_than
	with (negator = greaterthanorequal, class = 'CPU', not variant)
	external name '18' language builtin;

create function informix.lessthan(date, date) returns informix.boolean
	specific ifx_date_less_than
	with (negator = greaterthanorequal, class = 'CPU', not variant)
	external name '18' language builtin;

create function informix.lessthan(datetime year to minute, 
                         datetime year to minute) returns informix.boolean
	specific ifx_datetime_less_than
	with (negator = greaterthanorequal, class = 'CPU', not variant)
	external name '18' language builtin;

create function informix.lessthan(interval year to month, 
                         interval year to month) returns informix.boolean
	specific ifx_interval_less_than
	with (negator = greaterthanorequal, class = 'CPU', not variant)
	external name '18' language builtin;

create function informix.lessthan(money, money) returns informix.boolean
	specific ifx_money_less_than
	with (negator = greaterthanorequal, class = 'CPU', not variant)
	external name '18' language builtin;

create function informix.lessthan(references text, references text) 
        returns informix.boolean
	specific ifx_text_less_than
	with (negator = greaterthanorequal, class = 'CPU', not variant)
	external name '18' language builtin;

create function informix.lessthan(references byte, references byte) 
        returns informix.boolean
	specific ifx_byte_less_than
	with (negator = greaterthanorequal, class = 'CPU', not variant)
	external name '18' language builtin;











create function informix.greaterthanorequal(char, char) 
	returns informix.boolean
	specific ifx_char_greater_than_or_equal
	with (negator = lessthan, class = 'CPU', not variant)
	external name '12' language builtin;

create function informix.greaterthanorequal(nchar(1), nchar(1)) 
	returns informix.boolean
	specific ifx_nchar_greater_than_or_equal
	with (negator = lessthan, class = 'CPU', not variant)
	external name '12' language builtin;

create function informix.greaterthanorequal(varchar(1), varchar(1)) 
        returns informix.boolean
	specific ifx_varchar_greater_than_or_equal
	with (negator = lessthan, class = 'CPU', not variant)
	external name '12' language builtin;

create function informix.greaterthanorequal(nvarchar(1), nvarchar(1)) 
        returns informix.boolean
	specific ifx_nvarchar_greater_than_or_equal
	with (negator = lessthan, class = 'CPU', not variant)
	external name '12' language builtin;

create function informix.greaterthanorequal(smallint, smallint) 
        returns informix.boolean
	specific ifx_smallint_greater_than_or_equal
	with (negator = lessthan, class = 'CPU', not variant)
	external name '12' language builtin;

create function informix.greaterthanorequal(int, int) returns informix.boolean
	specific ifx_int_greater_than_or_equal
	with (negator = lessthan, class = 'CPU', not variant)
	external name '12' language builtin;

create function informix.greaterthanorequal(int8, int8) 
	returns informix.boolean
	specific ifx_int8_greater_than_or_equal
	with (negator = lessthan, class = 'CPU', not variant)
	external name '12' language builtin;

create function informix.greaterthanorequal(decimal, decimal) 
	returns informix.boolean
	specific ifx_decimal_greater_than_or_equal
	with (negator = lessthan, class = 'CPU', not variant)
	external name '12' language builtin;

create function informix.greaterthanorequal(real, real) 
	returns informix.boolean
	specific ifx_real_greater_than_or_equal
	with (negator = lessthan, class = 'CPU', not variant)
	external name '12' language builtin;

create function informix.greaterthanorequal(float, float) 
	returns informix.boolean
	specific ifx_float_greater_than_or_equal
	with (negator = lessthan, class = 'CPU', not variant)
	external name '12' language builtin;

create function informix.greaterthanorequal(date, date) 
	returns informix.boolean
	specific ifx_date_greater_than_or_equal
	with (negator = lessthan, class = 'CPU', not variant)
	external name '12' language builtin;

create function informix.greaterthanorequal(datetime year to minute, 
                                   datetime year to minute) 
        returns informix.boolean
	specific ifx_datetime_greater_than_or_equal
	with (negator = lessthan, class = 'CPU', not variant)
	external name '12' language builtin;

create function informix.greaterthanorequal(interval year to month, 
                                   interval year to month) 
        returns informix.boolean
	specific ifx_interval_greater_than_or_equal
	with (negator = lessthan, class = 'CPU', not variant)
	external name '12' language builtin;

create function informix.greaterthanorequal(money, money) 
        returns informix.boolean
	specific ifx_money_greater_than_or_equal
	with (negator = lessthan, class = 'CPU', not variant)
	external name '12' language builtin;

create function informix.greaterthanorequal(references text, 
                                   references text) returns informix.boolean
	specific ifx_text_greater_than_or_equal
	with (negator = lessthan, class = 'CPU', not variant)
	external name '12' language builtin;

create function informix.greaterthanorequal(references byte, 
                                   references byte) returns informix.boolean
	specific ifx_byte_greater_than_or_equal
	with (negator = lessthan, class = 'CPU', not variant)
	external name '12' language builtin;








create function informix.lessthanorequal(char, char) returns informix.boolean
	specific ifx_char_less_than_or_equal
	with (negator = greaterthan, class = 'CPU', not variant)
	external name '15' language builtin;

create function informix.lessthanorequal(nchar(1), nchar(1)) 
	returns informix.boolean
	specific ifx_nchar_less_than_or_equal
	with (negator = greaterthan, class = 'CPU', not variant)
	external name '15' language builtin;

create function informix.lessthanorequal(varchar(1), varchar(1)) 
        returns informix.boolean
	specific ifx_varchar_less_than_or_equal
	with (negator = greaterthan, class = 'CPU', not variant)
	external name '15' language builtin;

create function informix.lessthanorequal(nvarchar(1), nvarchar(1)) 
        returns informix.boolean
	specific ifx_nvarchar_less_than_or_equal
	with (negator = greaterthan, class = 'CPU', not variant)
	external name '15' language builtin;

create function informix.lessthanorequal(smallint, smallint) 
	returns informix.boolean
	specific ifx_smallint_less_than_or_equal
	with (negator = greaterthan, class = 'CPU', not variant)
	external name '15' language builtin;

create function informix.lessthanorequal(int, int) returns informix.boolean
	specific ifx_int_less_than_or_equal
	with (negator = greaterthan, class = 'CPU', not variant)
	external name '15' language builtin;

create function informix.lessthanorequal(int8, int8) returns informix.boolean
	specific ifx_int8_less_than_or_equal
	with (negator = greaterthan, class = 'CPU', not variant)
	external name '15' language builtin;

create function informix.lessthanorequal(decimal, decimal) 
	returns informix.boolean
	specific ifx_decimal_less_than_or_equal
	with (negator = greaterthan, class = 'CPU', not variant)
	external name '15' language builtin;

create function informix.lessthanorequal(real, real) returns informix.boolean
	specific ifx_real_less_than_or_equal
	with (negator = greaterthan, class = 'CPU', not variant)
	external name '15' language builtin;

create function informix.lessthanorequal(float, float) 
	returns informix.boolean
	specific ifx_float_less_than_or_equal
	with (negator = greaterthan, class = 'CPU', not variant)
	external name '15' language builtin;

create function informix.lessthanorequal(date, date) returns informix.boolean
	specific ifx_date_less_than_or_equal
	with (negator = greaterthan, class = 'CPU', not variant)
	external name '15' language builtin;

create function informix.lessthanorequal(datetime year to minute, 
                                datetime year to minute) 
	returns informix.boolean
	specific ifx_datetime_less_than_or_equal
	with (negator = greaterthan, class = 'CPU', not variant)
	external name '15' language builtin;

create function informix.lessthanorequal(interval year to month, 
                                interval year to month) 
	returns informix.boolean
	specific ifx_interval_less_than_or_equal
	with (negator = greaterthan, class = 'CPU', not variant)
	external name '15' language builtin;

create function informix.lessthanorequal(money, money) 
	returns informix.boolean
	specific ifx_money_less_than_or_equal
	with (negator = greaterthan, class = 'CPU', not variant)
	external name '15' language builtin;

create function informix.lessthanorequal(references text, 
                                references text) returns informix.boolean
	specific ifx_text_less_than_or_equal
	with (negator = greaterthan, class = 'CPU', not variant)
	external name '15' language builtin;

create function informix.lessthanorequal(references byte, 
                                references byte) returns informix.boolean
	specific ifx_byte_less_than_or_equal
	with (negator = greaterthan, class = 'CPU', not variant)
	external name '15' language builtin;








create function informix.like(char(1), char(1)) returns informix.boolean
	specific ifx_char_like_with_no_escape
	with (class = 'CPU', not variant)
	external name '17' language builtin;

create function informix.like(nchar(1), nchar(1)) returns informix.boolean
	specific ifx_nchar_like_with_no_escape
	with (class = 'CPU', not variant)
	external name '17' language builtin;

create function informix.like(varchar(1), varchar(1)) returns informix.boolean
	specific ifx_varchar_like_with_no_escape
	with (class = 'CPU', not variant)
	external name '17' language builtin;

create function informix.like(nvarchar(1), nvarchar(1)) 
	returns informix.boolean
	specific ifx_nvarchar_like_with_no_escape
	with (class = 'CPU', not variant)
	external name '17' language builtin;

create function informix.like(char(1), char(1), char(1)) 
	returns informix.boolean
	specific ifx_char_like_with_escape
	with (class = 'CPU', not variant)
	external name '17' language builtin;

create function informix.like(nchar(1), nchar(1), nchar(1)) 
	returns informix.boolean
	specific ifx_nchar_like_with_escape
	with (class = 'CPU', not variant)
	external name '17' language builtin;

create function informix.like(varchar(1), varchar(1), varchar(1)) 
        returns informix.boolean
	specific ifx_varchar_like_with_escape
	with (class = 'CPU', not variant)
	external name '17' language builtin;

create function informix.like(nvarchar(1), nvarchar(1), nvarchar(1)) 
        returns informix.boolean
	specific ifx_nvarchar_like_with_escape
	with (class = 'CPU', not variant)
	external name '17' language builtin;







create function informix.matches(char(1), char(1)) returns informix.boolean
	specific ifx_char_matches_binary
	with (class = 'CPU', not variant)
	external name '19' language builtin;

create function informix.matches(nchar(1), nchar(1)) returns informix.boolean
	specific ifx_nchar_matches_binary
	with (class = 'CPU', not variant)
	external name '19' language builtin;

create function informix.matches(varchar(1), varchar(1)) 
	returns informix.boolean
	specific ifx_varchar_matches_binary
	with (class = 'CPU', not variant)
	external name '19' language builtin;

create function informix.matches(nvarchar(1), nvarchar(1)) 
	returns informix.boolean
	specific ifx_nvarchar_matches_binary
	with (class = 'CPU', not variant)
	external name '19' language builtin;

create function informix.matches(char(1), char(1), char(1)) 
	returns informix.boolean
	specific ifx_char_matches_trinary
	with (class = 'CPU', not variant)
	external name '19' language builtin;

create function informix.matches(nchar(1), nchar(1), nchar(1)) 
	returns informix.boolean
	specific ifx_nchar_matches_trinary
	with (class = 'CPU', not variant)
	external name '19' language builtin;

create function informix.matches(varchar(1), varchar(1), varchar(1)) 
        returns informix.boolean
	specific ifx_varchar_matches_trinary
	with (class = 'CPU', not variant)
	external name '19' language builtin;

create function informix.matches(nvarchar(1), nvarchar(1), nvarchar(1)) 
        returns informix.boolean
	specific ifx_nvarchar_matches_trinary
	with (class = 'CPU', not variant)
	external name '19' language builtin;








create function informix.concat(char, char) returns char(1)
	specific ifx_char_concat
	with (class = 'CPU',  commutator = concat, not variant)
	external name '43' language builtin;

create function informix.concat(nchar(1), nchar(1)) returns nchar(1)
	specific ifx_nchar_concat
	with (class = 'CPU',  commutator = concat, not variant)
	external name '43' language builtin;

create function informix.concat(varchar(1), varchar(1)) returns varchar(1)
	specific ifx_varchar_concat
	with (class = 'CPU',  commutator = concat, not variant)
	external name '43' language builtin;

create function informix.concat(nvarchar(1), nvarchar(1)) returns nvarchar(1)
	specific ifx_nvarchar_concat
	with (class = 'CPU',  commutator = concat, not variant)
	external name '43' language builtin;











create function informix.negate(smallint) returns smallint
	specific ifx_smallint_negate
	with (class = 'CPU', not variant)
	external name '23' language builtin;

create function informix.negate(int) returns int
	specific ifx_int_negate
	with (class = 'CPU', not variant)
	external name '23' language builtin;

create function informix.negate(int8) returns int8
	specific ifx_int8_negate
	with (class = 'CPU', not variant)
	external name '23' language builtin;

create function informix.negate(decimal) returns decimal
	specific ifx_decimal_negate
	with (class = 'CPU', not variant)
	external name '23' language builtin;

create function informix.negate(real) returns real
	specific ifx_real_negate
	with (class = 'CPU', not variant)
	external name '23' language builtin;

create function informix.negate(float) returns float
	specific ifx_float_negate
	with (class = 'CPU', not variant)
	external name '23' language builtin;

create function informix.negate(money) 
	returns money
	specific ifx_money_negate
	with (class = 'CPU', not variant)
	external name '23' language builtin;




create function informix.minus(smallint, smallint) returns decimal
	specific ifx_smallint_minus
	with (class = 'CPU', not variant)
	external name '23' language builtin;

create function informix.minus(int, int) returns decimal
	specific ifx_int_minus
	with (class = 'CPU', not variant)
	external name '23' language builtin;

create function informix.minus(int8, int8) returns decimal
	specific ifx_int8_minus
	with (class = 'CPU', not variant)
	external name '23' language builtin;

create function informix.minus(decimal, decimal) returns decimal
	specific ifx_decimal_minus
	with (class = 'CPU', not variant)
	external name '23' language builtin;

create function informix.minus(real, real) returns decimal
	specific ifx_real_minus
	with (class = 'CPU', not variant)
	external name '23' language builtin;

create function informix.minus(float, float) returns decimal
	specific ifx_float_minus
	with (class = 'CPU', not variant)
	external name '23' language builtin;

create function informix.minus(date, date) returns integer
	specific ifx_date_minus
	with (class = 'CPU', not variant)
	external name '23' language builtin;

create function informix.minus
        (datetime year to minute, datetime year to minute) 
	returns interval year to month
	specific ifx_datetime_minus2
	with (class = 'CPU', not variant)
	external name '23' language builtin;

create function informix.minus
        (datetime year to minute, interval year to month) 
	returns interval year to month
	specific ifx_datetime_minus
	with (class = 'CPU', not variant)
	external name '23' language builtin;

create function informix.minus(interval year to month, interval year to month) 
	returns interval year to month
	specific ifx_interval_minus
	with (class = 'CPU', not variant)
	external name '23' language builtin;

create function informix.minus(money, money) 
	returns money
	specific ifx_money_minus
	with (class = 'CPU', not variant)
	external name '23' language builtin;






create function informix.positive(smallint) returns smallint
	specific ifx_smallint_positive
	with (class = 'CPU', not variant)
	external name '35' language builtin;

create function informix.positive(int) returns int
	specific ifx_int_positive
	with (class = 'CPU', not variant)
	external name '35' language builtin;

create function informix.positive(int8) returns int8
	specific ifx_int8_positive
	with (class = 'CPU', not variant)
	external name '35' language builtin;

create function informix.positive(decimal) returns decimal
	specific ifx_decimal_positive
	with (class = 'CPU', not variant)
	external name '35' language builtin;

create function informix.positive(real) returns real
	specific ifx_real_positive
	with (class = 'CPU', not variant)
	external name '35' language builtin;

create function informix.positive(float) returns float
	specific ifx_float_positive
	with (class = 'CPU', not variant)
	external name '35' language builtin;

create function informix.positive(money) 
	returns money
	specific ifx_money_positive
	with (class = 'CPU', not variant)
	external name '35' language builtin;








create function informix.plus(smallint, smallint) returns decimal
	specific ifx_smallint_plus
	with (class = 'CPU', commutator = plus, not variant)
	external name '35' language builtin;

create function informix.plus(int, int) returns decimal
	specific ifx_int_plus
	with (class = 'CPU', commutator = plus, not variant)
	external name '35' language builtin;

create function informix.plus(int8, int8) returns decimal
	specific ifx_int8_plus
	with (class = 'CPU', commutator = plus, not variant)
	external name '35' language builtin;

create function informix.plus(decimal, decimal) returns decimal
	specific ifx_decimal_plus
	with (class = 'CPU', commutator = plus, not variant)
	external name '35' language builtin;

create function informix.plus(real, real) returns decimal
	specific ifx_real_plus
	with (class = 'CPU', commutator = plus, not variant)
	external name '35' language builtin;

create function informix.plus(float, float) returns decimal
	specific ifx_float_plus
	with (class = 'CPU', commutator = plus, not variant)
	external name '35' language builtin;

create function informix.plus(date, date) returns date
	specific ifx_date_plus
	with (class = 'CPU', commutator = plus, not variant)
	external name '35' language builtin;

create function informix.plus(datetime year to minute, interval year to month) 
	returns datetime year to minute
	specific ifx_datetime_plus
	with (class = 'CPU', commutator = plus, not variant)
	external name '35' language builtin;

create function informix.plus(interval year to month, interval year to month) 
	returns interval year to month
	specific ifx_interval_plus
	with (class = 'CPU', commutator = plus, not variant)
	external name '35' language builtin;

create function informix.plus(money, money) 
	returns money
	specific ifx_money_plus
	with (class = 'CPU', commutator = plus, not variant)
	external name '35' language builtin;






create function informix.times(smallint, smallint) returns decimal
	specific ifx_smallint_times
	with (class = 'CPU', commutator = times, not variant)
	external name '25' language builtin;

create function informix.times(int, int) returns decimal
	specific ifx_int_times
	with (class = 'CPU', commutator = times, not variant)
	external name '25' language builtin;

create function informix.times(int8, int8) returns decimal
	specific ifx_int8_times
	with (class = 'CPU', commutator = times, not variant)
	external name '25' language builtin;

create function informix.times(decimal, decimal) returns decimal
	specific ifx_decimal_times
	with (class = 'CPU', commutator = times, not variant)
	external name '25' language builtin;

create function informix.times(real, real) returns decimal
	specific ifx_real_times
	with (class = 'CPU', commutator = times, not variant)
	external name '25' language builtin;

create function informix.times(float, float) returns decimal
	specific ifx_float_times
	with (class = 'CPU', commutator = times, not variant)
	external name '25' language builtin;

create function informix.times(date, date) returns date
	specific ifx_date_times
	with (class = 'CPU', commutator = times, not variant)
	external name '25' language builtin;

create function informix.times(interval year to month, interval year to month) 
	returns interval year to month
	specific ifx_interval_times
	with (class = 'CPU', commutator = times, not variant)
	external name '25' language builtin;

create function informix.times(money, money) 
	returns money
	specific ifx_money_times
	with (class = 'CPU', commutator = times, not variant)
	external name '25' language builtin;









create function informix.divide(smallint, smallint) returns decimal
	specific ifx_smallint_divide
	with (class = 'CPU',  not variant)
	external name '8' language builtin;

create function informix.divide(int, int) returns decimal
	specific ifx_int_divide
	with (class = 'CPU',  not variant)
	external name '8' language builtin;

create function informix.divide(int8, int8) returns decimal
	specific ifx_int8_divide
	with (class = 'CPU',  not variant)
	external name '8' language builtin;

create function informix.divide(decimal, decimal) returns decimal
	specific ifx_decimal_divide
	with (class = 'CPU',  not variant)
	external name '8' language builtin;
 
create function informix.divide(real, real) returns decimal
	specific ifx_real_divide
	with (class = 'CPU',  not variant)
	external name '8' language builtin;

create function informix.divide(float, float) returns decimal
	specific ifx_float_divide
	with (class = 'CPU',  not variant)
	external name '8' language builtin;

create function informix.divide(date, date) returns date
	specific ifx_date_divide
	with (class = 'CPU', not variant)
	external name '8' language builtin;

create function informix.divide
        (interval year to month, interval year to month) 
	returns interval year to month
	specific ifx_interval_divide
	with (class = 'CPU', not variant)
	external name '8' language builtin;

create function informix.divide(money, money) 
	returns decimal
	specific ifx_money_divide
	with (class = 'CPU', not variant)
	external name '8' language builtin;


create function informix.abs(integer)
        returns integer
	specific ifx_integer_abs
	with (class = 'CPU', not variant)
	external name '100' language builtin;

create function informix.abs(smallint)
        returns smallint
	specific ifx_smallint_abs
	with (class = 'CPU', not variant)
	external name '100' language builtin;

create function informix.abs(int8)
        returns int8
	specific ifx_int8_abs
	with (class = 'CPU', not variant)
	external name '100' language builtin;

create function informix.abs(float)
        returns float
	specific ifx_float_abs
	with (class = 'CPU', not variant)
	external name '100' language builtin;

create function informix.abs(smallfloat)
        returns smallfloat
	specific ifx_smallfloat_abs
	with (class = 'CPU', not variant)
	external name '100' language builtin;

create function informix.abs(decimal)
        returns decimal
	specific ifx_decimal_abs
	with (class = 'CPU', not variant)
	external name '100' language builtin;

create function informix.abs(money)
        returns money
	specific ifx_money_abs
	with (class = 'CPU', not variant)
	external name '100' language builtin;

create function informix.abs(varchar(1))
        returns decimal
	specific ifx_varchar_abs
	with (class = 'CPU', not variant)
	external name '100' language builtin;

create function informix.abs(char(1))
        returns decimal
	specific ifx_char_abs
	with (class = 'CPU', not variant)
	external name '100' language builtin;

create function informix.abs(nvarchar(1))
        returns decimal
	specific ifx_nvarchar_abs
	with (class = 'CPU', not variant)
	external name '100' language builtin;

create function informix.abs(nchar(1))
        returns decimal
	specific ifx_nchar_abs
	with (class = 'CPU', not variant)
	external name '100' language builtin;


create function informix.exp(integer)
        returns float
	specific ifx_integer_exp
	with (class = 'CPU', not variant)
	external name '103' language builtin;

create function informix.exp(smallint)
        returns float
	specific ifx_smallint_exp
	with (class = 'CPU', not variant)
	external name '103' language builtin;

create function informix.exp(int8)
        returns float
	specific ifx_int8_exp
	with (class = 'CPU', not variant)
	external name '103' language builtin;

create function informix.exp(float)
        returns float
	specific ifx_float_exp
	with (class = 'CPU', not variant)
	external name '103' language builtin;

create function informix.exp(smallfloat)
        returns float
	specific ifx_smallfloat_exp
	with (class = 'CPU', not variant)
	external name '103' language builtin;

create function informix.exp(decimal)
        returns float
	specific ifx_decimal_exp
	with (class = 'CPU', not variant)
	external name '103' language builtin;

create function informix.exp(money)
        returns float
	specific ifx_money_exp
	with (class = 'CPU', not variant)
	external name '103' language builtin;

create function informix.exp(varchar(1))
        returns float
	specific ifx_varchar_exp
	with (class = 'CPU', not variant)
	external name '103' language builtin;

create function informix.exp(char(1))
        returns float
	specific ifx_char_exp
	with (class = 'CPU', not variant)
	external name '103' language builtin;

create function informix.exp(nvarchar(1))
        returns float
	specific ifx_nvarchar_exp
	with (class = 'CPU', not variant)
	external name '103' language builtin;

create function informix.exp(nchar(1))
        returns float
	specific ifx_nchar_exp
	with (class = 'CPU', not variant)
	external name '103' language builtin;


create function informix.hex(integer)
        returns char(20)
	specific ifx_integer_hex
	with (class = 'CPU', not variant)
	external name '92' language builtin;

create function informix.hex(smallint)
        returns char(20)
	specific ifx_smallint_hex
	with (class = 'CPU', not variant)
	external name '92' language builtin;

create function informix.hex(int8)
        returns char(20)
	specific ifx_int8_hex
	with (class = 'CPU', not variant)
	external name '92' language builtin;

create function informix.hex(float)
        returns char(20)
	specific ifx_float_hex
	with (class = 'CPU', not variant)
	external name '92' language builtin;

create function informix.hex(smallfloat)
        returns char(20)
	specific ifx_smallfloat_hex
	with (class = 'CPU', not variant)
	external name '92' language builtin;

create function informix.hex(decimal)
        returns char(20)
	specific ifx_decimal_hex
	with (class = 'CPU', not variant)
	external name '92' language builtin;

create function informix.hex(money)
        returns char(20)
	specific ifx_money_hex
	with (class = 'CPU', not variant)
	external name '92' language builtin;

create function informix.hex(varchar(1))
        returns char(20)
	specific ifx_varchar_hex
	with (class = 'CPU', not variant)
	external name '92' language builtin;

create function informix.hex(char(1))
        returns char(20)
	specific ifx_char_hex
	with (class = 'CPU', not variant)
	external name '92' language builtin;

create function informix.hex(nvarchar(1))
        returns char(20)
	specific ifx_nvarchar_hex
	with (class = 'CPU', not variant)
	external name '92' language builtin;

create function informix.hex(nchar(1))
        returns char(20)
	specific ifx_nchar_hex
	with (class = 'CPU', not variant)
	external name '92' language builtin;


create function informix.log10(integer)
        returns float
	specific ifx_integer_log10
	with (class = 'CPU', not variant)
	external name '102' language builtin;

create function informix.log10(smallint)
        returns float
	specific ifx_smallint_log10
	with (class = 'CPU', not variant)
	external name '102' language builtin;

create function informix.log10(int8)
        returns float
	specific ifx_int8_log10
	with (class = 'CPU', not variant)
	external name '102' language builtin;

create function informix.log10(float)
        returns float
	specific ifx_float_log10
	with (class = 'CPU', not variant)
	external name '102' language builtin;

create function informix.log10(smallfloat)
        returns float
	specific ifx_smallfloat_log10
	with (class = 'CPU', not variant)
	external name '102' language builtin;

create function informix.log10(decimal)
        returns float
	specific ifx_decimal_log10
	with (class = 'CPU', not variant)
	external name '102' language builtin;

create function informix.log10(money)
        returns float
	specific ifx_money_log10
	with (class = 'CPU', not variant)
	external name '102' language builtin;

create function informix.log10(varchar(1))
        returns float
	specific ifx_varchar_log10
	with (class = 'CPU', not variant)
	external name '102' language builtin;

create function informix.log10(char(1))
        returns float
	specific ifx_char_log10
	with (class = 'CPU', not variant)
	external name '102' language builtin;

create function informix.log10(nvarchar(1))
        returns float
	specific ifx_nvarchar_log10
	with (class = 'CPU', not variant)
	external name '102' language builtin;

create function informix.log10(nchar(1))
        returns float
	specific ifx_nchar_log10
	with (class = 'CPU', not variant)
	external name '102' language builtin;


create function informix.logn(integer)
        returns float
	specific ifx_integer_logn
	with (class = 'CPU', not variant)
	external name '101' language builtin;

create function informix.logn(smallint)
        returns float
	specific ifx_smallint_logn
	with (class = 'CPU', not variant)
	external name '101' language builtin;

create function informix.logn(int8)
        returns float
	specific ifx_int8_logn
	with (class = 'CPU', not variant)
	external name '101' language builtin;

create function informix.logn(float)
        returns float
	specific ifx_float_logn
	with (class = 'CPU', not variant)
	external name '101' language builtin;

create function informix.logn(smallfloat)
        returns float
	specific ifx_smallfloat_logn
	with (class = 'CPU', not variant)
	external name '101' language builtin;

create function informix.logn(decimal)
        returns float
	specific ifx_decimal_logn
	with (class = 'CPU', not variant)
	external name '101' language builtin;

create function informix.logn(money)
        returns float
	specific ifx_money_logn
	with (class = 'CPU', not variant)
	external name '101' language builtin;

create function informix.logn(varchar(1))
        returns float
	specific ifx_varchar_logn
	with (class = 'CPU', not variant)
	external name '101' language builtin;

create function informix.logn(char(1))
        returns float
	specific ifx_char_logn
	with (class = 'CPU', not variant)
	external name '101' language builtin;

create function informix.logn(nvarchar(1))
        returns float
	specific ifx_nvarchar_logn
	with (class = 'CPU', not variant)
	external name '101' language builtin;

create function informix.logn(nchar(1))
        returns float
	specific ifx_nchar_logn
	with (class = 'CPU', not variant)
	external name '101' language builtin;


create function informix.mod(integer, integer)
        returns integer
	specific ifx_integer_mod
	with (class = 'CPU', not variant)
	external name '104' language builtin;

create function informix.mod(smallint, integer)
        returns integer
	specific ifx_smallint_mod
	with (class = 'CPU', not variant)
	external name '104' language builtin;

create function informix.mod(int8, int8)
        returns int8
	specific ifx_int8_mod
	with (class = 'CPU', not variant)
	external name '104' language builtin;

create function informix.mod(float, integer)
        returns integer
	specific ifx_float_mod
	with (class = 'CPU', not variant)
	external name '104' language builtin;

create function informix.mod(smallfloat, integer)
        returns integer
	specific ifx_smallfloat_mod
	with (class = 'CPU', not variant)
	external name '104' language builtin;

create function informix.mod(decimal, integer)
        returns integer
	specific ifx_decimal_mod
	with (class = 'CPU', not variant)
	external name '104' language builtin;

create function informix.mod(money, integer)
        returns integer
	specific ifx_money_mod
	with (class = 'CPU', not variant)
	external name '104' language builtin;

create function informix.mod(varchar(1), integer)
        returns integer
	specific ifx_varchar_mod
	with (class = 'CPU', not variant)
	external name '104' language builtin;

create function informix.mod(char(1), integer)
        returns integer
	specific ifx_char_mod
	with (class = 'CPU', not variant)
	external name '104' language builtin;

create function informix.mod(nvarchar(1), integer)
        returns integer
	specific ifx_nvarchar_mod
	with (class = 'CPU', not variant)
	external name '104' language builtin;

create function informix.mod(nchar(1), integer)
        returns integer
	specific ifx_nchar_mod
	with (class = 'CPU', not variant)
	external name '104' language builtin;


create function informix.pow(integer, float)
        returns float
	specific ifx_integer_pow
	with (class = 'CPU', not variant)
	external name '105' language builtin;

create function informix.pow(smallint, float)
        returns float
	specific ifx_smallint_pow
	with (class = 'CPU', not variant)
	external name '105' language builtin;

create function informix.pow(int8, float)
        returns float
	specific ifx_int8_pow
	with (class = 'CPU', not variant)
	external name '105' language builtin;

create function informix.pow(float, float)
        returns float
	specific ifx_float_pow
	with (class = 'CPU', not variant)
	external name '105' language builtin;

create function informix.pow(smallfloat, float)
        returns float
	specific ifx_smallfloat_pow
	with (class = 'CPU', not variant)
	external name '105' language builtin;

create function informix.pow(decimal, float)
        returns float
	specific ifx_decimal_pow
	with (class = 'CPU', not variant)
	external name '105' language builtin;

create function informix.pow(money, float)
        returns float
	specific ifx_money_pow
	with (class = 'CPU', not variant)
	external name '105' language builtin;

create function informix.pow(varchar(1), float)
        returns float
	specific ifx_varchar_pow
	with (class = 'CPU', not variant)
	external name '105' language builtin;

create function informix.pow(char(1), float)
        returns float
	specific ifx_char_pow
	with (class = 'CPU', not variant)
	external name '105' language builtin;

create function informix.pow(nvarchar(1), float)
        returns float
	specific ifx_nvarchar_pow
	with (class = 'CPU', not variant)
	external name '105' language builtin;

create function informix.pow(nchar(1), float)
        returns float
	specific ifx_nchar_pow
	with (class = 'CPU', not variant)
	external name '105' language builtin;


create function informix.root(integer, float default 2.0)
	returns float
	specific ifx_integer_root
	with (class = 'CPU', not variant)
	external name '106' language builtin;

create function informix.root(smallint, float default 2.0)
	returns float
	specific ifx_smallint_root
	with (class = 'CPU', not variant)
	external name '106' language builtin;

create function informix.root(int8, float default 2.0)
	returns float
	specific ifx_int8_root
	with (class = 'CPU', not variant)
	external name '106' language builtin;

create function informix.root(float, float default 2.0)
	returns float
	specific ifx_float_root
	with (class = 'CPU', not variant)
	external name '106' language builtin;

create function informix.root(smallfloat, float default 2.0)
	returns float
	specific ifx_smallfloat_root
	with (class = 'CPU', not variant)
	external name '106' language builtin;

create function informix.root(decimal, float default 2.0)
	returns float
	specific ifx_decimal_root
	with (class = 'CPU', not variant)
	external name '106' language builtin;

create function informix.root(money, float default 2.0)
	returns float
	specific ifx_money_root
	with (class = 'CPU', not variant)
	external name '106' language builtin;

create function informix.root(varchar(1), float default 2.0)
	returns float
	specific ifx_varchar_root
	with (class = 'CPU', not variant)
	external name '106' language builtin;

create function informix.root(char(1), float default 2.0)
	returns float
	specific ifx_char_root
	with (class = 'CPU', not variant)
	external name '106' language builtin;

create function informix.root(nvarchar(1), float default 2.0)
	returns float
	specific ifx_nvarchar_root
	with (class = 'CPU', not variant)
	external name '106' language builtin;

create function informix.root(nchar(1), float default 2.0)
	returns float
	specific ifx_nchar_root
	with (class = 'CPU', not variant)
	external name '106' language builtin;


create function informix.round(integer, integer default 0)
	returns decimal
	specific ifx_integer_round
	with (class = 'CPU', not variant)
	external name '90' language builtin;

create function informix.round(smallint, integer default 0)
	returns decimal
	specific ifx_smallint_round
	with (class = 'CPU', not variant)
	external name '90' language builtin;

create function informix.round(int8, integer default 0)
	returns decimal
	specific ifx_int8_round
	with (class = 'CPU', not variant)
	external name '90' language builtin;

create function informix.round(float, integer default 0)
	returns decimal
	specific ifx_float_round
	with (class = 'CPU', not variant)
	external name '90' language builtin;

create function informix.round(smallfloat, integer default 0)
	returns decimal
	specific ifx_smallfloat_round
	with (class = 'CPU', not variant)
	external name '90' language builtin;

create function informix.round(decimal, integer default 0)
	returns decimal
	specific ifx_decimal_round
	with (class = 'CPU', not variant)
	external name '90' language builtin;

create function informix.round(money, integer default 0)
	returns decimal
	specific ifx_money_round
	with (class = 'CPU', not variant)
	external name '90' language builtin;

create function informix.round(varchar(1), integer default 0)
	returns decimal
	specific ifx_varchar_round
	with (class = 'CPU', not variant)
	external name '90' language builtin;

create function informix.round(char(1), integer default 0)
	returns decimal
	specific ifx_char_round
	with (class = 'CPU', not variant)
	external name '90' language builtin;

create function informix.round(nvarchar(1), integer default 0)
	returns decimal
	specific ifx_nvarchar_round
	with (class = 'CPU', not variant)
	external name '90' language builtin;

create function informix.round(nchar(1), integer default 0)
	returns decimal
	specific ifx_nchar_round
	with (class = 'CPU', not variant)
	external name '90' language builtin;


create function informix.sqrt(integer)
        returns float
	specific ifx_integer_sqrt
	with (class = 'CPU', not variant)
	external name '107' language builtin;

create function informix.sqrt(smallint)
        returns float
	specific ifx_smallint_sqrt
	with (class = 'CPU', not variant)
	external name '107' language builtin;

create function informix.sqrt(int8)
        returns float
	specific ifx_int8_sqrt
	with (class = 'CPU', not variant)
	external name '107' language builtin;

create function informix.sqrt(float)
        returns float
	specific ifx_float_sqrt
	with (class = 'CPU', not variant)
	external name '107' language builtin;

create function informix.sqrt(smallfloat)
        returns float
	specific ifx_smallfloat_sqrt
	with (class = 'CPU', not variant)
	external name '107' language builtin;

create function informix.sqrt(decimal)
        returns float
	specific ifx_decimal_sqrt
	with (class = 'CPU', not variant)
	external name '107' language builtin;

create function informix.sqrt(money)
        returns float
	specific ifx_money_sqrt
	with (class = 'CPU', not variant)
	external name '107' language builtin;

create function informix.sqrt(varchar(1))
        returns float
	specific ifx_varchar_sqrt
	with (class = 'CPU', not variant)
	external name '107' language builtin;

create function informix.sqrt(char(1))
        returns float
	specific ifx_char_sqrt
	with (class = 'CPU', not variant)
	external name '107' language builtin;

create function informix.sqrt(nvarchar(1))
        returns float
	specific ifx_nvarchar_sqrt
	with (class = 'CPU', not variant)
	external name '107' language builtin;

create function informix.sqrt(nchar(1))
        returns float
	specific ifx_nchar_sqrt
	with (class = 'CPU', not variant)
	external name '107' language builtin;


create function informix.trunc(integer, integer default 0)
	returns decimal
	specific ifx_integer_trunc
	with (class = 'CPU', not variant)
	external name '91' language builtin;

create function informix.trunc(smallint, integer default 0)
	returns decimal
	specific ifx_smallint_trunc
	with (class = 'CPU', not variant)
	external name '91' language builtin;

create function informix.trunc(int8, integer default 0)
	returns decimal
	specific ifx_int8_trunc
	with (class = 'CPU', not variant)
	external name '91' language builtin;

create function informix.trunc(float, integer default 0)
	returns decimal
	specific ifx_float_trunc
	with (class = 'CPU', not variant)
	external name '91' language builtin;

create function informix.trunc(smallfloat, integer default 0)
	returns decimal
	specific ifx_smallfloat_trunc
	with (class = 'CPU', not variant)
	external name '91' language builtin;

create function informix.trunc(decimal, integer default 0)
	returns decimal
	specific ifx_decimal_trunc
	with (class = 'CPU', not variant)
	external name '91' language builtin;

create function informix.trunc(money, integer default 0)
	returns decimal
	specific ifx_money_trunc
	with (class = 'CPU', not variant)
	external name '91' language builtin;

create function informix.trunc(varchar(1), integer default 0)
	returns decimal
	specific ifx_varchar_trunc
	with (class = 'CPU', not variant)
	external name '91' language builtin;

create function informix.trunc(char(1), integer default 0)
	returns decimal
	specific ifx_char_trunc
	with (class = 'CPU', not variant)
	external name '91' language builtin;

create function informix.trunc(nvarchar(1), integer default 0)
	returns decimal
	specific ifx_nvarchar_trunc
	with (class = 'CPU', not variant)
	external name '91' language builtin;

create function informix.trunc(nchar(1), integer default 0)
	returns decimal
	specific ifx_nchar_trunc
	with (class = 'CPU', not variant)
	external name '91' language builtin;


create function informix.cos(integer)
        returns float
	specific ifx_integer_cos
	with (class = 'CPU', not variant)
	external name '97' language builtin;

create function informix.cos(smallint)
        returns float
	specific ifx_smallint_cos
	with (class = 'CPU', not variant)
	external name '97' language builtin;

create function informix.cos(int8)
        returns float
	specific ifx_int8_cos
	with (class = 'CPU', not variant)
	external name '97' language builtin;

create function informix.cos(float)
        returns float
	specific ifx_float_cos
	with (class = 'CPU', not variant)
	external name '97' language builtin;

create function informix.cos(smallfloat)
        returns float
	specific ifx_smallfloat_cos
	with (class = 'CPU', not variant)
	external name '97' language builtin;

create function informix.cos(decimal)
        returns float
	specific ifx_decimal_cos
	with (class = 'CPU', not variant)
	external name '97' language builtin;

create function informix.cos(money)
        returns float
	specific ifx_money_cos
	with (class = 'CPU', not variant)
	external name '97' language builtin;

create function informix.cos(varchar(1))
        returns float
	specific ifx_varchar_cos
	with (class = 'CPU', not variant)
	external name '97' language builtin;

create function informix.cos(char(1))
        returns float
	specific ifx_char_cos
	with (class = 'CPU', not variant)
	external name '97' language builtin;

create function informix.cos(nvarchar(1))
        returns float
	specific ifx_nvarchar_cos
	with (class = 'CPU', not variant)
	external name '97' language builtin;

create function informix.cos(nchar(1))
        returns float
	specific ifx_nchar_cos
	with (class = 'CPU', not variant)
	external name '97' language builtin;


create function informix.sin(integer)
        returns float
	specific ifx_integer_sin
	with (class = 'CPU', not variant)
	external name '96' language builtin;

create function informix.sin(smallint)
        returns float
	specific ifx_smallint_sin
	with (class = 'CPU', not variant)
	external name '96' language builtin;

create function informix.sin(int8)
        returns float
	specific ifx_int8_sin
	with (class = 'CPU', not variant)
	external name '96' language builtin;

create function informix.sin(float)
        returns float
	specific ifx_float_sin
	with (class = 'CPU', not variant)
	external name '96' language builtin;

create function informix.sin(smallfloat)
        returns float
	specific ifx_smallfloat_sin
	with (class = 'CPU', not variant)
	external name '96' language builtin;

create function informix.sin(decimal)
        returns float
	specific ifx_decimal_sin
	with (class = 'CPU', not variant)
	external name '96' language builtin;

create function informix.sin(money)
        returns float
	specific ifx_money_sin
	with (class = 'CPU', not variant)
	external name '96' language builtin;

create function informix.sin(varchar(1))
        returns float
	specific ifx_varchar_sin
	with (class = 'CPU', not variant)
	external name '96' language builtin;

create function informix.sin(char(1))
        returns float
	specific ifx_char_sin
	with (class = 'CPU', not variant)
	external name '96' language builtin;

create function informix.sin(nvarchar(1))
        returns float
	specific ifx_nvarchar_sin
	with (class = 'CPU', not variant)
	external name '96' language builtin;

create function informix.sin(nchar(1))
        returns float
	specific ifx_nchar_sin
	with (class = 'CPU', not variant)
	external name '96' language builtin;


create function informix.tan(integer)
        returns float
	specific ifx_integer_tan
	with (class = 'CPU', not variant)
	external name '93' language builtin;

create function informix.tan(smallint)
        returns float
	specific ifx_smallint_tan
	with (class = 'CPU', not variant)
	external name '93' language builtin;

create function informix.tan(int8)
        returns float
	specific ifx_int8_tan
	with (class = 'CPU', not variant)
	external name '93' language builtin;

create function informix.tan(float)
        returns float
	specific ifx_float_tan
	with (class = 'CPU', not variant)
	external name '93' language builtin;

create function informix.tan(smallfloat)
        returns float
	specific ifx_smallfloat_tan
	with (class = 'CPU', not variant)
	external name '93' language builtin;

create function informix.tan(decimal)
        returns float
	specific ifx_decimal_tan
	with (class = 'CPU', not variant)
	external name '93' language builtin;

create function informix.tan(money)
        returns float
	specific ifx_money_tan
	with (class = 'CPU', not variant)
	external name '93' language builtin;

create function informix.tan(varchar(1))
        returns float
	specific ifx_varchar_tan
	with (class = 'CPU', not variant)
	external name '93' language builtin;

create function informix.tan(char(1))
        returns float
	specific ifx_char_tan
	with (class = 'CPU', not variant)
	external name '93' language builtin;

create function informix.tan(nvarchar(1))
        returns float
	specific ifx_nvarchar_tan
	with (class = 'CPU', not variant)
	external name '93' language builtin;

create function informix.tan(nchar(1))
        returns float
	specific ifx_nchar_tan
	with (class = 'CPU', not variant)
	external name '93' language builtin;


create function informix.acos(integer)
        returns float
	specific ifx_integer_acos
	with (class = 'CPU', not variant)
	external name '99' language builtin;

create function informix.acos(smallint)
        returns float
	specific ifx_smallint_acos
	with (class = 'CPU', not variant)
	external name '99' language builtin;

create function informix.acos(int8)
        returns float
	specific ifx_int8_acos
	with (class = 'CPU', not variant)
	external name '99' language builtin;

create function informix.acos(float)
        returns float
	specific ifx_float_acos
	with (class = 'CPU', not variant)
	external name '99' language builtin;

create function informix.acos(smallfloat)
        returns float
	specific ifx_smallfloat_acos
	with (class = 'CPU', not variant)
	external name '99' language builtin;

create function informix.acos(decimal)
        returns float
	specific ifx_decimal_acos
	with (class = 'CPU', not variant)
	external name '99' language builtin;

create function informix.acos(money)
        returns float
	specific ifx_money_acos
	with (class = 'CPU', not variant)
	external name '99' language builtin;

create function informix.acos(varchar(1))
        returns float
	specific ifx_varchar_acos
	with (class = 'CPU', not variant)
	external name '99' language builtin;

create function informix.acos(char(1))
        returns float
	specific ifx_char_acos
	with (class = 'CPU', not variant)
	external name '99' language builtin;

create function informix.acos(nvarchar(1))
        returns float
	specific ifx_nvarchar_acos
	with (class = 'CPU', not variant)
	external name '99' language builtin;

create function informix.acos(nchar(1))
        returns float
	specific ifx_nchar_acos
	with (class = 'CPU', not variant)
	external name '99' language builtin;


create function informix.asin(integer)
        returns float
	specific ifx_integer_asin
	with (class = 'CPU', not variant)
	external name '98' language builtin;

create function informix.asin(smallint)
        returns float
	specific ifx_smallint_asin
	with (class = 'CPU', not variant)
	external name '98' language builtin;

create function informix.asin(int8)
        returns float
	specific ifx_int8_asin
	with (class = 'CPU', not variant)
	external name '98' language builtin;

create function informix.asin(float)
        returns float
	specific ifx_float_asin
	with (class = 'CPU', not variant)
	external name '98' language builtin;

create function informix.asin(smallfloat)
        returns float
	specific ifx_smallfloat_asin
	with (class = 'CPU', not variant)
	external name '98' language builtin;

create function informix.asin(decimal)
        returns float
	specific ifx_decimal_asin
	with (class = 'CPU', not variant)
	external name '98' language builtin;

create function informix.asin(money)
        returns float
	specific ifx_money_asin
	with (class = 'CPU', not variant)
	external name '98' language builtin;

create function informix.asin(varchar(1))
        returns float
	specific ifx_varchar_asin
	with (class = 'CPU', not variant)
	external name '98' language builtin;

create function informix.asin(char(1))
        returns float
	specific ifx_char_asin
	with (class = 'CPU', not variant)
	external name '98' language builtin;

create function informix.asin(nvarchar(1))
        returns float
	specific ifx_nvarchar_asin
	with (class = 'CPU', not variant)
	external name '98' language builtin;

create function informix.asin(nchar(1))
        returns float
	specific ifx_nchar_asin
	with (class = 'CPU', not variant)
	external name '98' language builtin;


create function informix.atan(integer)
        returns float
	specific ifx_integer_atan
	with (class = 'CPU', not variant)
	external name '94' language builtin;

create function informix.atan(smallint)
        returns float
	specific ifx_smallint_atan
	with (class = 'CPU', not variant)
	external name '94' language builtin;

create function informix.atan(int8)
        returns float
	specific ifx_int8_atan
	with (class = 'CPU', not variant)
	external name '94' language builtin;

create function informix.atan(float)
        returns float
	specific ifx_float_atan
	with (class = 'CPU', not variant)
	external name '94' language builtin;

create function informix.atan(smallfloat)
        returns float
	specific ifx_smallfloat_atan
	with (class = 'CPU', not variant)
	external name '94' language builtin;

create function informix.atan(decimal)
        returns float
	specific ifx_decimal_atan
	with (class = 'CPU', not variant)
	external name '94' language builtin;

create function informix.atan(money)
        returns float
	specific ifx_money_atan
	with (class = 'CPU', not variant)
	external name '94' language builtin;

create function informix.atan(varchar(1))
        returns float
	specific ifx_varchar_atan
	with (class = 'CPU', not variant)
	external name '94' language builtin;

create function informix.atan(char(1))
        returns float
	specific ifx_char_atan
	with (class = 'CPU', not variant)
	external name '94' language builtin;

create function informix.atan(nvarchar(1))
        returns float
	specific ifx_nvarchar_atan
	with (class = 'CPU', not variant)
	external name '94' language builtin;

create function informix.atan(nchar(1))
        returns float
	specific ifx_nchar_atan
	with (class = 'CPU', not variant)
	external name '94' language builtin;


create function informix.atan2(integer, float)
        returns float
	specific ifx_integer_atan2
	with (class = 'CPU', not variant)
	external name '95' language builtin;

create function informix.atan2(smallint, float)
        returns float
	specific ifx_smallint_atan2
	with (class = 'CPU', not variant)
	external name '95' language builtin;

create function informix.atan2(int8, float)
        returns float
	specific ifx_int8_atan2
	with (class = 'CPU', not variant)
	external name '95' language builtin;

create function informix.atan2(float, float)
        returns float
	specific ifx_float_atan2
	with (class = 'CPU', not variant)
	external name '95' language builtin;

create function informix.atan2(smallfloat, float)
        returns float
	specific ifx_smallfloat_atan2
	with (class = 'CPU', not variant)
	external name '95' language builtin;

create function informix.atan2(decimal, float)
        returns float
	specific ifx_decimal_atan2
	with (class = 'CPU', not variant)
	external name '95' language builtin;

create function informix.atan2(money, float)
        returns float
	specific ifx_money_atan2
	with (class = 'CPU', not variant)
	external name '95' language builtin;

create function informix.atan2(varchar(1), float)
        returns float
	specific ifx_varchar_atan2
	with (class = 'CPU', not variant)
	external name '95' language builtin;

create function informix.atan2(char(1), float)
        returns float
	specific ifx_char_atan2
	with (class = 'CPU', not variant)
	external name '95' language builtin;

create function informix.atan2(nvarchar(1), float)
        returns float
	specific ifx_nvarchar_atan2
	with (class = 'CPU', not variant)
	external name '95' language builtin;

create function informix.atan2(nchar(1), float)
        returns float
	specific ifx_nchar_atan2
	with (class = 'CPU', not variant)
	external name '95' language builtin;


create function informix.length(varchar(1))
        returns int
	specific ifx_varchar_length
	with (class = 'CPU', not variant)
	external name '16' language builtin;

create function informix.length(char(1))
        returns int
	specific ifx_char_length
	with (class = 'CPU', not variant)
	external name '16' language builtin;

create function informix.length(nvarchar(1))
        returns int
	specific ifx_nvarchar_length
	with (class = 'CPU', not variant)
	external name '16' language builtin;

create function informix.length(nchar(1))
        returns int
	specific ifx_nchar_length
	with (class = 'CPU', not variant)
	external name '16' language builtin;

create function informix.length(references byte)
        returns int
	specific ifx_bytes_length
	with (class = 'CPU', not variant)
	external name '16' language builtin;

create function informix.length(references text)
        returns int
	specific ifx_text_length
	with (class = 'CPU', not variant)
	external name '16' language builtin;


create function informix.octet_length(varchar(1))
        returns int
	specific ifx_varchar_octet_length
	with (class = 'CPU', not variant)
	external name '74' language builtin;

create function informix.octet_length(char(1))
        returns int
	specific ifx_char_octet_length
	with (class = 'CPU', not variant)
	external name '74' language builtin;

create function informix.octet_length(nvarchar(1))
        returns int
	specific ifx_nvarchar_octet_length
	with (class = 'CPU', not variant)
	external name '74' language builtin;

create function informix.octet_length(nchar(1))
        returns int
	specific ifx_nchar_octet_length
	with (class = 'CPU', not variant)
	external name '74' language builtin;

create function informix.octet_length(references byte)
        returns int
	specific ifx_bytes_octet_length
	with (class = 'CPU', not variant)
	external name '74' language builtin;

create function informix.octet_length(references text)
        returns int
	specific ifx_text_octet_length
	with (class = 'CPU', not variant)
	external name '74' language builtin;


create function informix.char_length(varchar(1))
        returns int
	specific ifx_varchar_char_length
	with (class = 'CPU', not variant)
	external name '75' language builtin;

create function informix.char_length(char(1))
        returns int
	specific ifx_char_char_length
	with (class = 'CPU', not variant)
	external name '75' language builtin;

create function informix.char_length(nvarchar(1))
        returns int
	specific ifx_nvarchar_char_length
	with (class = 'CPU', not variant)
	external name '75' language builtin;

create function informix.char_length(nchar(1))
        returns int
	specific ifx_nchar_char_length
	with (class = 'CPU', not variant)
	external name '75' language builtin;

create function informix.char_length(references byte)
        returns int
	specific ifx_bytes_char_length
	with (class = 'CPU', not variant)
	external name '75' language builtin;

create function informix.char_length(references text)
        returns int
	specific ifx_text_char_length
	with (class = 'CPU', not variant)
	external name '75' language builtin;


create function informix.character_length(varchar(1))
        returns int
	specific ifx_varchar_character_length
	with (class = 'CPU', not variant)
	external name '75' language builtin;

create function informix.character_length(char(1))
        returns int
	specific ifx_char_character_length
	with (class = 'CPU', not variant)
	external name '75' language builtin;

create function informix.character_length(nvarchar(1))
        returns int
	specific ifx_nvarchar_character_length
	with (class = 'CPU', not variant)
	external name '75' language builtin;

create function informix.character_length(nchar(1))
        returns int
	specific ifx_nchar_character_length
	with (class = 'CPU', not variant)
	external name '75' language builtin;

create function informix.character_length(references byte)
        returns int
	specific ifx_bytes_character_length
	with (class = 'CPU', not variant)
	external name '75' language builtin;

create function informix.character_length(references text)
        returns int
	specific ifx_text_character_length
	with (class = 'CPU', not variant)
	external name '75' language builtin;


{ executing this procedure will allow you to have a newline character in }
{ the string as in "insert into tab values ("line ends here^M new line"); }
create procedure informix.ifx_allow_newline (informix.boolean);
external name '' language C
end procedure;

create function informix.mi_get_typedesc(int,int)
        returns informix.lvarchar
        external name '(mife_type_typedesc)'
        language C;

create function informix.mi_get_typedesc(informix.lvarchar)
        returns informix.lvarchar
        external name '(mife_describe_typestring)'
        language C;

create function informix.reload_module(varchar(255), varchar(255)) 
        returns int
        external name '' language C;
 
create procedure informix.ifx_load_module (modulename varchar(255), 
        languagename varchar(255)) returns int
     
     define retvalue int;
     let retvalue = reload_module(modulename, languagename);
     if retvalue = 0 then
         return 0;
     else
         raise exception -9720;
     end if;
end procedure;

create function informix.ifx_invalid_module(varchar(255), varchar(255))
        returns int 
        external name '' language C;

create function informix.ifx_new_external(varchar(255), varchar(255),
        varchar(255))
        returns informix.lvarchar
	external name '' language C;

create function informix.ifx_match_external(varchar(255), varchar(255))
        returns int
	external name '' language C;

create function informix.ifx_load_internal(varchar(255), varchar(255))
        returns int
	external name '' language C;

create procedure informix.ifx_replace_module (oldmodulename varchar(255), 
        newmodulename varchar(255),
        languagename varchar(255)) returns int

     define retvalue int;
     let retvalue = ifx_invalid_module(oldmodulename, 
                          languagename);
     if retvalue = 0 then
         update informix.sysprocedures 
         set externalname = ifx_new_external(newmodulename, externalname,
                              languagename)
         where ifx_match_external(oldmodulename, externalname) = 1;
	 let retvalue = ifx_load_internal(newmodulename, languagename);
     end if;

     if retvalue = 0 then
         return 0;
     else
	 raise exception -9720;
     end if;

end procedure;
        
-- Add sysindexes view during database construction,
-- after we have added the type indexkeyarray
create view informix.sysindexes
    (idxname, owner, tabid, idxtype, clustered,
    part1, part2, part3, part4, part5, part6, part7, part8,
    part9, part10, part11, part12, part13, part14, part15, part16,
    levels, leaves, nunique, clust)
  as select
    idxname, owner, tabid, idxtype, clustered,
    informix.ikeyextractcolno(indexkeys,0),
    informix.ikeyextractcolno(indexkeys,1),
    informix.ikeyextractcolno(indexkeys,2),
    informix.ikeyextractcolno(indexkeys,3),
    informix.ikeyextractcolno(indexkeys,4),
    informix.ikeyextractcolno(indexkeys,5),  
    informix.ikeyextractcolno(indexkeys,6),
    informix.ikeyextractcolno(indexkeys,7),
    informix.ikeyextractcolno(indexkeys,8),
    informix.ikeyextractcolno(indexkeys,9),
    informix.ikeyextractcolno(indexkeys,10),
    informix.ikeyextractcolno(indexkeys,11),
    informix.ikeyextractcolno(indexkeys,12),
    informix.ikeyextractcolno(indexkeys,13),
    informix.ikeyextractcolno(indexkeys,14),
    informix.ikeyextractcolno(indexkeys,15),
    levels, leaves, nunique, clust
  from informix.sysindices;

grant select on informix.sysindexes to public as informix;

-- Define rtree access method:
create function informix.rlt_create(pointer)
    returns int
    external name '(rlt_create)'
    language C;

create function informix.rlt_drop(pointer)
    returns int
    external name '(rlt_drop)' 
    language C;

create function informix.rlt_open(pointer)
    returns int
    external name '(rlt_open)' 
    language C;

create function informix.rlt_close(pointer)
    returns int
    external name '(rlt_close)' 
    language C;

create function informix.rlt_insert(pointer, pointer, pointer)
    returns int
    external name '(rlt_insert)' 
    language C;

create function informix.rlt_delete(pointer, pointer, pointer)
    returns int
    external name '(rlt_delete)' 
    language C;

create function informix.rlt_update(pointer, pointer, pointer, 
				    pointer, pointer)
    returns int
    external name '(rlt_update)' 
    language C;

create function informix.rlt_beginscan(pointer)
    returns int
    external name '(rlt_beginscan)' 
    language C;

create function informix.rlt_endscan(pointer)
    returns int
    external name '(rlt_endscan)' 
    language C;

create function informix.rlt_rescan(pointer)
    returns int
    external name '(rlt_rescan)' 
    language C;

create function informix.rlt_getnext(pointer, pointer, pointer)
    returns int
    external name '(rlt_getnext)' 
    language C;

create secondary access_method informix.rtree (
    am_create = informix.rlt_create,
    am_drop = informix.rlt_drop,
    am_open = informix.rlt_open,
    am_close = informix.rlt_close,
    am_insert = informix.rlt_insert,
    am_delete = informix.rlt_delete,
    am_update = informix.rlt_update,
    am_beginscan = informix.rlt_beginscan,
    am_endscan = informix.rlt_endscan,
    am_rescan = informix.rlt_rescan,
    am_getnext = informix.rlt_getnext,
    am_sptype = 'D');

-- Default opclass for rtrees: rtree_ops
create opclass informix.rtree_ops for informix.rtree
    strategies (overlap, equal, contains, within)
    support (union, size, inter, hilbert);
alter access_method informix.rtree add am_defopclass = informix.rtree_ops;

-- lvarchar support functions.

create function informix.equal(informix.lvarchar, informix.lvarchar) 
	returns informix.boolean
	with (commutator = equal, negator = notequal, class = 'CPU', 
		not variant)
	external name '(lvarchar_equal)' language C;

create function informix.notequal(informix.lvarchar, informix.lvarchar) 
	returns informix.boolean
	with (commutator = notequal, negator = equal, class = 'CPU',
              not variant)
	external name '(lvarchar_notequal)' language C;

create function informix.greaterthan(informix.lvarchar, informix.lvarchar) 
	returns informix.boolean
	with (negator = lessthanorequal, class = 'CPU', not variant)
	external name '(lvarchar_greaterthan)' language C;

create function informix.lessthan(informix.lvarchar, informix.lvarchar) 
	returns informix.boolean
	with (negator = greaterthanorequal, class = 'CPU', not variant)
	external name '(lvarchar_lessthan)' language C;

create function informix.greaterthanorequal(informix.lvarchar, informix.lvarchar) 
	returns informix.boolean
	with (negator = lessthan, class = 'CPU', not variant)
	external name '(lvarchar_gte)' language C;

create function informix.lessthanorequal(informix.lvarchar, informix.lvarchar) 
	returns informix.boolean
	with (negator = greaterthan, class = 'CPU', not variant)
	external name '(lvarchar_lte)' language C;

create function informix.compare(informix.lvarchar, informix.lvarchar)
        returns integer
        external name '(lvarchar_compare)'
        language C not variant;


{ these functions are created to extract type information for triggers }
create function informix.trigger_cols(int)
	returns informix.lvarchar
	external name ''
	language C;

create procedure informix.ifx_trigger_cols(trigid int)
	returns informix.lvarchar
	return (informix.trigger_cols(trigid));
end procedure;

create function informix.trigger_action (int, int)
	returns informix.lvarchar
	external name ''
	language C;

create procedure informix.ifx_trigger_action(trigid int, when CHAR(10))
	returns informix.lvarchar; 
	define cleanwhen	char(10);
	define intwhen		int;

	let cleanwhen = trim (BOTH FROM when);
	if (cleanwhen = 'BEFORE' or cleanwhen = 'before') then
	    let intwhen = 1;
	elif (cleanwhen = 'ROW' or cleanwhen = 'row') then
	    let intwhen = 2;
	elif (cleanwhen = 'AFTER' or cleanwhen = 'after') then
	    let intwhen = 3;
	else
	    return NULL;
	end if;
	
	return (informix.trigger_action(trigid, intwhen));
end procedure;
	    
