{ ************************************************************************* }
{                                                                           }
{  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:      boot912b.sql                                                }
{                                                                           }
{   Description:                                                            }
{       Bootstrapping script for a 9.12 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"                                                     }
{									    }
{ ************************************************************************* }

-- Add rowimport/rowexport functions and casts
create dba function informix.rowexport(row) returns informix.impexp
        external name '(rowexport)' language C not variant;

grant execute on function informix.rowexport(informix.row) to public as informix;

create dba function informix.rowimport(informix.impexp) returns row
        external name '(rowimport)' language C not variant;

grant execute on function informix.rowimport(informix.impexp) to public as informix ;


create implicit cast (informix.impexp as informix.row with 
	informix.rowimport);

create implicit cast (informix.row as informix.impexp with 	
	informix.rowexport);

-- Define BladeManager boot function
create function informix.sysbldprepare (char(64), char(18)) 
	returns integer                                          
 	external name '$INFORMIXDIR/extend/ifxmngr/ifxmngr.bld(SYSBldCustomPrepare)' 
	language C;

-- cast functions for untyped collection
create dba function informix.collcast(collection) returns collection
        external name '(collcast)' language C not variant;

grant execute on function informix.collcast(collection) to public as informix ;

create dba function informix.collectionoutput(collection) 
	returns informix.lvarchar
        external name '(collectionoutput)' language C not variant;

grant execute on function informix.collectionoutput(collection) to public as informix ;
