Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL question (using result of nested statement in arithmetic operation)

Re: SQL question (using result of nested statement in arithmetic operation)

From: Galen Boyer <galenboyer_at_hotpop.com>
Date: 26 Apr 2003 21:39:15 -0500
Message-ID: <ullxwmqth.fsf@hotpop.com>


On Fri, 25 Apr 2003, stephan.grimm_at_igd.fhg.de wrote:

> BTW: I need a solution that works with Oracle as well as MySQL using
> the same syntax!

You do not create one piece of code to port to all DBMS's, instead, you create a proc, maybe, get_new_id that returns the id.

In Oracle, this executes sequence.nextval. In MySQL, it does whatever that one does. Your code calls the same stored proc, but the stored proc does very database specific code.

-- 
Galen deForest Boyer
Sweet dreams and flying machines in pieces on the ground.
Received on Sat Apr 26 2003 - 21:39:15 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US