cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject Re: General DB question
Date Wed, 14 Mar 2001 14:10:37 GMT
JP Moresmau wrote:
> 
> CREATE TABLE mytable (id int identity seed 0 increment 1, title varchar(500));
> 
> INSERT INTO myTable (title) values('new thing');
> 
> Which would insert 0 in the id field and 'new thing' in the title.

I already have code that supports that.  I have three modes for keys, that affect
query generation: automatic, manual, and form.  They only affect the INSERT command.
Basically, the automatic mode hides the key from the INSERT command, and lets the
DB handle it.  The manual mode uses a transaction to find the maximum value for the
key and increments it, and inserts the new value in the INSERT command.  The form
mode takes the value from a form field (used in combination keys) when it creates
the INSERT command.

Since the SEQUENCE code is Oracle specific, and is Oracle's way of doing the
'automatic' mode, I can either create a new Oracle specific mode or I can alter
the code that implements automatic mode (which is probably what I will do).

> Whatever you're trying to achive, wouldn't it be easier to write generic
> code that deals with stored procedures, and have a script for each type of
> DB that creates the store procedures and relevant objects, at leats in DBs
> that support them? Or is that a stupid remark in your context?

Yes and no.  Stored procedures are very vendor specific, and I am trying to
write a generic DB infrastructure that will automatically be portable accross
different configurations.  I am leveraging experience I have with a proprietary
product (not code), and have an already very flexible system.  I am just hiding
complexity from the end developer.

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message