Questions tagged [mysql-error-1312]

PROCEDURE [name] can't return a result set in the given context

PROCEDURE [name] can't return a result set in the given context

7 questions
5
votes
4 answers

MySQL Stored Procedures not working with SELECT (basic question)

I am using a platform (perfectforms) that requires me to use stored procedures for most of my queries, and having never used stored procedures, I can't figure out what I'm doing wrong. The following statement executes without error: DELIMITER…
TMG
  • 500
  • 2
  • 6
  • 13
4
votes
1 answer

MYSQL ERROR: PROCEDURE can't return a result set in the given context

I am new to Stored procedure in mysql This is the procedure for returning difference of date excluding Weekends, but it returns error #1312 - PROCEDURE blog1.DayCount can't return a result set in the given context This is the procedure DROP…
sathish
  • 6,705
  • 3
  • 30
  • 35
4
votes
1 answer

Why Am I Getting MySQL Error #1312 when Using a Simple Stored Procedure?

I'm trying to learn how to use MySQL stored procedures. MySQL accepted my procedure: CREATE PROCEDURE SimpleProc() BEGIN SELECT * FROM myTable; END (In phpMyAdmin, I set // for delimiter. The real version has the name of an actual table…
Laxmidi
  • 2,650
  • 12
  • 49
  • 81
3
votes
2 answers

Mysql stored procedure

I have created a stored procedure in Mysql, as : DELIMITER // CREATE PROCEDURE test() BEGIN SELECT * FROM buyers; END // DELIMITER ; but when i call it using, call test() it returns an error saying : #1312 - PROCEDURE ticketninja.test1 can't…
Kalpesh Jain
  • 409
  • 3
  • 10
  • 19
1
vote
1 answer

Mysql stored procedure giving error at runtime

I have created a stored procedure in Mysql, as : delimiter $$ drop procedure if exists test9$$ Create procedure test9(test_type varchar(20)) Reads sql data begin Declare 1_id int; Declare 1_date varchar(20); Declare done int default 0; …
Kalpesh Jain
  • 409
  • 3
  • 10
  • 19
0
votes
1 answer

PEAR MDB2 executeStoredProc and returning a result set. Possible? Worth it?

I've been trying to make this work for the last couple of hours. I have a simple stored proc called get_log_entries: CREATE DEFINER=`root`@`localhost` PROCEDURE `get_log_entries`(p_min_id INT) BEGIN SET p_min_id = IFNULL(p_min_id, -1); SELECT *…
MK_Dev
  • 3,291
  • 5
  • 27
  • 45
0
votes
1 answer

stored procedures, error #1312, CLIENT_MULTI_RESULTS flag

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…
aadersh patel
  • 709
  • 3
  • 8
  • 9