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

Reply via email to