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: performance question

Re: performance question

From: DA Morgan <damorgan_at_x.washington.edu>
Date: Wed, 09 Feb 2005 16:18:35 -0800
Message-ID: <1107994547.272555@yasure>


Jan van Veldhuizen wrote:

> "Sybrand Bakker" <sybrandb_at_hccnet.nl> wrote in message
> news:j19i01p9b64usksdvd6ebb3f90j8jtpk5e_at_4ax.com...
> 

>>On Tue, 8 Feb 2005 21:02:19 +0100, "Jan van Veldhuizen"
>><jan_at_van-veldhuizen.nl> wrote:
>>
>>
>>>What will be better?
>>>
>>>UPDATE table1
>>>SET table1.some_col =
>>> (SELECT some_col FROM table2
>>> WHERE table2.col_id = table1.col_id)
>>>WHERE EXISTS
>>> (SELECT null FROM table2
>>> WHERE table2.col_id = table1.col_id)
>>>
>>>or:
>>>
>>>CREATE VIEW my_view AS SELECT table1.some_col c1, table2.some_col c2
>>> WHERE table1.col_id = table2.col_id
>>>
>>>UPDATE my_view SET c1 = c2
>>>
>>>
>>
>>The view will be not updatable.
>>
>>IIRC you'll need to
>>update
>>(select table1.some_col c1, table2.some_col c2
>> from table1, table2
>>where table1.col_id = table2.col_id)
>>set c1=c2
>>
> 
> I did not know about this syntax. A nice possibility!
> Unfortunately it's not SqlServer-compatible...:-(
> I have an application with embedded SQL in stead of using stored procedures
> (don't ask me why... I have to live with it for the moment)
> The app must be available for Oracle and SqlServer.
> I am trying to avoid having different versions of sql statements, but I'm
> afraid that will result in a performance loss....

What works best in Oracle will never work best in SQL Server and visa versa. Trying to be "vendor neutral" whatever that means basically means eating Thai food without spices, French food without cream sauces, and being known as mediocre or worse. Reconsider your design decisions.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace 'x' with 'u' to respond)
Received on Wed Feb 09 2005 - 18:18:35 CST

Original text of this message

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