Forum Discussion

alibaba82's avatar
alibaba82
Super Contributor
18 years ago

How to call stored procedures in a datasource step.

Hello,
can you shed some light on how to call a stored procedure using the datasource step. I specified the driver, connection string. Not sure how to use the properties and SQL query.

thanks

Ali

8 Replies

  • omatzura's avatar
    omatzura
    Super Contributor
    Hi Ali,

    The properties should be a list of properties that will be mapped to the values in each row returned by the stored procedure. The SQL should be in the following format:

    {call procedure_name[(?, ?, ...)]}

    so for example

    {call sp_getorders( '${Properties#customerId}' )}

    would call the sp_getorders stored procedure with the customerId property as its only argument..

    Hope this helps!

    regards,

    /Ole
    eviware.com
  • alibaba82's avatar
    alibaba82
    Super Contributor
    hello Ole,
    I talked to one of my developer to check how the stored procs work. He told me that his stored proc returns 2 result sets. each result set will have x number of column.

    How would I call such a stored proc.
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi Ali,

    you should be able to call the stored procedure by entering

    {call ()}

    in the SQL Query field and defining properties named after the columns returned (the same properties will be used for both result sets)

    Currently only the first result set will be correctly returned by the datasource (a fix for this will be in 2.0.3), but the above should at least get you going with the first result set.

    regards,

    /Ole
    eviware.com
  • alibaba82's avatar
    alibaba82
    Super Contributor
    Hi Ole,
    I got the stored proc to work but had a question/suggestion.
    My XML response looks something like this


                  20494
                  Los Angeles Area Channels
                  Los Angeles


                  64121
                  Eagle Rock
                  Eagle Rock

    ..... (lot of these service datatypes)

    When I call my stored proc in the datasource, the result should have the same number of rows as the number of Service Datatypes in my XML Response.

    The problem is that I want to the check that each service datatype in the response matches each row returned by the stored proc. This requires that I create 3 assertions for each service datatype.

    You can see how this is very time consuming if I have to validate on a large response.

    Do you have any suggestion on improvement to soapUI on how best to do this.

    THanks

    Ali
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi Ali,

    hmm.. if we could somehow aggregate all rows in the datasource to one large block of xml and then just do one assertion on the entire block, would that be feasible for you?

    regards,

    /Ole
    eviware.com
    • ANDYtyara's avatar
      ANDYtyara
      Occasional Contributor

      Hi Team,

      I am having one oracle store procedure craeted with IN and OUT parameters in ORACLE database.

      I am trying to call it from SOAP 5.2.1 version with JDBS request test step.


      Can you please tell me how to call store procedure with input and output parameters?

      Also do i need to mention all input and output parameters in property list first ? and also how to pass them while calling store procedure?

      It would be helpful if you explain with one example.


      Your help would be appreciated.

      • groovyguy's avatar
        groovyguy
        Community Hero

        ANDYtyara: You've replied to a post that is almost 9 years old. You will want to create a post for your problem instead of attaching it to a long since dormant thread. This will give the people coming into the thread more visibility for your problem instead of potentially confusing the original problem with your's.