NAME
SPOPS::DBI::Sybase -- Sybase-specific routines for the SPOPS::DBI
SYNOPSIS
# In your configuration:
'myspops' => {
'isa' => [ qw/ SPOPS::DBI::Sybase SPOPS::DBI / ],
# If you have an IDENTITY field, set increment_field to true...
'increment_field' => 1,
# ...and the IDENTITY field in 'no_insert' and 'no_update'
'no_insert' => [ 'id' ],
'no_update' => [ 'id' ],
...
},
DESCRIPTION
This just implements some Sybase-specific routines so we can abstract them out.
One of them optionally returns the IDENTITY value returned by the last insert. Of course, this only works if you have an IDENTITY field in your table:
CREATE TABLE my_table (
id numeric( 8, 0 ) IDENTITY not null,
...
)
NOTE: You also need to let this module know if you are using this IDENTITY option by setting in your class configuration the key 'increment_field' to a true value.
METHODS
sql_quote
DBD::Sybase depends on the type of a field if you are quoting values to put into a statement, so we override the default 'sql_quote' from SPOPS::SQLInterface
to ensure the type of the field is used in the DBI->quote call.
BUGS
Working with FreeTDS
SPOPS works with FreeTDS/MS SQL Server (presumably with FreeTDS/Sybase as well, but it has not been tested). However, there is one hitch: the combination of DBD::Sybase and FreeTDS does not seem to work properly with the standard DBI field type discovery. As a result, you need to specify your datatypes in your SPOPS configuration using the dbi_type_info
key:
my %config = (
doodad => {
class => 'My::Doodad',
isa => [ 'SPOPS::DBI::Sybase', 'SPOPS::DBI' ],
...,
dbi_type_info => { doodad_id => 'int',
name => 'char',
action => 'char' },
},
);
See the discussion of "fake types" in SPOPS::DBI::TypeInfo for more information.
TO DO
Nothing known.
SEE ALSO
FreeTDS: http://www.freetds.org/
COPYRIGHT
Copyright (c) 2001-2004 intes.net, inc.. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
AUTHORS
Chris Winters <chris@cwinters.com>
See the SPOPS module for the full author list.