how to resolve General error: 2014 Cannot execute queries while other unbuffered queries are active. using PDO connection


Steve O.
HOME ยป Databases

While i am executing second Stored procedure with same connection statement(Using PDO), getting the below error.


=================================================


SQLSTATE[HY000]:
General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll().
Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.


=======================================================


This is my code in drupal


$conn->setAttribute(

Related to : how to resolve General error: 2014 Cannot execute queries while other unbuffered queries are active. using PDO connection
how to resolve General error: 2014 Cannot execute queries while other unbuffered queries are active. using PDO connection
Databases

While i am executing second Stored procedure with same connection statement(Using PDO), getting the below error.


=================================================


SQLSTATE[HY000]:
General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll().
Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.


=======================================================


This is my code in drupal


$conn->setAttribute(
CDbCommand::fetchColumn() failed: SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active
Databases

I want to be able to get some output from mysql stored procedure within OUT params but for case when stored procedure also returns result set via select statement like one below.


DELIMITER $$
DROP PROCEDURE IF EXISTS `RD`.`sp`$$
CREATE DEFINER=`root`@`%` PROCEDURE `sp`(in b int, out a int)
BEGIN
select 664656 into a;
select 5;
END$$
DELIMITER ;

Runing in console below mentioned command one by one


call sp(5,@a)
select @a

we will get result
5 => 5
@a => 664656


However

I get 2014 Cannot execute queries while other unbuffered queries are active when doing exec with PDO
Databases

I am doing a PDO::exec command on multiple updates:


$MyPdo->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY,true);
$MyPdo->exec("update t1 set f1=1;update t2 set f1=2");

I am doing it inside a transaction, and I keep getting:


SQLSTATE[HY000]: General error: 2014
Cannot execute queries while other
unbuffered queries are active.
Consider using
PDOStatement::fetchAll().
Alternatively, if your code is only
ever going to run against mysql, you
may enable query buffering by setting
the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY
attribute

"Cannot execute queries while other unbuffered queries are active" error in loop
Databases

I'm sorry for asking this question. I've read alot just like it, but never found a solution that I successfully could implement. All the tips and tricks that I've found has been to no use for me.I have a large associative array with data that I want to insert into a mysql database using a stored procedure with PDO.$data_arr = {a lot of data with keys: Name, Nbr, Val} //This is really 41 columns$inputs = array('Name','Nbr','Val');$query = 'CALL add_edit_standard(:Name,:Nbr,:Val)';$stmt =


HD Wallpapers
3D
3D Abstract
City
Celebrities
Indian Celebrities
Cars
Travel
Girls
Animals Birds
Movies
Sports
Black White
Nature
Planes
Anime
Food Drink
Dreamy Fantasy
Architecture
Games
Space
Holidays
Flowers
Love
Artistic
Baby
Beach
Bikes Motorcycles
Macro
Computers
Vector
Funny
Army
Textures
Brands
Misc
Music
Other
Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .