OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

Forums Forums OroPlatform OroPlatform – How do I? Questions How to use Stored Procedures in Controller

This topic contains 2 replies, has 2 voices, and was last updated by  shreyas 7 years, 5 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #36333

    shreyas
    Participant

    Hi Team,

    I am writing a custom report. I am trying to use a stored procedure in a controller function. when i call the stored procedure i am able to get result in controller when i debug the array obtained using print_r().Even when i send this array to twig template i am able to get result as needed.Now when i extend the index twig page from OroUIBundle i.e ({% extends ‘OroUIBundle:actions:index.html.twig’ %} )it throws an error.

    Please find the Controller function used to call stored procedure and send result to twig file:

    Please find the twig file used to access the data:

    Now using this file when i try accessing the Stored Procedure , i get the error as

    Please find exception details thrown in given below screenshot:
    Error FOr Stored Procedure

    Now if i comment {% extends ‘OroUIBundle:actions:index.html.twig’ %} in twig above , i get expected result in plain browser page.i am not sure on how to use stored procedure in OROCRM so that i can extend UIBundle index page to get default OROCRM style page.Please need help in how to solve this issue.

    Thanks & Regards,
    Shreyas S

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #36334

    Mike Kudelya
    Participant

    Hi,

    There are many variants resolving our problem. Please tell me later, which approach will help you.

    #36335

    shreyas
    Participant

    HI Mike,
    Thanks a lot for sharing the link . It worked. From the link both Solution 1 & Solution 4 were suitable for our Stored Procedure. i.e 1) using of closeCursor() (or) 2) using of unset() .

    Please find the working code snippet shared for the same:

    From the code above any of the two solutions(using unset / using closeCursor) can be used to deal with the exception occured.
    Thanks a lot for the help again!

    Thanks & Regards,
    Shreyas S

Viewing 2 replies - 1 through 2 (of 2 total)

The forum ‘OroPlatform – How do I? Questions’ is closed to new topics and replies.

Back to top