On Thu, May 24, 2007 at 02:50:47PM -0400, Rom Bre wrote:
> I'm getting the following error after attempting to insert into a table
> where i have setup an oracle sequence:
> 
> DBIx::Class::ResultSet::create(): Can't get last insert id
> 
> 
> This is happening because dbic is attempting to do a SELECT
> STORE_CART_SEQ.CURRVAL FROM DUAL, without a preceding NEXTVAL.
> 
> 
> Here's the create statement:
> 
> $c->model('StoreDB::Cart')->create({ session_id => $session_id });
> 
> 
> I'm under the assumption that the NEXTVAL will be handled
> automatically and that I don't need to specify anything in the create

PK::Auto expects you have a trigger that does the NEXTVAL and populates the
id during INSERT (ala e.g. postgres' SERIAL data type)

I think you might be looking for PK::Sequence

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director    Want a managed development or deployment platform?
 Shadowcat Systems Ltd.  Contact mst (at) shadowcatsystems.co.uk for a quote
http://chainsawblues.vox.com/             http://www.shadowcatsystems.co.uk/ 

_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/

Reply via email to