StoredProcedures 8.4.4 - Return Varchar expected length divided by 4

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
leonardt.neugebauer
Posts: 32
Joined: Wed 27 May 2020 06:22

StoredProcedures 8.4.4 - Return Varchar expected length divided by 4

Post by leonardt.neugebauer » 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.

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;
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.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: StoredProcedures 8.4.4 - Return Varchar expected length divided by 4

Post by ViktorV » Tue 27 Jul 2021 15:17

Hi Leonard,

Please be informed that, unfortunately, we could not reproduce this issue even with provided data.

Perhaps that the issue is related to components settings or database itself. As a result, in order to provide you with a fast and correct reply please send us a full sample which demonstrates the described behavior including database file and exact server version.
You can send this information using our contact form:
https://devart.com/company/contactform.html

leonardt.neugebauer
Posts: 32
Joined: Wed 27 May 2020 06:22

Re: StoredProcedures 8.4.4 - Return Varchar expected length divided by 4

Post by leonardt.neugebauer » Wed 28 Jul 2021 05:51

Firebird 3.0.7/4.0.0

The following options can be used to reproduce the problem.

UniConnection.ProviderName: InterBase
UniConnection.SpecificOptions.Charset: UTF8
UniConnection.SpecificOptions.UseUnicode: True


Here again are all of my specific options at run time:

InterBase.ClientLibrary=fbclient.dll
InterBase.UseUnicode=True
InterBase.SQLDialect=3
InterBase.EnableMemos=True
InterBase.Charset=UTF8

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: StoredProcedures 8.4.4 - Return Varchar expected length divided by 4

Post by ViktorV » Thu 29 Jul 2021 13:25

Hi Leonard,

Thanks for provided information.
We have reproduced described behavior and fixed it- these changes will be included into next UniDAC build.
As a temp solution, we can provide you with a night build which includes this fix. Please send us your license number and IDE version you use using our contact form:
https://devart.com/company/contactform.html

Best regards,
Viktor

leonardt.neugebauer
Posts: 32
Joined: Wed 27 May 2020 06:22

Re: StoredProcedures 8.4.4 - Return Varchar expected length divided by 4

Post by leonardt.neugebauer » Mon 02 Aug 2021 14:42

When can we expect the next update?

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: StoredProcedures 8.4.4 - Return Varchar expected length divided by 4

Post by ViktorV » Tue 03 Aug 2021 16:12

Hi Leonard!

The next release is expected within the following 1-2 months.

Regards,
Viktor

Post Reply