I start to work with SQL and I faced up with hierarchical queries. meanwhile I success to select the rows with connect by prior
command but failed to update. Here is my update query:
update HTABLE set status = 'INACTIVE'
WHERE STATUS <> 'CLOSE'
Connect by prior PARENT_ID=ID start with PARENT_ID=12345;
I got SQL Error: ORA-00933: SQL command not properly ended
. How can I update table hierarchically?
Edit
I also tried to put the where
condition in the start with
, but it does not help:
update HTABLE set status = 'INACTIVE'
Connect by prior PARENT_ID=ID start with PARENT_ID=12345 AND STATUS <> 'CLOSE';