advanced SQL

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chris Mosser

    advanced SQL

    Until recently, I thought MySQL, and SQL in general was no problem....doin g
    simple INSERTS, DELETES, and UPDATES;...then I heard about triggers,
    transactions, and stored procedures which I only slightly know what they
    are. Can any one point me to a good tutorial on these advanced topics...I
    am already googleing around...but am wondering if any one has any specific
    places for me to look.

    --
    Chris Mosser


  • Nikolai Chuvakhin

    #2
    Re: advanced SQL

    "Chris Mosser" <cmosser@comcas t.net> wrote in message
    news:<-PmcnabKKP3wupOi XTWJiA@comcast. com>...[color=blue]
    >
    > Until recently, I thought MySQL, and SQL in general was
    > no problem....doin g simple INSERTS, DELETES, and UPDATES;
    > ...then I heard about triggers, transactions, and stored
    > procedures which I only slightly know what they are.
    > Can any one point me to a good tutorial on these advanced
    > topics...[/color]

    The best place to look is the language reference manual for
    the database you are working with.

    As to MySQL, it does not support triggers and stored procedures
    (the word is, in version 5 it will). Transactions, however, are
    supported:



    Cheers,
    NC

    Comment

    • Louis-Philippe Huberdeau

      #3
      Re: advanced SQL

      PHP will not support triggers and stored procedures until MySQL5
      (currently in development but no ETA).

      As for Transactions, those are availible if you use InnoDB or BerkleyDB
      storage (and not the default MyISAM). To use them in PHP, you will need
      to use the mysqli library (MySQL Improved), which should be shipped with
      PHP5 but will probably be in PHP4 someday. The library is currently
      availible, you can probably get it from the CVS.

      Transactions are quite simple:
      Do normal queries and for them to apply on the 'real' database, you need
      to commit. Otherwise, it will do a rollback and all changes you made
      will disapear.

      I don't know about any tutorial, but I hope those informations were
      useful. You might want to search for PHP + MySQL + InnoDB and such on
      your favorite search engine.

      Chris Mosser wrote:[color=blue]
      > Until recently, I thought MySQL, and SQL in general was no problem....doin g
      > simple INSERTS, DELETES, and UPDATES;...then I heard about triggers,
      > transactions, and stored procedures which I only slightly know what they
      > are. Can any one point me to a good tutorial on these advanced topics...I
      > am already googleing around...but am wondering if any one has any specific
      > places for me to look.
      >
      > --
      > Chris Mosser
      >
      >[/color]

      Comment

      • Chris Mosser

        #4
        Re: advanced SQL



        --[color=blue]
        >
        > I don't know about any tutorial, but I hope those informations were
        > useful. You might want to search for PHP + MySQL + InnoDB and such on
        > your favorite search engine.[/color]


        will do..thanx for the info guys

        cmosser


        Comment

        • Agelmar

          #5
          Re: advanced SQL

          Chris Mosser wrote:[color=blue][color=green]
          >>
          >> I don't know about any tutorial, but I hope those informations were
          >> useful. You might want to search for PHP + MySQL + InnoDB and such on
          >> your favorite search engine.[/color]
          >
          >
          > will do..thanx for the info guys
          >
          > cmosser[/color]

          One other note is that if you want to use mysqli, you must use MySQL >= 4.1,
          and 4.1 is still verymuch alpha quality (and designated as such).


          Comment

          • Sam Williams

            #6
            Re: advanced SQL

            On Fri, 11 Jul 2003 11:18:48 -0400, Louis-Philippe Huberdeau
            <lphuberdeau@sy mpatico.ca> wrote:
            [color=blue]
            > PHP will not support triggers and stored procedures until MySQL5
            > (currently in development but no ETA).[/color]

            I think you mean that MySQL will not support triggers/stored procedures
            until version 5 :-) These functions are performed within the database and
            have nothing to do with php...

            If you have need for triggers/stored procedures or row level table
            locking, I suggest that you use postgresql instead of mysql. It supports
            all these things and is IMHO a much better product. You can access
            postgresql through either the native functions in php or using ODBC (my
            preference as it leads to portable applications). The postgresql manual is
            also very good at explaining how to write queries, design tables, use
            these advanced features and optimise databases.

            Regards,

            Sam.
            ---
            Posted via news://freenews.netfront.net
            Complaints to news@netfront.n et

            Comment

            • Louis-Philippe Huberdeau

              #7
              Re: advanced SQL

              This was definetly a typo, thanks for pointing it out. I should really
              start reading what I write once in a while.

              Sam Williams wrote:[color=blue]
              > On Fri, 11 Jul 2003 11:18:48 -0400, Louis-Philippe Huberdeau
              > <lphuberdeau@sy mpatico.ca> wrote:
              >
              >[color=green]
              >>PHP will not support triggers and stored procedures until MySQL5
              >>(currently in development but no ETA).[/color]
              >
              >
              > I think you mean that MySQL will not support triggers/stored procedures
              > until version 5 :-) These functions are performed within the database and
              > have nothing to do with php...
              >
              > If you have need for triggers/stored procedures or row level table
              > locking, I suggest that you use postgresql instead of mysql. It supports
              > all these things and is IMHO a much better product. You can access
              > postgresql through either the native functions in php or using ODBC (my
              > preference as it leads to portable applications). The postgresql manual is
              > also very good at explaining how to write queries, design tables, use
              > these advanced features and optimise databases.
              >
              > Regards,
              >
              > Sam.
              > ---
              > Posted via news://freenews.netfront.net
              > Complaints to news@netfront.n et[/color]

              Comment

              • Heikki Tuuri

                #8
                Re: advanced SQL

                Hi!

                "Louis-Philippe Huberdeau" <lphuberdeau@sy mpatico.ca> kirjoitti viestissä
                news:PpqQa.1402 $104.143350@new s20.bellglobal. com...[color=blue]
                > This was definetly a typo, thanks for pointing it out. I should really
                > start reading what I write once in a while.
                >
                > Sam Williams wrote:[color=green]
                > > On Fri, 11 Jul 2003 11:18:48 -0400, Louis-Philippe Huberdeau
                > > <lphuberdeau@sy mpatico.ca> wrote:
                > >
                > >[color=darkred]
                > >>PHP will not support triggers and stored procedures until MySQL5
                > >>(currently in development but no ETA).[/color]
                > >
                > >
                > > I think you mean that MySQL will not support triggers/stored procedures
                > > until version 5 :-) These functions are performed within the database[/color][/color]
                and[color=blue][color=green]
                > > have nothing to do with php...[/color][/color]

                MySQL-5.0 is already available as a source tree
                http://www.mysql.com/doc/en/Installing_source_tree.html.

                I saw it run stored procedures in February. My guess is that the first
                binary 5.0 release will happen around January 2004.
                [color=blue][color=green]
                >> If you have need for triggers/stored procedures or row level table
                >> locking,[/color][/color]

                MySQL has supported row level locking for over 2 years now, starting from
                MySQL-Max-3.23.34a.

                ....[color=blue][color=green]
                > >
                > > Regards,
                > >
                > > Sam.[/color][/color]

                Best regards,

                Heikki Tuuri
                Innobase Oy

                Transactions, foreign keys, and a hot backup tool for MySQL


                Comment

                Working...