On Mon, Mar 04, 2002 at 09:09:05AM -0500, Aaron J Mackey wrote:
>
> regarding some people's desires to use database-bound stored procedures:
> go right ahead, I'm not stopping you:
>
> VOID delete_user($id) {
> execute delete_user($id);
> }
>
> But since procedural SQL is handled so differently by each database
> vendor, I don't think I want to try to handle CREATE FUNCTION syntax
> parsing myself (does DBI have a hook into these? I didn't think so ...)
Not relevant here. Stored procedures are 'just part of the schema' likes tables etc.
What I'm interested in is
For the database portability issues I'm interested in how we can tie into
the new DbTypeSubclass mechanism (that's in DBI 1.21 just not documented yet):
http://archive.develooper.com/dbi-users%40perl.org/msg08347.html
Perhaps something like:
VOID delete_user($id) for Sybase {
execute delete_user($id);
}
VOID delete_user($id) for Oracle {
BEGIN delete_user($id); END;
}
Which ends up putting one delete_user() into the ...::Sybase::db class
and the other into the ...::Oracle::db class.
[On the other hand, for stored procedure calls that are that simple
there ought to be an even simpler way. Something along the lines of
http://search.cpan.org/doc/TIMB/OCI_Talk1_200106/sld033.htm
In other words, make calling a stored procedure as simple as a perl
method call. But that's another story.]
Tim.