StoredProcedures 8.4.4 - Return Varchar expected length divided by 4
Posted: Tue 27 Jul 2021 12:21
Hello, since version 8.4.4 the following problem occurs with StoredProcedures.
No problem with 8.3.2.
8.3.2 is the last version with which we can work normally. The other problems between 8.3.2 and 8.4.4 seem to be fixed for now.
I also tested again with a length of 200. Then the error comes with strings over 50 characters. So the expected character length is always divided by 4.
No problem with 8.3.2.
8.3.2 is the last version with which we can work normally. The other problems between 8.3.2 and 8.4.4 seem to be fixed for now.
Code: Select all
// Stored Procedure returns Varchar(100)
SET TERM ^ ;
create or alter procedure TESTREAD
returns (
RESULT varchar (100))
as
begin
RESULT = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
end^
SET TERM ; ^
var
lProc: TUniStoredProc;
begin
lProc := TUniStoredProc.Create( nil);
try
lProc.Connection := GDM.DB_Produkt_UniDac;
lProc.StoredProcName := 'TESTREAD';
lProc.Prepare;
lProc.ExecProc;
// Exception: SQL error code = -303
//arithmetic exception, numeric overflow, or string truncation
//string right truncation
//expected length 25, actual 26'
ShowMessage( lProc.ParamByName('RESULT').AsString);
finally
lProc.Free;
end;