13 Replies Latest reply on Dec 3, 2010 7:41 PM by 6363

    10 database commandments

    Sven W.
      I went to a hill and the powers of Larry have given me the following

      h1. 10 Database Commandmends
      -----
      OBEY! and you'll be enlightend

      h3. 10th Thou shall not write "when others exceptions"!

      h3. 9th Thou shall not convert data types implicitly!

      h3. 8th Thou shall not forget to use alias names!

      h3. 7th Thou shall not commit during cursor loops or inside triggers!

      h3. 6th Thou shall not duplicate data!

      h3. 5th Remember analytic functions and the keep syntax!

      h3. 4th Honor the ANSI Sql!

      h3. 3th Do not write dynamic sql without good reason!

      h3. 2nd Minimize PL/SQL, maximize SQL!

      h2. 1st Thou shall not have other databases besides ORACLE!


      OBEY! and you'll be enlightend. All sinners will go to the documentation hell!
        • 1. Re: 10 database commandments
          rui_catcuddler
          gulp!

          ~we're already in documentation hell. Seen the the 11.2 docs lately?~
          • 2. Re: 10 database commandments
            ChrisAyre
            Sven W. wrote:
            h3. 10th Thou shall not write "when others exceptions"!
            Should really add "without logging and/or raising" to that!
            • 3. Re: 10 database commandments
              6363
              Sven W. wrote:

              h3. 9th Thou shall not convert data types implicitly!
              And thou better not store dates as numbers or strings, or store numbers as strings.

              >
              h3. 7th Thou shall not commit during cursor loops or inside triggers!
              And thou better have a reason for using either other than you want to slow something down as much as possible or violate transactional integrity and cause much weeping and gnashing of teeth amongst thine users.

              >
              h3. 4th Honor the ANSI Sql!
              Oh dear, it was all going so well up to that point.

              Re: Why Left and Right Joins if only one of them can serve the same purpose?
              Re: ANSI SQL syntax?
              Re: Using (+) for joins ??
              Re: Using (+) for joins ??
              • 4. Re: 10 database commandments
                Sven W.
                BigC wrote:
                Sven W. wrote:
                h3. 10th Thou shall not write "when others exceptions"!
                Should really add "without logging and/or raising" to that!
                First you need to adapt to the new religion. Only religious leaders are allowed to (natively) interpret the wisdom that was given me.

                Every doubt is blasphemy! Splitter!
                • 5. Re: 10 database commandments
                  Sven W.
                  3360 wrote:
                  Sven W. wrote:

                  h3. 9th Thou shall not convert data types implicitly!
                  And thou better not store dates as numbers or strings, or store numbers as strings.
                  That almost had made it as the 6th commandment. ;)

                  4th Honor the ANSI Sql!
                  Oh dear, it was all going so well up to that point.
                  h1. Sinner!

                  Edited by: Sven W. on Aug 26, 2010 4:40 PM
                  • 6. Re: 10 database commandments
                    SomeoneElse
                    I propose a new #1...RTFM!
                    • 7. Re: 10 database commandments
                      6363
                      Sven W. wrote:
                      3360 wrote:
                      >
                      4th Honor the ANSI Sql!
                      Oh dear, it was all going so well up to that point.
                      h1. Sinner!
                      And Codd did deliver set theory based on mathematics and it was implemented simply so that one tuple was either equal to or optionally equal to another and all was clean in the garden of Oracle.

                      But, lo the garden was descended upon by the unclean hordes of ANSI and was strewn with joins of all kinds, natural, inner, left, outer, right, full and cross and all was cluttered and a right (or left) mess.
                      • 8. Re: 10 database commandments
                        HG75
                        >
                        h2. 1st Thou shall not have other databases besides ORACLE!
                        the future of that "+dolphin+" db is detemined then with this command.
                        • 9. Re: 10 database commandments
                          VitaminD
                          Great Sven.

                          +2nd Minimize PL/SQL, maximize SQL!+

                          Did attend a seminar by Steve Feurenstien in Bangalore (2007). He wanted less SQL and more Procedural stuff in the Code.
                          • 10. Re: 10 database commandments
                            Sven W.
                            VitaminD wrote:
                            Great Sven.

                            +2nd Minimize PL/SQL, maximize SQL!+

                            Did attend a seminar by Steve Feurenstien in Bangalore (2007). He wanted less SQL and more Procedural stuff in the Code.
                            I fact he preaches to never write SQL twice but to reuse it. Meaning write SQL only once and wrap it inside a little piece of PL/SQL to be able to access it again.

                            Even if that sounds very close to blasphemy, it is wonderful. PL/SQL in this case is only the medium that allows us to constantly use the full power of SQL. SQL in this case is not replaced but guarded from evil (like accessing it without bind variables from some java call) by this nice warm coat of pl.

                            This commandment enforces to use SQL whereever possible instead of writeing the same logic completly in PL/.

                            Besides that:

                            h1. DO NOT DOUBT THE ONE AND ONLY TRUE WISDOM !
                            • 11. Re: 10 database commandments
                              Etbin
                              According to Mel Brooks's History of the World - Part I, there were fifteen commandments before Moses dropped one of the tablets ... so
                              *11th Thou shall write and use triggers only the way T.K.* (Tom Kyte and/or Toon Koppelaars) preach to have it done !

                              Regards

                              Etbin
                              • 12. Re: 10 database commandments
                                mtefft
                                Thou shalt not grant privileges exceeding the least that is needed, for such licentiousness causes much covetousness and abuse.
                                • 13. Re: 10 database commandments
                                  6363
                                  Sven W. wrote:
                                  VitaminD wrote:
                                  Great Sven.

                                  +2nd Minimize PL/SQL, maximize SQL!+

                                  Did attend a seminar by Steve Feurenstien in Bangalore (2007). He wanted less SQL and more Procedural stuff in the Code.
                                  I fact he preaches to never write SQL twice but to reuse it.
                                  And the way to do that would be to create a view. No PL/SQL needed.

                                  But then again, he does have a bunch of PL/SQL books, development tools and websites to promote.