/*---------- NoSQL built-in UDA -------------------------*/


create function informix.addtoset_init(informix.bson)
returns informix.lvarchar with (handlesnulls, not variant)
external name '(bson_addtoset_init)' language c;

create function informix.addtoset_iter(informix.lvarchar, informix.bson)
returns informix.lvarchar with (handlesnulls, not variant)
external name '(bson_addtoset_iter)' language c;

create function informix.addtoset_final(informix.lvarchar)
returns informix.bson with (handlesnulls, not variant)
external name '(bson_addtoset_final)' language c;

create function informix.addtoset_combine(informix.lvarchar, informix.lvarchar)
returns informix.lvarchar with (handlesnulls, not variant)
external name '(bson_addtoset_combine)' language c ;

create function informix.addtoset2_init(informix.bson)
returns informix.lvarchar with (handlesnulls, not variant)
external name '(bson_addtoset2_init)' language c;

create function informix.addtoset2_iter(informix.lvarchar, informix.bson)
returns informix.lvarchar with (handlesnulls, not variant)
external name '(bson_addtoset2_iter)' language c;

create function informix.addtoset2_final(informix.lvarchar)
returns informix.bson with (handlesnulls, not variant)
external name '(bson_addtoset2_final)' language c;

create function informix.addtoset2_combine(informix.lvarchar, informix.lvarchar)
returns informix.lvarchar with (handlesnulls, not variant)
external name '(bson_addtoset2_combine)' language c;

create function informix.push_init(informix.bson)
returns informix.lvarchar with (handlesnulls, not variant)
external name '(bson_push_init)' language c;

create function informix.push_iter(informix.lvarchar, informix.bson)
returns informix.lvarchar with (handlesnulls, not variant)
external name '(bson_push_iter)' language c;

create function informix.push_final(informix.lvarchar)
returns informix.bson with (handlesnulls, not variant)
external name '(bson_push_final)' language c;

create function informix.push_combine(informix.lvarchar, informix.lvarchar)
returns informix.lvarchar with (handlesnulls, not variant)
external name '(bson_push_combine)' language c ;

create function informix.push2_init(informix.bson)
returns informix.lvarchar with (handlesnulls, not variant)
external name '(bson_push2_init)' language c;

create function informix.push2_iter(informix.lvarchar, informix.bson)
returns informix.lvarchar with (handlesnulls, not variant)
external name '(bson_push2_iter)' language c;

create function informix.push2_final(informix.lvarchar)
returns informix.bson with (handlesnulls, not variant)
external name '(bson_push2_final)' language c;

create function informix.push2_combine(informix.lvarchar, informix.lvarchar)
returns informix.lvarchar with (handlesnulls, not variant)
external name '(bson_push2_combine)' language c ;

create aggregate informix.addtoset
       with(init    = addtoset_init,
            iter    = addtoset_iter,
            combine = addtoset_combine, 
            final   = addtoset_final, 
            handlesnulls);

create aggregate informix.addtoset2
       with(init    = addtoset2_init,
            iter    = addtoset2_iter,
            combine = addtoset2_combine, 
            final   = addtoset2_final, 
            handlesnulls);

create aggregate informix.push
       with(init    = push_init,
            iter    = push_iter,
            combine = push_combine, 
            final   = push_final, 
            handlesnulls);

create aggregate informix.push2
       with(init    = push2_init,
            iter    = push2_iter,
            combine = push2_combine, 
            final   = push2_final, 
            handlesnulls);

create procedure informix.dummyrev_1210XC2()
end procedure;  


