Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 Other Topics
 update multiple fields in table

Author  Topic 

trebor7-1
Starting Member

3 Posts

Posted - 2014-02-07 : 18:36:47
Hi I'm using Sybase ASA and not that familiar with SQL but will try and explain what I need to do.
I have a field called 'filepath' which has some incorrect entires.
I have made the following query that works well but only on one entry at a time.
update dbcreators.imageref set filepath = replace('ep\G_I\2013_FEB\01\SH102957\D21ALNRM', 'ep\', '')
where indexpatient = 7099 and indeximageref = 3

The problem is that there are 70 entires for indexpatient 7099 showing the filepath for images 1 to 70 and each has a unique ending D21ALNRM in the above example. I have several patients with incorrect filepath entries all with 60 or 70 rows to correct so I was trying to correct more that 1 row at a time. Thanks for any help

trebor7-1
Starting Member

3 Posts

Posted - 2014-02-10 : 15:52:16
Maybe I've not made this request clear enough.
table imageref
indexpatient
Go to Top of Page

trebor7-1
Starting Member

3 Posts

Posted - 2014-02-10 : 16:16:56
table imageref

indexpatient filepath indeximageref
7099 ep\G_I\2013_FEB\01\SH102957\D21ALNRS 1
7099 ep\G_I\2013_FEB\01\SH102957\D21ALOBU 2
7099 ep\G_I\2013_FEB\01\SH102957\D21ALOS0 3

what I need is to remove the 'ep\' at the beginning of the filepath
but its the final individual code at the end that has to remain.

this works

update imageref set filepath = replace('ep\G_I\2013_FEB\01\SH102957\D21ALNJK', 'ep\', '')

but I have to edit and re enter for 70 updates, was looking to reduce the work load if possible.


Go to Top of Page
   

- Advertisement -