0

I'm not sure how to properly retrieve the OUT parameters from a stored procedure in symfony using doctrine.

My stored procedure looks like:

PROCEDURE procedure_name (IN val1 NUMERIC(10), ... , OUT out1 NUMERIC(10), OUT out2 NUMERIC(10), OUT out3 NUMERIC(10))

I've tried:

$sql = "CALL procedure_name('$val1', ... , @out1, @out2, @out3)";
$con = Doctrine_Manager::connection();
$statement = $con->prepare($sql);
$statement->execute();
$result = $con->query("SELECT @out1, @out2, @out3")->fetch_object();

But that fails with the error "You must have at least one component specified in your from."

Any ideas?

1 Answer 1

1

Solution:

$sql = "CALL procedure_name('$val1', ... , @out1, @out2, @out3)";
$con = Doctrine_Manager::getInstance()->getCurrentConnection();
$statement = $con->prepare($sql);
$statement->execute();
$statement->closeCursor();
$result = $con->fetchAssoc("SELECT @out1, @out2, @out3");
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.