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. Oracle Collection Objects

Oracle Collection Objects

Scheduled Pinned Locked Moved Database
databaseoraclexmlquestion
6 Posts 2 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.
  • L Offline
    L Offline
    lionelcyril
    wrote on last edited by
    #1

    Whenever we create either permanent table or temporary tables it requires modification of the database schema. Is the same applicable for Collection objects? ie when we create collection objects does it modify the database schema/metatdata?

    W 1 Reply Last reply
    0
    • L lionelcyril

      Whenever we create either permanent table or temporary tables it requires modification of the database schema. Is the same applicable for Collection objects? ie when we create collection objects does it modify the database schema/metatdata?

      W Offline
      W Offline
      Wendelius
      wrote on last edited by
      #2

      This depends on the situation. For example if a collection is used in a procedure, information about the collection is stored in the system tables. Could you explain the situation a bit more, what kind of collection are you thinking of and what usage?

      The need to optimize rises from a bad design.My articles[^]

      L 1 Reply Last reply
      0
      • W Wendelius

        This depends on the situation. For example if a collection is used in a procedure, information about the collection is stored in the system tables. Could you explain the situation a bit more, what kind of collection are you thinking of and what usage?

        The need to optimize rises from a bad design.My articles[^]

        L Offline
        L Offline
        lionelcyril
        wrote on last edited by
        #3

        Hi, I am using a SSRS report and the report is generated by executing a stored procedure. The procedure gets 4 input values a,b,c,d where values c and d is a string containing multiple values. I am executing a complex SQL statement. For this i am using nested loop: A as INPUT B as INPUT C as INPUT (String input seperated by ,) D as input (String input seperated by ,) Cursor Cur as OUTPUT Loop for c Loop for d . . execute the above SQL Statement(select query) . . END loop END Loop problem: Now the results of the SQL statement has to be saved temporarily somewhere I am not allowed to use permanent/temporary tables as they require definition at schema level and modificaton of schema is not allowed. I need to save the value in the cursor at each runs, but in that case the previous results get overwritten. So i wanted to know collection objects and wanted to know if that too requires definition at schema level.

        W 1 Reply Last reply
        0
        • L lionelcyril

          Hi, I am using a SSRS report and the report is generated by executing a stored procedure. The procedure gets 4 input values a,b,c,d where values c and d is a string containing multiple values. I am executing a complex SQL statement. For this i am using nested loop: A as INPUT B as INPUT C as INPUT (String input seperated by ,) D as input (String input seperated by ,) Cursor Cur as OUTPUT Loop for c Loop for d . . execute the above SQL Statement(select query) . . END loop END Loop problem: Now the results of the SQL statement has to be saved temporarily somewhere I am not allowed to use permanent/temporary tables as they require definition at schema level and modificaton of schema is not allowed. I need to save the value in the cursor at each runs, but in that case the previous results get overwritten. So i wanted to know collection objects and wanted to know if that too requires definition at schema level.

          W Offline
          W Offline
          Wendelius
          wrote on last edited by
          #4

          Ok, well basically when you create a procedure (of any kind) and store it in the database, you modify the schema. So in this sense the requirement of leaving the schema intact doesn't make sense... Anyhow, you can use collections and for example if you're using a package, you can define the collection in your procedure or at package level. When you loop through the cursor you can store the results in the collection and later on modify them or add more results etc. If you're using package level variables, you can store the results in them even between procedure calls.

          The need to optimize rises from a bad design.My articles[^]

          L 1 Reply Last reply
          0
          • W Wendelius

            Ok, well basically when you create a procedure (of any kind) and store it in the database, you modify the schema. So in this sense the requirement of leaving the schema intact doesn't make sense... Anyhow, you can use collections and for example if you're using a package, you can define the collection in your procedure or at package level. When you loop through the cursor you can store the results in the collection and later on modify them or add more results etc. If you're using package level variables, you can store the results in them even between procedure calls.

            The need to optimize rises from a bad design.My articles[^]

            L Offline
            L Offline
            lionelcyril
            wrote on last edited by
            #5

            when i store the results in the collection while i run the loop. can i save the results into the cursor.

            W 1 Reply Last reply
            0
            • L lionelcyril

              when i store the results in the collection while i run the loop. can i save the results into the cursor.

              W Offline
              W Offline
              Wendelius
              wrote on last edited by
              #6

              Not directly. If you're using output cursors, you pass the cursor to the caller at the end but the cursor is based on a query from an object. I know that you can create a cursor based on a nested table but I have never tried that with associative arrays or varrays.

              The need to optimize rises from a bad design.My articles[^]

              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