oracle sequence & autoincrement

Discussion of general topics related to the new version and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Forum rules
Discussion of general topics related to the new release and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Post Reply
R. U. Serious
Registered User
Posts: 32
Joined: Mon Feb 11, 2002 2:07 pm
Contact:

oracle sequence & autoincrement

Post by R. U. Serious »

Hi there,

I am not sure wether this is the right place to ask, sorry if it isn't. Although you were planning to have Oracle-Support in 2.0.x you didn't implement it finally. however I remember theFinn (?) saying that the db-class worked and that it is planned to have Oracle-Support in phpBB2. :)

I was wondering about how you were/are thinking on implementing the substitute for the auto-increment. I saw the sequences you definded in the oracle-schema and how you select the curval in the sql_nextid function in the db-class. However I was wondering how you were going to implement the INSERTS. Are you making an extra select before the insert (which would mean if-branched code depending on the dbms in the forumcode) or using triggers or is there another way? Maybe marking the "autoincrement-fields" and moving the extra-select in the sql_statement function?

Thanks for you info. :)
Das Kölsch zum Handy.

User avatar
dhn
Registered User
Posts: 1518
Joined: Wed Jul 04, 2001 8:10 am
Location: Around the corner
Contact:

Re: oracle sequence & autoincrement

Post by dhn »

Image

User avatar
theFinn
Registered User
Posts: 90
Joined: Tue Jul 03, 2001 7:58 pm
Location: Edmonton, AB
Contact:

Re: oracle sequence & autoincrement

Post by theFinn »

Auto Increment can be achived in oracle by using sequences and triggers. Basicly you just set a 'BEFORE INSERT OR UPDATE" trigger that will fill in that sequence value when you do an insert or update where needed.
James 'theFinn' Atkinson
Founder & ex-Contributor
'On a long enough timeline the survival rate for everyone drops to zero...' - Jack, Fight Club
http://www.thefinn.net

R. U. Serious
Registered User
Posts: 32
Joined: Mon Feb 11, 2002 2:07 pm
Contact:

Re: oracle sequence & autoincrement

Post by R. U. Serious »

Thank you for your replies. dhn those were the threads I had read, thanks for digging them up. :)
theFinn, I see. I had not seen any triggers in the old schema and additionally someone told me that triggers were not a good way to do it (can't remember his 'cons' though). Hence why I thought you were going to do it in a different way.

Again, thanks for clearing it up.
Das Kölsch zum Handy.

Post Reply