How to get the result of a precedent that is in the datasnap server

Asked

Viewed 449 times

1

needing a little help here I have this function on the datasnap server

//query that is in fqy_SaldoRs is "PRC_SALDO_MOTOQUEIRO :pMoto" which is nothing more than a query that takes an integer type parameter and returns a double

function TServerMethods1.fnc_RetornaSaldo(matricula: Integer): Boolean;
begin
 Result := False;
  with fqy_SaldoRs do
  begin
    Close;
    Params[0].AsInteger := matricula;
    Open;
    Result := True;
  end;
  fqy_SaldoRs.Close;
end;

The server and datasnap webbroker how do I pick up this return from the client side ???

  • I guess you just change the function fnc_RetornaSaldo exchanging the return of Boolean for Double and in the Result put the value returned by Query.

  • I think that this does not change at least in my understanding if the select returns something is because it is true just as if it returns 1 would be an integer I could perfectly have declared this Function as integer. The question is la on the client how do I get the result ?

  • 1

    Dude, that code of yours is kind of messed up. In this structure, Result will always be True, unless an error occurs before the Result := True; . In your case, I think I could change the True for not(IsEmpty).&#Another question is the name of his method, apparently by name I hope he returns the Balance to me, and he will only tell me if I have data in the balance table for a certain enrollment. Now let’s actually ask your question. Do you get anything in Client? How is the call of this method being made? There are other methods on your server that are working?

  • You have already updated the server functions in the client?...

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.