The create function statement will allow a new keyword, exportable, that determines whether or not a function can be exported to a remote site. It does not specify that the function must be exported, it specifies only that the function may be exported. The new statement syntax is:
create function sql_function_name sql_function_signature sql_properties external_java_reference sql_function_name ::= [[identifier1.]identifier2.]identifier3 sql_function_signature ::= ( [sql_parameters]) returns sql_datatype sql_parameters ::= sql_parameter [{, sql_parameter}...] sql_parameter ::= [parameter_mode] [sql_identifier] sql_datatype parameter_mode ::= in | out | inout sql_properties ::= [modifies sql data] | [dynamic result sets integer] | [deterministic | not deterministic ] | [returns null on null input | called on null input ] | [exportable] | language java | parameter style java external_java_reference ::= external name ’java_method_name [java_method_signature]’ java_method_name ::= java_class_name.method_identifier java_class_name ::= [packages.]class_identifier packages ::= package_identifier[.package_identifier]... package_identifier ::= java_identifier class_identifier ::= java_identifier method_identifier ::= java_identifier java_method_signature ::= ( [ java_parameters ]) java_parameters ::= java_datatype [{, java_datatype}...
When CIS encounters a SQL function, a check for the presence of the exportable keyword will be made during CIS’s query decomposition phase. If the function is exportable, the statement will be a candidate for quickpass mode. If the function is not exportable, it will cause the statement to be thrown out of quickpass mode.
In quickpass mode, the function name and argument list will be forwarded to a remote server, even if the capability for JAVA UDF indicates that Java functions are not supported. This will allow a CIS administrator to create packages of functions that, for example, emulate behavior of foreign database systems (Oracle, DB2, etc.). In this way, SQLJ functions can be created within CIS that will allow CIS to forward statements in quickpass mode even though the function named in the query is not a standard Transact-SQL built-in.
If the statement containing the function cannot be forwarded to the remote server in quickpass mode, CIS still provides for the correct execution of the function by retrieving data from remote sites, then invoking the function locally to operate on the recently-fetched remote data.