0

i am writing stored procedures in MySQL that return values;

CREATE PROCEDURE getCustomerById (id int)
BEGIN
 SELECT *
    FROM customer
 WHERE customer.id = id;
END;

and i get the error that the results cannot be shown in the given context.

after some googling, i think that i need to set the flag "CLIENT_MULTI_RESULTS" - i am connecting the database from JDBC using a java app, but cant find where to set it!

any suggestions?

OMG Ponies
  • 325,700
  • 82
  • 523
  • 502
aadersh patel
  • 709
  • 3
  • 8
  • 9

1 Answers1

0

try this

delimiter ;

drop procedure if exists getCustomerById;

delimiter #

create procedure getCustomerById
(
 in p_id int unsigned
)
begin
  select c.* from customer c where c.id = p_id;
end #

delimiter ;
Jon Black
  • 16,223
  • 5
  • 43
  • 42