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
)
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 (
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;
external name 'MyFirstUDRKit!MFK_flagged!How is this function used?' engine udr;
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 ^;
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
-- sql security definer
as
@ -20,16 +20,16 @@ begin
)
returns integer;
function LoadBlobFromFile (
afilename varchar(8191),
ablob BLOB
)
returns bigint;
-- function LoadBlobFromFile (
-- afilename varchar(8191),
-- ablob BLOB
-- )
-- returns bigint;
end ^
recreate package body my_first_udr_kit
recreate package body MyFirstUDRKit
as
begin
@ -37,21 +37,21 @@ begin
anumerator integer, adenominator integer
)
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 (
flags integer, flag 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 (
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;
-- 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;
@ -61,4 +61,4 @@ end ^
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,
* adenominator integer
* ) returns double precision
* external name 'udf_compat!UC_div!Divide anumerator by adenominator'
* external name 'MyFirstUDRKit!MFK_div!Divide anumerator by adenominator'
* engine udr;
***/
FB_UDR_BEGIN_FUNCTION(UC_div)
FB_UDR_BEGIN_FUNCTION(MFK_div)
// Divide integer anumerator 1 by integer adenominator using the stdlib
@ -130,7 +130,7 @@ create function flagged (
flags integer,
flag 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;
***/
FB_UDR_BEGIN_FUNCTION(MFK_flagged)
@ -173,13 +173,13 @@ 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'
external name 'MyFirstUDRKit!MFK_Load_Blob_From_File!Load file and save to Blob'
engine udr;
***/
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_CHAR(8191), afilename)