Welcome Guest, Not a member yet? Register   Sign In
mySQL Stored Procedure "does not exist"
#1

CI v 3.1.10

I am trying to call a Stored Procedure without much success. I am getting an error message 

I have no problem calling the procedure from the mysql console in PHPStorm.

My code and the error

$stmt = "CALL spinup()";
$res = $db->query($stmt);
print_r( $db->errorInfo()); 
// Array ( [0] => 42000 [1] => 1305 [2] => PROCEDURE archives.spinup does not exist )

The procedure is created like so....

DELIMITER ;
DROP PROCEDURE IF EXISTS archives.spinup;
DELIMITER //

CREATE
    definer = admin@`%` PROCEDURE `archives`.`spinup`()
BEGIN


-- creating tables here....

SELECT "DONE";
END//
DELIMITER


I have searched high and low and can find no answer as to why the procedure is not being "found" since it absolute does exist.
Reply
#2

Read this:

3 Easy Steps To Call Stored Procedure In Codeigniter
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

(This post was last modified: 11-26-2020, 09:24 PM by ojmichael.)

PHP Code:
USE `archives`;
DROP procedure IF EXISTS `spinup`;

DELIMITER $$
USE `
archives`$$
CREATE PROCEDURE `spinup` ()
BEGIN

-- creating tables here....

SELECT "DONE";
END$$

DELIMITER 
Reply
#4

thanks ojmichael - tried this code and made no difference....this getting Procedure Does not exist error
Reply
#5

(11-26-2020, 02:10 PM)InsiteFX Wrote: Read this:

3 Easy Steps To Call Stored Procedure In Codeigniter
Good information

When is use this method

$stmt = "CALL spinup()";
$data = $this->db->query($stmt);
$result = $data->result();

I get this error

Call to a member function result() on boolean
Reply
#6

Thanks for all the replies - problem was discovered by my colleague who is the CI admin. Turns out the PDO connection was pointing to a different instance of our RDS on AWS. Once I switch the target RDS it worked like a charm !
Reply
#7

Both MySQL and MariaDB are showing the same error when the table doe's not exist.

Read:

MySQL DROP PROCEDURE
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB