LoadBlobFromFile takes only a single parameter and returns a blob

This commit is contained in:
Paul Reeves 2023-02-02 16:09:39 +01:00
parent 9746ae578d
commit c8fb94b176
2 changed files with 5 additions and 7 deletions

View File

@ -19,9 +19,8 @@ grant execute on function flagged to public;
create or alter function LoadBlobFromFile ( create or alter function LoadBlobFromFile (
afilename varchar(8191), afilename varchar(8191)
ablob BLOB ) returns BLOB
) returns bigint
external name 'MyFirstUDRKit!MFK_LoadBlobFromFile!Load file and save to Blob' external name 'MyFirstUDRKit!MFK_LoadBlobFromFile!Load file and save to Blob'
engine udr; engine udr;
grant execute on function LoadBlobFromFile to public; grant execute on function LoadBlobFromFile to public;

View File

@ -174,11 +174,10 @@ FB_UDR_BEGIN_FUNCTION (MFK_LoadBlobFromFile)
//BEGIN //BEGIN
FB_UDR_MESSAGE(InMessage, FB_UDR_MESSAGE(InMessage,
(FB_VARCHAR(8191), afilename) (FB_VARCHAR(8191), afilename)
(FB_BLOB, ablob)
); );
FB_UDR_MESSAGE(OutMessage, FB_UDR_MESSAGE(OutMessage,
(FB_BIGINT, result) (FB_BLOB, ablob)
); );
@ -190,8 +189,8 @@ FB_UDR_EXECUTE_FUNCTION
{ {
// Test Input // Test Input
if (in->afilenameNull != 0) { if (in->afilenameNull != 0) {
out->resultNull = FB_TRUE; out->ablobNull = FB_TRUE;
out->result = 0; return;
} }
std::ifstream FileReader; std::ifstream FileReader;