Re: [PHP] Stored procedures in Mysql
Well, if you are running you own server at home, or have a dedicated server, you can install your own MySQL server, and use version 5, which has all this, but if you have a shared space, then you are probably running version 4.whatever, and don't have them. That's why I said not really, instead of a definite 'NO'. On 30 Sep 2004, at 23:54, Ed Lazor wrote: -Original Message- Not Really. Are you sure? http://dev.mysql.com/doc/mysql/en/Stored_Procedures.html On 30 Sep 2004, at 21:50, Sagar C Nannapaneni wrote: Hi folks, I wonder whether Mysql supports procedures and triggers :? /sagar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stored procedures in Mysql
Ed Lazor wrote: -Original Message- Not Really. Are you sure? http://dev.mysql.com/doc/mysql/en/Stored_Procedures.html Stored procedures and functions are a new feature in MySQL version 5.0. That means you can only experiment with them, not realy use them in your projects. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Stored procedures in Mysql
> -Original Message- > Not Really. Are you sure? http://dev.mysql.com/doc/mysql/en/Stored_Procedures.html > > On 30 Sep 2004, at 21:50, Sagar C Nannapaneni wrote: > > > Hi folks, > > > > I wonder whether Mysql supports procedures and triggers > > > > :? > > > > /sagar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stored procedures in Mysql
Not Really. On 30 Sep 2004, at 21:50, Sagar C Nannapaneni wrote: Hi folks, I wonder whether Mysql supports procedures and triggers :? /sagar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stored procedures in Mysql
I suppose if you are thinking that mysql and zend may have collaborated to make stored procedures available in veriosn 5, then i suppose this is on topic.. otherwise, check the mysql list. Jason "Sagar C Nannapaneni" <[EMAIL PROTECTED]> wrote: > > Hi folks, > > I wonder whether Mysql supports procedures and triggers > > :? > > /sagar > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stored Procedures
David Busby wrote: > List, > I'm using a postgres datbase for my PHP project, how do I make > stored procedures? Or if no SPs then what would be recomendation for > building simple/reuseable "Put" and "Get" procedures for my data? > > /B > > ðÒÉ×ÅÔ! Stored procedures ARE much better, (I have a long Oracle background so I am a biased source :)) BUT... If you want to make sure your code is fully portable you should take some cautions. That is: 1) don't use direct dbfunctions calls: (like mysql_something or pgsql_sothing). Make an insulation layer by calling DB_something, which is a function defined in a library of your own. If you have to move to another db engine you'll just change the redirection here and your SQL code will hold. 2) don't execute SPs directly, for the very same reason. In your insulation layer declare a procedure like DB_SP, which switches on the name of the SP you are calling and then calls the db. If you'll have to move to an engine that has no stored procedures you'll be able to write PHP functions (or whatever) that will substitute your SPs without killing your legacy stuff. ÐÏËÁ áÌØÂÅÒÔÏ ëÉÅ× -- @-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@ LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu? lOrD i'M sHiNiNg... YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE tHe TeSt, YeS iT iS ThE tEsT, yEs It Is tHe TeSt, YeS iT iS ThE tEsT, yEs It Is... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stored Procedures + Answer
also not the use of the procedural language plpgsql. This needs to be installed in the database that you are using. If you want it for all databases that you create you can do this... template1 => createlang plpgsql template1; This then allow all subsequently created databases to have plpgsql... B i g D o g - Original Message - From: "David Busby" <[EMAIL PROTECTED]> To: "php-general" <[EMAIL PROTECTED]> Sent: Friday, July 05, 2002 2:16 PM Subject: Re: [PHP] Stored Procedures + Answer > List, > I read the documentation on postgres site (http://techdocs.postgres.sql) > and then also the Google search and came up with this: > > The way PostgreSQL usees stored procedures is like this: > "A stored procedure is really a function" > It just does more...like INSERT/UPDATE/DELETE, multiple DELETE or > whatever. So to write them use a function but just call it "stored > procedure" fancy... > > Heres some code that I've never tested or run before: > > CREATE FUNCTION putData (char, varchar, varchar) RETURNS int > AS ' > DECLARE > x ALIAS FOR $1; > y ALIAS FOR $2; > z ALIAS FOR $3; > BEGIN > INSERT INTO tableA (colX, colY, colZ) VALUES (x, y, z); > RETURN 1; > END > ' LANGUAGE 'plpgsql'; > > Good Luck > > David Busby wrote: > > List, > > I'm using a postgres datbase for my PHP project, how do I make > > stored procedures? Or if no SPs then what would be recomendation for > > building simple/reuseable "Put" and "Get" procedures for my data? > > > > /B > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stored Procedures + Answer
List, I read the documentation on postgres site (http://techdocs.postgres.sql) and then also the Google search and came up with this: The way PostgreSQL usees stored procedures is like this: "A stored procedure is really a function" It just does more...like INSERT/UPDATE/DELETE, multiple DELETE or whatever. So to write them use a function but just call it "stored procedure" fancy... Heres some code that I've never tested or run before: CREATE FUNCTION putData (char, varchar, varchar) RETURNS int AS ' DECLARE x ALIAS FOR $1; y ALIAS FOR $2; z ALIAS FOR $3; BEGIN INSERT INTO tableA (colX, colY, colZ) VALUES (x, y, z); RETURN 1; END ' LANGUAGE 'plpgsql'; Good Luck David Busby wrote: > List, > I'm using a postgres datbase for my PHP project, how do I make > stored procedures? Or if no SPs then what would be recomendation for > building simple/reuseable "Put" and "Get" procedures for my data? > > /B > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stored Procedures
Try http://techdocs.postgresql.org or techdoc.postgresql.org B i g D o g - Original Message - From: "David Busby" <[EMAIL PROTECTED]> To: "php-general" <[EMAIL PROTECTED]> Sent: Friday, July 05, 2002 1:30 PM Subject: [PHP] Stored Procedures > List, > I'm using a postgres datbase for my PHP project, how do I make stored > procedures? Or if no SPs then what would be recomendation for building > simple/reuseable "Put" and "Get" procedures for my data? > > /B > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Stored Procedures
I have no idea of how to create postgres stored procedures, but a search on Google brought up a lot of information that you might find helpful: http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=postgre+stored+proced ure You can also visit their web site at http://www.postgresql.org -Original Message- I'm using a postgres datbase for my PHP project, how do I make stored procedures? Or if no SPs then what would be recomendation for building simple/reuseable "Put" and "Get" procedures for my data? This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete the message. Thank you very much. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php