Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. multiple select statements in stored procedures

multiple select statements in stored procedures

Scheduled Pinned Locked Moved Database
databasesql-serveroraclesysadmintools
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • X Offline
    X Offline
    Xiangyang Liu
    wrote on last edited by
    #1

    With SQL server, it is easy to have multiple select statements in a stored procedure, the outputs for the select statements are just tables in the output data set. Is it possible to do this in Oracle? Thanks.

    My Younger Son & His "PET"

    P J 2 Replies Last reply
    0
    • X Xiangyang Liu

      With SQL server, it is easy to have multiple select statements in a stored procedure, the outputs for the select statements are just tables in the output data set. Is it possible to do this in Oracle? Thanks.

      My Younger Son & His "PET"

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      Yes. Have a look at this[^] thread to get some ideas.

      I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be

      Forgive your enemies - it messes with their heads

      My blog | My articles | MoXAML PowerToys | Onyx

      X 1 Reply Last reply
      0
      • X Xiangyang Liu

        With SQL server, it is easy to have multiple select statements in a stored procedure, the outputs for the select statements are just tables in the output data set. Is it possible to do this in Oracle? Thanks.

        My Younger Son & His "PET"

        J Offline
        J Offline
        Jorgen Andersson
        wrote on last edited by
        #3

        Here's[^] an example, scroll down to "Returning Results with Oracle REF CURSORs" The example is for a DataReader, but the same principle applies to a DataAdapter.

        "When did ignorance become a point of view" - Dilbert

        X 1 Reply Last reply
        0
        • P Pete OHanlon

          Yes. Have a look at this[^] thread to get some ideas.

          I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be

          Forgive your enemies - it messes with their heads

          My blog | My articles | MoXAML PowerToys | Onyx

          X Offline
          X Offline
          Xiangyang Liu
          wrote on last edited by
          #4

          I looked at the link you provided: It is not the same thing. The solution provided requires two select statements to return the same number of columns and the column types have to match. While in SQL server, you can have an arbitrary number of select statements and arbitrary data types. I guess the answer to my question is NO. Thanks.

          My Younger Son & His "PET"

          1 Reply Last reply
          0
          • J Jorgen Andersson

            Here's[^] an example, scroll down to "Returning Results with Oracle REF CURSORs" The example is for a DataReader, but the same principle applies to a DataAdapter.

            "When did ignorance become a point of view" - Dilbert

            X Offline
            X Offline
            Xiangyang Liu
            wrote on last edited by
            #5

            That looks like a good solution. Thanks.

            My Younger Son & His "PET"

            J 1 Reply Last reply
            0
            • X Xiangyang Liu

              That looks like a good solution. Thanks.

              My Younger Son & His "PET"

              J Offline
              J Offline
              Jorgen Andersson
              wrote on last edited by
              #6

              You're welcome.

              "When did ignorance become a point of view" - Dilbert

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups