Does OpenAccess support calling the system level stored procedures?

2 posts, 0 answers
  1. Greg
    Greg avatar
    16 posts
    Member since:
    Sep 2013

    Posted 10 Dec 2013 Link to this post

    I have OpenAccess setup for a project of mine and I need to call one of the system level sprocs (sp_help_job) to get the date and time the job is schedule to run again.  However, I do not see any way to create a domain method for this sproc.  I have added the model for the MSDB database, and that works fine.  But when I try to create the domain method for the sp_help_job sproc, it cannot retrieve the result shape. 

    I guess I could figure out what the shape looks like, build a tempoary table, then use it to generate the shape.  Is that my only option?  I am not sure I can do that because it would require that I modify the system level sproc.

    In that case, I guess I could create a new sproc, create the shape, then somehow tell this domain method to use it?

    What are my options here?
  2. Doroteya
    Admin
    Doroteya avatar
    502 posts

    Posted 13 Dec 2013 Link to this post

    Hello Jon,

    Indeed, the approach you describe for the execution of the stored procedure is in the correct direction, and Domain Method Editor does not support code generation for system stored procedures.

    You can complete the necessary task and retrieve the result from the procedure with the help of our Low Level ADO API. It basically offers a wide variety of means that allow you to execute SQL statements through ADO like code. One of them allows you to translate DbDataReader objects to non-persistent types. The details about the workflow are described in this documentation article.

    Additionally, kindly find attached a sample console application that implements the workflow. In order to run it, I would suggest to you the following workflow:
    1. Unrar the attached file.
    2. Apply the necessary settings for the connection string in the app.config file.
    3 Upgrade the OpenAccess references as described in this documentation article.
    4. Build the solution and run the sample.

    Note that the sample utilizes Visual Studio 2013. If you experience difficulties opening it, let us know.

    I hope you find this feasible. If you need additional information or further assistance, do not hesitate to get back to us.


    Regards,
    Doroteya
    Telerik
    OpenAccess ORM Q3 2013 simplifies your model operations even further providing you with greater flexibility. Check out the list of new features shipped with our latest release!
  3. DevCraft banner
Back to Top