5 Replies Latest reply on Jul 11, 2017 7:42 AM by Marwim

    pl/sql package

    dee

      is it possible to create a pl/sql package in which if the schema name and table number are passed as parameters then it would display all the rows in that table?

      i am beginner to pl/sql and would like to hear your ideas

        • 1. Re: pl/sql package
          EdStevens

          DEE wrote:

           

          is it possible to create a pl/sql package in which if the schema name and table number are passed as parameters then it would display all the rows in that table?

          i am beginner to pl/sql and would like to hear your ideas

          What is a "table number"?

           

          If you mean "table name", then yes, it is possible.

          It is also possible to poke yourself in the eye with a sharp stick.  Just because something is possible does not mean it is a good idea.

          What problem do you think would be solved by your proposal?  It sounds to me like a solution in search of a problem.

          • 2. Re: pl/sql package
            dee

            sorry i meant table_name.

             

            to clarify the goal is not to solve any problem, was asking just a beginner trying hands at pl/sql programming.

            • 3. Re: pl/sql package
              EdStevens

              DEE wrote:

               

              sorry i meant table_name.

               

              to clarify the goal is not to solve any problem, was asking just a beginner trying hands at pl/sql programming.

              Then from my previous response:

               

              If you mean "table name", then yes, it is possible.

              It is also possible to poke yourself in the eye with a sharp stick.  Just because something is possible does not mean it is a good idea.

               

              You should not "try your hand" at bad programming and bad design.  Focus on techniques that solve real problems.

              • 4. Re: pl/sql package
                Marwim

                As EdStevens already said - it is not a good example if you are a beginner. It needs dynamic SQL. While this is not really hard to do it is something most of us avoid if possible because it can't be checked at compile time and it is harder to debug.

                IMHO for beginners it is much more important to write simple code that shows the basics of exception handling (PL/SQL 101 : Exception Handling ) and logging/debugging.

                 

                Spoiler: there is a solution for your problem here in this forum Re: exporting csv via pl/sql - select statement?

                 

                Regards

                Marcus

                • 5. Re: pl/sql package
                  Marwim

                  BTW: This is the wrong forum for this kind of session it is for the tool "SQL Developer"

                  You should post in SQL and PL/SQL instead.