Page 1 of 1

StoredProcedures 8.4.4 - Return Varchar expected length divided by 4

Posted: Tue 27 Jul 2021 12:21
by leonardt.neugebauer
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.

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

Posted: Tue 27 Jul 2021 15:17
by ViktorV
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

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

Posted: Wed 28 Jul 2021 05:51
by leonardt.neugebauer
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

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

Posted: Thu 29 Jul 2021 13:25
by ViktorV
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

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

Posted: Mon 02 Aug 2021 14:42
by leonardt.neugebauer
When can we expect the next update?

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

Posted: Tue 03 Aug 2021 16:12
by ViktorV
Hi Leonard!

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

Regards,
Viktor