[Dbix-class] trouble with oracle sequence

Rom Bre rbreslav2 at gmail.com
Fri May 25 15:57:44 GMT 2007


On 5/24/07, Matt S Trout <dbix-class at trout.me.uk> wrote:
>
> 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 =3D> $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/
>

Can you point me in the direction of PK::Sequence?  I'm unable to find
anything in CPAN or when googling.  Unless what you mean is that I should
create my own custom dbic component.

Thanks a lot.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20070525/a7b=
f1949/attachment.htm


More information about the Dbix-class mailing list