Page 1 of 1

UNIDAC 5.3.8, Firebird, StoredProcedure returns NULL instead of 0

Posted: Wed 07 May 2014 15:27
by erich_k4
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

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

Posted: Thu 08 May 2014 06:51
by ZEuS
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.

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

Posted: Thu 08 May 2014 08:48
by erich_k4
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

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

Posted: Thu 08 May 2014 09:00
by ZEuS
It's good to see that the problem was solved.
If any other questions come up, please contact us.