Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: UPDATE SET query Oracle 9i
hdekker_at_sparxsystems.com.au (Henk Dekker) wrote in message news:<1900676b.0309012236.2970d95d_at_posting.google.com>...
> Help required re: Oracle 9i update query...
>
> SQL> UPDATE t_connector SET StyleEx =
> 2 (SELECT 'FKS=' || ps.Name || ':;FKT=' || pt.Name || ':;'
> 3 FROM t_operation os, t_operation ot, t_operationparams ps, t_operationparams pt
> 4 WHERE os.OperationID = ps.OperationID
> 5 AND c.Start_Object_ID = os.Object_ID
> 6 AND os.Stereotype = 'FK'
> 7 AND ot.OperationID = pt.OperationID
> 8 AND c.End_Object_ID = ot.Object_ID
> 9 AND ot.Stereotype = 'PK')
> 10 AND t_connector.Connector_ID = c.Connector_ID;
> AND t_connector.Connector_ID = c.Connector_ID
> *
> ERROR at line 10:
> ORA-00933: SQL command not properly ended
>
>
> Thanks
> Henk
Solved my problem. The original subquery was returning more than 1 row. The query that works is...
UPDATE t_connector SET (StyleEx) =
(SELECT 'FKS=' || ps.Name || ':;FKT=' || pt.Name || ':;'
FROM t_connector c, t_operation os, t_operation ot, t_operationparams
ps, t_operationparams pt
WHERE os.OperationID = ps.OperationID
AND c.Start_Object_ID = os.Object_ID
AND os.Name = c.SourceRole AND os.Stereotype = 'FK' AND ot.OperationID = pt.OperationID
(note added conditions SourceRole and DestRole)
Thaks again :-)
Henk Received on Thu Sep 04 2003 - 21:27:44 CDT