Get the names right

This commit is contained in:
Paul Reeves 2023-01-25 15:58:51 +01:00
parent b9dbf3ce7e
commit db5f3d4047
3 changed files with 33 additions and 35 deletions

View File

@ -6,24 +6,22 @@ create or alter function div (
anumerator integer, adenominator integer anumerator integer, adenominator integer
) )
returns double precision returns double precision
external name 'udf_compat!UC_div!Divide anumerator by adenominator' engine udr; external name 'MyFirstUDRKit!MFK_div!Divide anumerator by adenominator' engine udr;
grant execute on function div to public;
create or alter function flagged ( create or alter function flagged (
flags integer, flag integer flags integer, flag integer
) )
returns integer returns integer
external name 'my_first_udr_kit!MFK_flagged!How is this function used?' engine udr; external name 'MyFirstUDRKit!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 flagged to public;
grant execute on function LoadBlobFromFile to public;
-- create or alter function LoadBlobFromFile (
-- afilename varchar(8191),
-- ablob BLOB
-- ) returns bigint
-- external name 'MyFirstUDRKit!MFK_Load_Blob_From_File!Load file and save to Blob'
-- engine udr;
-- grant execute on function LoadBlobFromFile to public;

View File

@ -3,7 +3,7 @@
*/ */
set term ^; set term ^;
create or alter package my_first_udr_kit create or alter package MyFirstUDRKit
-- optional - declare sql security as DEFINER to give access rights of owner to all users -- optional - declare sql security as DEFINER to give access rights of owner to all users
-- sql security definer -- sql security definer
as as
@ -20,16 +20,16 @@ begin
) )
returns integer; returns integer;
function LoadBlobFromFile ( -- function LoadBlobFromFile (
afilename varchar(8191), -- afilename varchar(8191),
ablob BLOB -- ablob BLOB
) -- )
returns bigint; -- returns bigint;
end ^ end ^
recreate package body my_first_udr_kit recreate package body MyFirstUDRKit
as as
begin begin
@ -37,21 +37,21 @@ begin
anumerator integer, adenominator integer anumerator integer, adenominator integer
) )
returns double precision returns double precision
external name 'udf_compat!UC_div!Divide anumerator by adenominator' engine udr; external name 'MyFirstUDRKit!MFK_div!Divide anumerator by adenominator' engine udr;
function flagged ( function flagged (
flags integer, flag integer flags integer, flag integer
) )
returns integer returns integer
external name 'my_first_udr_kit!MFK_flagged!How is this function used?' engine udr; external name 'MyFirstUDRKit!MFK_flagged!How is this function used?' engine udr;
function LoadBlobFromFile ( -- function LoadBlobFromFile (
afilename varchar(8191), -- afilename varchar(8191),
ablob BLOB -- ablob BLOB
) -- )
returns bigint -- returns bigint
external name 'my_first_udr_kit!MFK_Load_Blob_From_File!Load file and save to Blob' engine udr; -- external name 'MyFirstUDRKit!MFK_Load_Blob_From_File!Load file and save to Blob' engine udr;
@ -61,4 +61,4 @@ end ^
set term ;^ set term ;^
grant execute on package my_first_udr_kit to public; grant execute on package MyFirstUDRKit to public;

View File

@ -81,10 +81,10 @@ using namespace Firebird;
* anumerator integer, * anumerator integer,
* adenominator integer * adenominator integer
* ) returns double precision * ) returns double precision
* external name 'udf_compat!UC_div!Divide anumerator by adenominator' * external name 'MyFirstUDRKit!MFK_div!Divide anumerator by adenominator'
* engine udr; * engine udr;
***/ ***/
FB_UDR_BEGIN_FUNCTION(UC_div) FB_UDR_BEGIN_FUNCTION(MFK_div)
// Divide integer anumerator 1 by integer adenominator using the stdlib // Divide integer anumerator 1 by integer adenominator using the stdlib
@ -130,7 +130,7 @@ create function flagged (
flags integer, flags integer,
flag integer flag integer
) returns integer ) returns integer
external name 'my_first_udr_kit!MFK_flagged!How is this function used?' external name 'MyFirstUDRKit!MFK_flagged!How is this function used?'
engine udr; engine udr;
***/ ***/
FB_UDR_BEGIN_FUNCTION(MFK_flagged) FB_UDR_BEGIN_FUNCTION(MFK_flagged)
@ -173,13 +173,13 @@ create or alter function LoadBlobFromFile (
afilename varchar(8191), afilename varchar(8191),
ablob BLOB ablob BLOB
) returns bigint ) returns bigint
external name 'my_first_udr_kit!MFK_Load_Blob_From_File!Load file and save to Blob' external name 'MyFirstUDRKit!MFK_Load_Blob_From_File!Load file and save to Blob'
engine udr; engine udr;
***/ ***/
static const size_t MaxSegmentSize = 65535; static const size_t MaxSegmentSize = 65535;
FB_UDR_BEGIN_FUNCTION(MFK_Blob_Save) FB_UDR_BEGIN_FUNCTION(MFK_Load_Blob_From_File)
FB_UDR_MESSAGE(InMessage, FB_UDR_MESSAGE(InMessage,
(FB_CHAR(8191), afilename) (FB_CHAR(8191), afilename)