my ($self, $dbh, $source, $col) = @_;
# sorry, there's no other way!
- my $sth = $dbh->prepare_cached("select max($col) from ".$source->from);
- return ($dbh->selectrow_array($sth))[0];
+ my $sth = $self->sth("select max($col) from ".$source->from);
+ my ($id) = $dbh->selectrow_array($sth);
+ $sth->finish;
+
+ return $id;
}
1;
See L</connect_call_blob_setup> for a L<DBIx::Class::Storage::DBI/connect_info>
setting you need to work with C<IMAGE> columns.
-Due to limitations in L<DBD::Sybase> and this driver, it is only possible to
-select one C<TEXT> or C<IMAGE> column at a time. This is handled automatically
-for tables with only one such column, if you have more than one, supply a
-C<< select => [qw/col list .../] >> key to your C<< ->search >> calls, with the
-single desired C<TEXT/IMAGE> column at the end of the list.
-
=head1 AUTHORS
See L<DBIx::Class/CONTRIBUTORS>.
=head1 DESCRIPTION
If you're using this driver than your version of Sybase does not support
-placeholders. You can check with:
+placeholders, or your version of L<DBD::Sybase> is too old (you need at least
+C<1.09>. You can check with:
$dbh->{syb_dynamic_supported}
$last_id = $created->id if $created;
my $got = eval {
- $rs->search({ id => $last_id }, { select => [$type] })->single->$type
+ $rs->find($last_id)->$type
};
diag $@ if $@;
ok($got eq $binstr{$size}, "verified inserted $size $type");
ok !$@, 'updated blob successfully';
diag $@ if $@;
ok(eval {
- $rs->search({ id => $last_id }, { select => ['blob'] })->single->blob
+ $rs->find($last_id)->blob
} eq $new_str, "verified updated blob" );
diag $@ if $@;
}
diag $@ if $@;
my $got = eval {
- $rs->search({ id => 1 }, { select => ['blob'] })->single->blob
+ $rs->find(1)->blob
};
diag $@ if $@;
ok($got eq $binstr{large}, "verified inserted large blob");