30 lines
790 B
SQL
30 lines
790 B
SQL
/*
|
|
* This demonstrates how to declare the UDRs globally
|
|
*/
|
|
|
|
create or alter function div (
|
|
anumerator integer, adenominator integer
|
|
)
|
|
returns double precision
|
|
external name 'udf_compat!UC_div!Divide anumerator by adenominator' engine udr;
|
|
|
|
|
|
create or alter function flagged (
|
|
flags integer, flag integer
|
|
)
|
|
returns integer
|
|
external name 'my_first_udr_kit!MFK_flagged!How is this function used?' engine udr;
|
|
|
|
|
|
create or alter function LoadBlobFromFile (
|
|
afilename varchar(8191),
|
|
ablob BLOB
|
|
) returns bigint
|
|
external name 'my_first_udr_kit!MFK_Load_Blob_From_File!Load file and save to Blob'
|
|
engine udr;
|
|
|
|
-- Add some grants here perhaps?
|
|
grant execute on function div to public;
|
|
grant execute on function flagged to public;
|
|
grant execute on function LoadBlobFromFile to public;
|