2007/2/26, Martin Schapendonk <[EMAIL PROTECTED]>:
> 2007/2/26, Gonçalo Marrafa <[EMAIL PROTECTED]>:
> > Hi have two tables in my database that get their id's from the same
> > sequence. The problem is that when i try to insert records in either of
> > them cake tries to get the record's id by selecting the nextval for
> > tablename_id_seq, which isn't correct.
>
> You don't mention it, but I assume you use Oracle based on the fact
> you mention sequences. You also don't mention the Cake version and the
> database driver you use.
>
> The dbo_oracle.php in Cake 1.2 seems OK. Did you try to use that one?

Sorry, that was only half an answer if I reread your mail.

The dbo_oracle.php in Cake 1.2 seems to retrieve sequence.currval, and
not sequence.nextval. If any Cake code retrieves sequence.nextval to
determine the lastInsertId, I guess it would be an error and you
should report it in Trac (trac.cakephp.org).

To make ID generation transparant for Cake, you could easily create
two synonyms "table1_id_seq" and "table2_id_seq" for the underlying
sequence. This way, both tables can have IDs generated by one
sequence.

Martin

-- 
  Martin Schapendonk, [EMAIL PROTECTED]

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to