#1645: Oracle sequence not being used
-----------------------------------+----------------------------------------
 Reporter:  tchakkapark            |       Owner:  romanb 
     Type:  defect                 |      Status:  new    
 Priority:  blocker                |   Milestone:  1.0.4  
Component:  Record                 |     Version:  1.1-DEV
 Keywords:  oracle sequence        |    Has_test:  0      
 Mystatus:  Pending Core Response  |   Has_patch:  0      
-----------------------------------+----------------------------------------
 Using Symfony 1.1, sfDoctrinePlugin with 1.1 libraries from latest SVN (I
 update it every day).

 I have the following definition in my schema:


 {{{
 EVENT_ATTENDEES:
   tableName: EVENT_ATTENDEES
   columns:
     group_id:
       notnull: true
       type: integer(12)
     event_attendee_id:
       notnull: true
       type: integer(12)
       primary: true
       sequence: event_attendee_id
 }}}

 In my database, I have a sequence defined called event_attendee_id, and
 it's currently at 98682. However, when I create an object and save it:

 {{{
       $register                = new EVENT_ATTENDEES();
       $register->group_id      = $contact["group_id"];
       $register->save();
 }}}

 It actually sets the $register->event_attendee_id to 1, 2, 3, etc in
 normal sequence. I'm unsure where it's getting the values from, but it
 needs to use the event_attendee_id sequence.

 In oracle, to get this sequence, you do a:

 {{{

 SQL> select event_attendee_id.nextval FROM dual;

    NEXTVAL
 ----------
      98682
 }}}

 NEXTVAL contains the next sequence number. To create sequences in Oracle,
 one would do the following


 {{{
 CREATE SEQUENCE EVENT_ATTENDEE_ID  MINVALUE 1 MAXVALUE
 999999999999999999999999999 INCREMENT BY 1
 }}}

-- 
Ticket URL: <http://trac.doctrine-project.org/ticket/1645>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"doctrine-svn" group.
 To post to this group, send email to [email protected]
 To unsubscribe from this group, send email to [EMAIL PROTECTED]
 For more options, visit this group at 
http://groups.google.co.uk/group/doctrine-svn?hl=en-GB
-~----------~----~----~----~------~----~------~--~---

Reply via email to