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

Home -> Community -> Usenet -> c.d.o.server -> Re: UPDATE problem - FROM Clause not supported in Oracle

Re: UPDATE problem - FROM Clause not supported in Oracle

From: <fitzjarrell_at_cox.net>
Date: 26 Jul 2005 08:26:11 -0700
Message-ID: <1122391571.043275.207420@g47g2000cwa.googlegroups.com>

Comments embedded.
dsriva wrote:
> Hi,
> I want to have a single statement to work on both sql server and
> oracle,

You can't always get what you want.

> but am not able to convert the following to do so.
> I am trying to update a column
>
> UPDATE field_char f SET maxLength = 254
>
> FROM field_char fc, arschema s
>
> WHERE f.fieldid IN('2', '4', '5', '101', '105', '117', '118')
>
> AND (s.schemaId = fc.schemaId)
>
> AND (s.schemaType = 1)
>
>
>
> But it seems that the FROM clause is not supported in Oracle,
>

Possibly because it's a different DBMS engine? SQL Server implements UPDATE one way, Oracle another. Get used to such things, as SQL isn't SQL just because it's SQL. Each vendor decides what and how to implement functionality from the SQL standard and no two vendors decide on exactly the same features or the same methodology:

SQL Server:

select top 10 userId from user_access where accessLevel = 20

Oracle:

select a.userid from (select rownum r, userid from user_access where accesslevel = 20) where r < 11;

Stop trying to make SQL Server into Oracle and Oracle into SQL Server. All you'll end up with in return is a migraine, an ulcer and code that isn't optimised for any DBMS.

> Thanks for any help
> dsriva

David Fitzjarrell Received on Tue Jul 26 2005 - 10:26:11 CDT

Original text of this message

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