View Single Post

   
  #2 (permalink)  
Old 04-08-2008, 06:17 PM
Mark A. Parsons
 
Posts: n/a
Default Re: Need Help with Sybase

What's your 'update' statement look like?

Is the 'update' statement generating an error (if so, what error), or is it
not functioning properly (ie, not updating the correct records)?

ali.alauoubiy@drkw.com wrote:

> Hi all..
>
> I need to change the following Select statement to an update statement
> which updates hf.active to 'N' where all the hf.active found is 'n'.. I
> am finding difficulties of re-writting this because of the recursive
> relationship.
>
> select
> *
> from
> OrgUnit ou_sb inner join Allocation a
> on ( a.subjectOrgUnitId = ou_sb.orgUnitId )
> inner join OrgUnit ou_tb
> on ( ou_tb.orgUnitId = a.parentOrgUnitId )
> inner join HierarchyFlags hf
> on ( hf.orgUnitId = ou_sb.orgUnitId )
> where
> ou_tb.orgUnitName = 'Old Books'
> and hf.active ='n'
>
> Many Thanks
> Ali
>

Reply With Quote