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 (
afilename varchar(8191),
ablob BLOB
) returns bigint
afilename varchar(8191)
) returns BLOB
external name 'MyFirstUDRKit!MFK_LoadBlobFromFile!Load file and save to Blob'
engine udr;
grant execute on function LoadBlobFromFile to public;

View File

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