Problem with Class::DBI::Sybase - inserting identities.

[prev] [thread] [next] [Date index for 2005/02/10]

From: "g
Subject: Problem with Class::DBI::Sybase - inserting identities.
Date: 12:10 on 10 Feb 2005
Hi all,

	I'm having some problems with Class::DBI::Sybase... It used to work
perfectly when last I used it, at 0.1, it's at 0.3 and a new feature has
been added for it:
---
* Works with IDENTITY columns to auto-generate primary keys.
---

	The problem is, I don't want it to auto generate my id's for me. I
want it to just insert the columns I tell it to insert and let me worry
about finding out the id's.

	This is my error message:

Can't insert new My::Module::DB::Region: DBD::Sybase::st execute failed:
Server message number=584 severity=16 state=1 line=1
server=IS_ASEprocedure=DBD2text=Explicit value specified for identity field
in table 'region' when 'SET IDENTITY_INSERT' is OFF.
 [for Statement "INSERT INTO region (name, id)
VALUES (?, ?)
"] at /usr/lib/perl5/site_perl/5.8.0/DBIx/ContextualFetch.pm line 51.
 at /usr/lib/perl5/site_perl/5.8.0/My::Module/Importer.pm line 171

	The error message being returned from the Sybase db is when an ID is
attempting to be inserted by a user and not the database. It is possible to
temporarily allow this behaviour by running the abovementioned SET
IDENTITY_INSERT, with an argument or two. This is a dangerous option to use,
and according to the sybase quick reference book, this should only be used
in mainenance situations.

	Is there a way a way to switch off this behaviour in
Class::DBI::Sybase? I've poked around, but, cant find anything.

	I also tried to contact the author Dan Sully, but it looks like his
cpan mail account no longer works :(

Thanks in advance.

Regards,
--

Gabriel Fortuna
Internet Solutions

Regards,
--

Gabriel Fortuna
Internet Solutions

Regards,
--

Gabriel Fortuna
Internet Solutions

Problem with Class::DBI::Sybase - inserting identities.
"g 12:10 on 10 Feb 2005

Generated at 12:48 on 22 Feb 2005 by mariachi v0.52