Hi We have been using your wonderful library of UniDAC components (for SQL Server) for several years now and currently use version 10.1.0 professional version for Delphi 12.
Currently we were evaluating to move our database to AWS through Bablefish implementation for Aurora PostgreSQL and while testing to make sure that all the DB logic as well as functionality works without requiring us to change any code or SQL inside our application, we encountered an error during ExecSQL operation with Update SQLs where the Bablefish was complaining about Varchar length being zero and failing.
On further investigation using DB Monitor and lots of logging in our application we found that the parameterized query was also sending in some dynamically generated parameter definition and as the value being substituted was as blank string with zero length (but not actually NULL) so in its parameter definition also it was defining it as a WideChar(0) which was causing the Babelfish layer to reject the same and fail. The failing SQL and the reported errors are as below:
update BoVatRates set UserID=:UserID, VatRate=:VatRate, DateFrom=:DateFrom, supplierid=:supplierid, name=:name, ref1=:ref1, Deleted=:Deleted, externalid=:externalid, VATIndicator=:VATIndicator where VatCode=:VatCode
:UserID(WideString[5])='ADMIN'
:VatRate(Float)=90
:DateFrom(DateTime)=01-01-2000
:supplierid(WideString[6])='000001'
:name(WideString[0])=''
:ref1(WideString[4])='Test'
:Deleted(Boolean)=False
:externalid(WideString[4])='TESt'
:VATIndicator(WideString[0])=''
:VatCode(WideString[1])='9'
Error: length for type varchar must be at least 1
We have tried all different options but could not find any way or property for TUniConnection or TUniQuery or anything else which could be used to prevent this. May I humbly request you to please look into this issue and advise.
Warm regards
-
Sunil Kumar Arora