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: Veera Prasad <vprasad_at_olf.com>
Date: Thu, 22 Jun 2000 10:30:15 -0400
Message-Id: <10536.110155@fatcity.com>

--------------A2E1656BEBEF66B05D152452
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Try this way ..
VPRASAD: PRECY>select * from test_Table;

       NO DT                   COL1
--------- -------------------- --------------------------------
        1 22-jun-2000 10:28:35 Veera

VPRASAD: PRECY>update test_table set col1 = col1||'/dba' where no = 1;

1 row updated.

VPRASAD: PRECY>select * from test_table;

       NO DT                   COL1
--------- -------------------- --------------------------------
        1 22-jun-2000 10:28:35 Veera/dba

Regards
Veera

Andrey Bronfin wrote:

> Hi , DBAs !I've got a SQL question :There is a table called COMPANY
> : NAME    ID    MANAGER_ID
> PATH---------------------------------------------------------AAA
> 5            2                /home/AAABBB        10
> 5                NULL I want to perform something like :update COMPANY
> bset  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 .
> Andrey Bronfin
> VisualTop.com

--------------A2E1656BEBEF66B05D152452

Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<body bgcolor="#FFFFFF">

Try this way ..
<br>VPRASAD: PRECY>select * from test_Table;
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NO DT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
COL1
<br>--------- -------------------- --------------------------------
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1 22-jun-2000 10:28:35 Veera
<p>VPRASAD: PRECY>update test_table set col1 = col1||'/dba' where no =
1;
<p>1 row updated.
<p>VPRASAD: PRECY>select * from test_table;
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NO DT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
COL1
<br>--------- -------------------- --------------------------------
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1 22-jun-2000 10:28:35 Veera/dba
<p>Regards
<br>Veera
<p>Andrey Bronfin wrote:
<blockquote TYPE=CITE><style></style>
<font face="Arial"><font size=-1>Hi

, DBAs !</font></font><font face="Arial"><font size=-1>I've got a SQL question :</font></font><font face="Arial"><font size=-1>There is a table called COMPANY :</font></font>&nbsp;<font face="Arial"><font size=-1>NAME&nbsp;&nbsp;&nbsp;

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

Original text of this message

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