I have created a stored procedure which do some updates in database. Now when I am trying to add that stored procedure using magento install script from sql folder, It is not being updated..

I cannot see stored procedure created in database.. I am using below syntax there

$write = Mage::getSingleton('core/resource')->getConnection('core_write');

1 Answer 1


Thank you all. I got solution from another stackoverflow comment

Now I have used syntax as below.

$sql = <<< __SQLPRC

and run it using

$write = Mage::getSingleton('core/resource')->getConnection('core_write');

and it is working fine now

  • Does the .sql file not work in your scenario? (Which imo sounds like the better way of running SQL code)
    – Ash
    Commented Sep 23, 2014 at 13:13
  • I have not tried it as now I got solution using php file. But will try that in future
    – shabbir
    Commented Sep 23, 2014 at 13:14
  • I would recommend looking over This article by Alan Storm to understand how set-up resources work and i'm then sure you can create a install-X.X.X.sql to run the SQL syntax directly as your solution is a long winded way of the same thing.
    – Ash
    Commented Sep 23, 2014 at 13:18

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.