MySQL Forums
Forum List  »  Stored Procedures

Stored Procedure with multiple select statements
Posted by: U. Tscharntke
Date: February 15, 2020 04:48AM

I have a stored procedure like this

procedure Test( in Nr int );
begin
  declare Result int;

  select Nr-5;
  set Result = (select Nr+5);
  select Nr,Result;
end

As a result of

call Test( 100 );

I expect to see
Quote

100 , 105
but I see the result of the first select statement:
Quote

95
What does I make wrong?

Options: ReplyQuote


Subject
Views
Written By
Posted
Stored Procedure with multiple select statements
630
February 15, 2020 04:48AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.