[Dbix-class] [newbie]How to call stored procedure?(doc already read)

Tony Winslow tonywinslow1986 at gmail.com
Sun Dec 30 02:24:10 GMT 2007


Peter Flanigan wrote:
> Tony Winslow wrote:
>   
>> Danny Warren wrote:
>>     
>>> It would be helpful if you could post a code sample.  I am sure
>>> someone could spot it quickly that way (more eyes, etc etc).
>>>
>>> Check to make sure the first argument to your search call is truly
>>> undef, and make sure you are passing your array of bind values as a
>>> reference.
>>>
>>> This is the error I get when I fat-finger in a search call, and
>>> checking for undefs and refs at the offending point is the first
>>> thing I try.
>>>
>>>       
>> Here is my codes:
>>
>> # Document.pm -- Controller
>> ......
>> sub test : Local {
>>    my ($self, $c) = @_;
>>    my @cnt;
>> #  my $cnt;
>>    $c->model('MyDB::RevComp')->search(
>>        undef,
>>        bind => \@cnt
>> #      bind => \$cnt
>>    );
>>    .......
>> }
>>     
>
> And as Danny pointed out, you are missing the {} around bind => \@cnt
>
> Regards
>
>
> _______________________________________________
> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
> Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.rawmode.org
>
>   
I re-wrote my codes as:
my $dbh = $c->model('MyDB')->schema->storage->dbh;
my $cnt;
my $sth = $dbh->prepare("CALL countRevs(?)");
$sth->bind_param_inout(1, \$cnt, 4);
$sth->execute;

Then I got the following error message:

|DBI Exception: DBD::mysql::st bind_param_inout failed: Output parameters not implemented

Does that mean it is entirely impossible to call procedures having parameters as output in MySQL?
|





More information about the DBIx-Class mailing list