Something wrong with TStoredProc in a Firemonkey Multi Platform Application

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
2mrezaee
Posts: 4
Joined: Tue 22 Nov 2016 23:49

Something wrong with TStoredProc in a Firemonkey Multi Platform Application

Post by 2mrezaee » Wed 23 Nov 2016 00:26

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

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

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

Post by azyk » Fri 25 Nov 2016 13:56

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.

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

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

Post by azyk » Mon 06 Mar 2017 11:15

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.

Post Reply