Page 1 of 1

Something wrong with TStoredProc in a Firemonkey Multi Platform Application

Posted: Wed 23 Nov 2016 00:26
by 2mrezaee
Hi There
please check this out:

this is my stored procedure:

Code: Select all

PROCEDURE sp_Users_ReadUserInfo
	@UserId			bigInt
AS
BEGIN
SELECT        
	ISNULL(DateOfBirth, '01/01/1899') as DateOfBirth, 
	ISNULL(HeightInches, 0) as HeightInches, 
	ISNULL(JoinDate,  '01/01/1899') as JoinDate, 
	ISNULL(UserName, '') as UserName,
	ISNULL(Gender, 2) as Gender,
	[Password],
	Email
FROM            
	Users	
Where 
	(Id = @UserId)
return @@rowcount
END
this is how I call this procedure using TUniStoredProc:

Code: Select all

procedure ReadUserInfo(var myUser: TMyUser);
var
  QTY: Integer;
begin
  with DM1.sp_Users_ReadUserInfo do
  begin
    Prepare;
    ParamByName('@UserId').Value := myUser.UserId;
    Execute;
    QTY := ParamByName('@RETURN_VALUE').Value;
    if QTY = 1 then
    begin
      myUser.UserName := FieldValues['UserName'];
      myUser.UserJoinDate := FieldValues['JoinDate'];
      myUser.UserDOB := FieldValues['DateOfBirth'];
      myUser.UserHeightInches := FieldValues['HeightInches'];
      myUser.UserGender := FieldValues['Gender'];
      myUser.UserEMail := FieldValues['Email'];
      myUser.UserPassword := FieldValues['Password'];
    end
    else
    begin
      myUser.UserName := '';
      myUser.UserHeightInches := 0;
    end;
  end;
end;
the above stored procedure and the code calls that are working with no problem when I choose Windows platform as my target platform but for mobile platforms when I call the procedure "ReadUserInfo" with same parameters the return value of the stored procedure is always equal to Zero!
I have no idea why this is happening! same code but different results!

hope someone can find where I am doing something wrong!

thanks

Re: Something wrong with TStoredProc in a Firemonkey Multi Platform Application

Posted: Fri 25 Nov 2016 13:56
by azyk
Thank you for the information. We have reproduced the problem and will investigate it. We will notify you about the results as any are available.

Re: Something wrong with TStoredProc in a Firemonkey Multi Platform Application

Posted: Mon 06 Mar 2017 11:15
by azyk
We fixed the bug. This fix will be included in the next UniDAC build.

If you want to get this change before the next UniDAC release, please send your license number to andreyz*devart*com and we will send you a night build.