in reply to Moving SQL from perl to Stored Procedures
to get SQL out of your perl code, then I whould suggest that you should use code likemy $sql = "EXEC dynamic_example @firstname = ?"; $dbh->execute('chris%')
where $dbp holds an object that can either use ad-hoc SQL or stored procedures. The advantages to this approach are that interface to the database is a single object and all the procedures or sql that is accessing the database are well known. The main disadvantage is that if the database needs to accesed in a new way the $dpb object must be extended. And if Stored procedures are used, then the database has to be extended as well.$dbp->execute('dynamic_example', firstname => 'chris');
|
|---|