UNIDAC 5.3.8, Firebird, StoredProcedure returns NULL instead of 0

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
erich_k4
Posts: 4
Joined: Mon 26 Aug 2013 12:07

UNIDAC 5.3.8, Firebird, StoredProcedure returns NULL instead of 0

Post by erich_k4 » Wed 07 May 2014 15:27

Hello,
the result from a SP contains a field called ARTIKELTYP defined as SMALLINT DEFAULT 0

1. running the SP this way returns NULL instead of 0 for the above field!

Code: Select all

DM.SP_GET_ARTIKELBYID.PrepareSQL ( true );
DM.SP_GET_ARTIKELBYID.ParamByName ( 'P_ID_ARTIKEL' ).AsInteger := bcID;
DM.SP_GET_ARTIKELBYID.Open;
accessing the field like aIntValue := DM.SP_GET_ARTIKELBYID.FieldByName ( 'ArtikelTyp' ).AsInteger throws an exception "Field 'ARTIKELTYP' cant't be accessed as Type Integer".

2. running the SP via a simple query like this returns the correct value -> 0 (integer)

Code: Select all

DM.queryTemp.SQL.Clear;
DM.queryTemp.SQL.Add ( 'SELECT * FROM SP_GET_ARTIKELBYID( ' + IntToStr( bcID ) + ' )' );
DM.queryTemp.Open;
#1 worked fine in 5.2.7 but fails in 5.3.8

greets
Erich

ZEuS
Devart Team
Posts: 240
Joined: Thu 05 Apr 2012 07:32

Re: UNIDAC 5.3.8, Firebird, StoredProcedure returns NULL instead of 0

Post by ZEuS » Thu 08 May 2014 06:51

Unfortunately, we can not reproduce the problem.
Please, create a small test project that demonstrates the problem, including a script to create the test database, and send it to eugeniyz*devart*com. Also, specify the exact version of the IDE and the Firebird server you are using.

erich_k4
Posts: 4
Joined: Mon 26 Aug 2013 12:07

Re: UNIDAC 5.3.8, Firebird, StoredProcedure returns NULL instead of 0

Post by erich_k4 » Thu 08 May 2014 08:48

Ok got it, the reason was a Data Type Mapping in the SP i've tested and then forgotten to remove it! :roll:
Thank you
Erich

ZEuS
Devart Team
Posts: 240
Joined: Thu 05 Apr 2012 07:32

Re: UNIDAC 5.3.8, Firebird, StoredProcedure returns NULL instead of 0

Post by ZEuS » Thu 08 May 2014 09:00

It's good to see that the problem was solved.
If any other questions come up, please contact us.

Post Reply