cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "JP Moresmau" ...@dol.ie>
Subject Re: General DB question
Date Tue, 13 Mar 2001 21:11:09 GMT
Hi Berin, I am not familiar at all with Cocoon 2 or what you're trying to
achieve, but it sound interesting, so I suppose I should get in gear and
install Cocoon 2 and look at it... But anyway, back to your question, this
Sequence code you're using is totally Oracle specific. If you look at MS
SQL Server or IBM DB2, to give Oracle's main competitors, they use a
totally different system of having identity columns with automatic
numbering. In this case, the insert statement has to leave out the identity
column, so it will be like

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.

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?

JP

At 15:38 13/03/2001 -0500, you wrote:
>I want to add one more mode to the keys, so that we can
>automatically specify a Sequence object.  In Oracle, the
>syntax works like this:
>
>INSERT INTO myTable VALUES (
>    MySequence.NEXTVAL,
>    "new thing"
>);
>
>Or if you have multiple tables that work together, it
>would be like this:
>
>INSERT INTO myTable VALUES (
>    MySequence.NEXTVAL,
>    "new thing"
>);
>
>INSERT INTO myOtherTable VALUES (
>    MySequence.CURRVAL,
>    "associated thing"
>);
>
>My question is, "Is this Oracle specific, or generic
>enough to fit in the DatabaseAddAction object?".
>
>Right now, I am working with views and triggers to
>do this--but if I can bypass that I will.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
>For additional commands, email: cocoon-dev-help@xml.apache.org
> 

JP Moresmau
http://frenchstud.io

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


Mime
View raw message