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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: SQL question

RE: SQL question

From: Weerd de E.C. Kirsten <Kirsten.deWeerd_at_Oranjewoud.nl>
Date: Thu, 22 Jun 2000 16:11:56 +0100
Message-Id: <10536.110151@fatcity.com>


update COMPANY b
set b.PATH = (select a.PATH||'/BBB' from COMPANY a where b.MANAGER_ID = a.ID) where b.NAME='BBB' ;

I'd the concat with '/BBB' in the subselect.

Haven't tried it out though ...

Good luck.

Greets,
Kirsten

> -----Original Message-----
> From: Andrey Bronfin [SMTP:bronfin_at_VisualTop.com]
> Sent: Thursday, June 22, 2000 3:57 PM
> To: Multiple recipients of list ORACLE-L
> Subject: SQL question
>
> Hi , DBAs !
> I've got a SQL question :
> There is a table called COMPANY :
>
> NAME ID MANAGER_ID PATH
> ---------------------------------------------------------
> AAA 5 2 /home/AAA
> BBB 10 5 NULL
>
> I want to perform something like :
> update COMPANY b
> set PATH = (select PATH from COMPANY a where b.MANAGER_ID = a.ID)||'/BBB'
> where NAME='BBB' ;
>
> It should update the PATH column for BBB to be ' /home/AAA/BBB'
>
> The query does not work this way . I recieve the error message :
> ERROR at line 1:
> ORA-00933: SQL command not properly ended
>
> Is there a way to do it ?
>
> Thanks !
>
> For statistics : i'm from Tel-Aviv , Israel .
Received on Thu Jun 22 2000 - 10:11:56 CDT

Original text of this message

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