Re: Stored Procedures, Dynamic SQL or static SQL and testing.
| From: | Bastien | Date: | Sat, 26 Mar 2011 14:08:04 +0000 |
| Subject: | Re: Stored Procedures, Dynamic SQL or static SQL and testing. | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-47736@lists.php.net to get a copy of this message | ||
On 2011-03-26, at 9:00 AM, Richard Quadling <rquadling@gmail.com> wrote:
> Hi.
>
> What preferences do you all have when using SQL. Stored Procedures or
> PHP generated dynamic SQL or parameterized static SQL.
I used both. SPs work for some of the larger reports, especially when combined with a view or two.
For mist of the form interactions I tend to use regular SQL with prepared statements for simplicity
and security
>
> Whichever you use how do you test them? Do you use unit testing in
> your PHP code? If so, do you also have unit code testing for the SQL
> statements (I suppose this mainly relates to SPs).
Yes. I generally write and test the SQL before turning it into a SP
>
> Does using a different RDBMS make a difference to the SQL coding style
> you'd use?
Generic SQL where possible. But occasionally I will use specific SQL for the RDBMS where
appropriate. My current code base is not as layered as I would like to really make it a simple
config switch to change the backend
>
> This isn't for any sort of thesis, just trying to see what the general
> consensus is of those that reply.
>
> Thanks for answering.
>
> Richard Quadling.
>
> --
> Richard Quadling
> Twitter : EE : Zend
> @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
Bastien Koert
Sent from my iPhone