1 package DBIx::Class::Storage::DBI::Sybase::NoBindVars;
4 DBIx::Class::Storage::DBI::NoBindVars
5 DBIx::Class::Storage::DBI::Sybase
8 sub _dbh_last_insert_id {
9 my ($self, $dbh, $source, $col) = @_;
11 # @@identity works only if not using placeholders
12 # Should this query be cached?
13 return ($dbh->selectrow_array('select @@identity'))[0];
20 DBIx::Class::Storage::DBI::Sybase::NoBindVars - Storage::DBI subclass for Sybase
21 without placeholder support
25 If you're using this driver than your version of Sybase does not support
26 placeholders. You can check with:
28 $dbh->{syb_dynamic_supported}
30 You can also enable this driver explicitly using:
32 my $schema = SchemaClass->clone;
33 $schema->storage_type('::DBI::Sybase::NoBindVars');
34 $schema->connect($dsn, $user, $pass, \%opts);
36 See the discussion in L<< DBD::Sybase/Using ? Placeholders & bind parameters to
37 $sth->execute >> for details on the pros and cons of using placeholders.
39 One advantage of not using placeholders is that C<select @@identity> will work
40 for obtainging the last insert id of an C<IDENTITY> column, instead of having to
41 do C<select max(col)> as the base Sybase driver does.
43 When using this driver, bind variables will be interpolated (properly quoted of
44 course) into the SQL query itself, without using placeholders.
46 The caching of prepared statements is also explicitly disabled, as the
47 interpolation renders it useless.
51 See L<DBIx::Class/CONTRIBUTORS>.
55 You may distribute this code under the same terms as Perl itself.