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

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

SQL question

From: Andrey Bronfin <bronfin_at_VisualTop.com>
Date: Thu, 22 Jun 2000 16:48:26 +0200
Message-Id: <10536.110140@fatcity.com>


This is a multi-part message in MIME format.

------=_NextPart_000_06F4_01BFDC69.AF743A90 Content-Type: text/plain;

        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

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 =20
set PATH =3D (select PATH from COMPANY a where b.MANAGER_ID =3D = a.ID)||'/BBB' where NAME=3D'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 .

Andrey Bronfin
VisualTop.com

------=_NextPart_000_06F4_01BFDC69.AF743A90 Content-Type: text/html;

        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2920.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi , DBAs !</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I've got a SQL question :</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>There is a table called&nbsp;COMPANY =
:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>NAME&nbsp;&nbsp;&nbsp; =
ID&nbsp;&nbsp;&nbsp;=20
MANAGER_ID&nbsp;&nbsp;&nbsp; PATH</FONT></DIV>
<DIV><FONT face=3DArial=20

size=3D2>---------------------------------------------------------</FONT>=

</DIV>
<DIV><FONT face=3DArial =

size=3D2>AAA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20 5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20 2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= &nbsp;&nbsp;&nbsp;=20
/home/AAA</FONT></DIV>
<DIV><FONT face=3DArial =

size=3D2>BBB&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20 10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20 5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= &nbsp;&nbsp;&nbsp;=20
NULL</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I want to perform something like =
:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>update COMPANY&nbsp;b&nbsp; =
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>set&nbsp; PATH =3D (select PATH from =
COMPANY&nbsp;a=20
where b.MANAGER_ID =3D a.ID)||'/BBB' where NAME=3D'BBB' ;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>It should update the PATH column =
for&nbsp;BBB to be=20
'</FONT>&nbsp;<FONT face=3DArial size=3D2>/home/AAA/BBB'</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>The query does not work this way . I =
recieve the=20
error message :</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>ERROR at line 1:<BR>ORA-00933: SQL =
command not=20
properly ended</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Is there a way to do it ?</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks !</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>For statistics : i'm from Tel-Aviv , =
Israel=20
.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2><BR>Andrey=20
Bronfin<BR>VisualTop.com<BR></DIV></FONT>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><BR></FONT>&nbsp;</DIV></BODY></HTML>
Received on Thu Jun 22 2000 - 09:48:26 CDT

Original text of this message

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