| 1 | # $Id: StoredProcedures.pm,v 1.1.1.1 2005/11/20 18:01:06 dk Exp $ | ||
| 2 | |||
| 3 | package DBIx::Roles::StoredProcedures; | ||
| 4 | |||
| 5 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 1 | ▶ | use vars qw($VERSION); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 1 | $VERSION = '1.00'; | |
| 9 | |||
| 10 | sub initialize | ||
| 11 | 3 | ▶ | { |
|
Subroutine
initialize: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 12 | 3 | return undef, undef, qw(call_function); | |
| 13 | } | ||
| 14 | |||
| 15 | sub call_function | ||
| 16 | 2 | ▶ | { |
|
Subroutine
call_function: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 17 | 2 | my ( $self, $storage, $function, @params) = @_; | |
| 18 | |||
| 19 | return $self-> selectrow_array( | ||
| 20 | "SELECT $function (". | ||
| 21 | 2 | join(',', map { '?' } @params) . | |
| 22 | ")", | ||
| 23 | {}, | ||
| 24 | @params | ||
| 25 | ); | ||
| 26 | } | ||
| 27 | |||
| 28 | # XXX any() is greedy here, but checking whether there is a corresponding stored procedure | ||
| 29 | # takes intimate knowledge about the particular DBD driver, so we leave that for now | ||
| 30 | sub any | ||
| 31 | 2 | ▶ | { |
|
Subroutine
any: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 32 | 2 | my ( $self, $storage, $method, @params) = @_; | |
| 33 | |||
| 34 | 2 | return call_function( $self, $storage, $method, @params); | |
| 35 | } | ||
| 36 | |||
| 37 | 1 | 1; | |
| 38 | |||
| 39 | __DATA__ | ||