Re: UPDATE problem - FROM Clause not supported in Oracle
- From: "David Portas" <REMOVE_BEFORE_REPLYING_dportas@xxxxxxx>
- Date: Wed, 27 Jul 2005 23:18:05 +0100
"dsriva" <dsrivast@xxxxxxxxx> wrote in message
news:1122389612.926329.57260@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Hi,
> I want to have a single statement to work on both sql server and
> oracle, 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,
>
> Thanks for any help
> dsriva
>
If you need to work across platforms then avoid propritary features. The
standard SQL update statement doesn't have a FROM clause or aliases for the
target table. The following tested on SQL2000.
UPDATE field_char
SET maxlength = 254
WHERE fieldid IN ('2', '4', '5', '101', '105', '117', '118')
AND EXISTS
(SELECT *
FROM arschema AS S
WHERE S.schemaid = field_char.schemaid
AND S.schematype = 1) ;
--
David Portas
SQL Server MVP
--
.
- Follow-Ups:
- Re: UPDATE problem - FROM Clause not supported in Oracle
- From: Sybrand Bakker
- Re: UPDATE problem - FROM Clause not supported in Oracle
- References:
- UPDATE problem - FROM Clause not supported in Oracle
- From: dsriva
- UPDATE problem - FROM Clause not supported in Oracle
- Prev by Date: Re: Question: RMAN 8i syntax clarification
- Next by Date: Re: UPDATE problem - FROM Clause not supported in Oracle
- Previous by thread: Re: UPDATE problem - FROM Clause not supported in Oracle
- Next by thread: Re: UPDATE problem - FROM Clause not supported in Oracle
- Index(es):
Relevant Pages
|