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.
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 = 3The 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 imagerefindexpatient |
|
|
trebor7-1
Starting Member
3 Posts |
Posted - 2014-02-10 : 16:16:56
|
table imagerefindexpatient filepath indeximageref7099 ep\G_I\2013_FEB\01\SH102957\D21ALNRS 17099 ep\G_I\2013_FEB\01\SH102957\D21ALOBU 2 7099 ep\G_I\2013_FEB\01\SH102957\D21ALOS0 3what I need is to remove the 'ep\' at the beginning of the filepathbut 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. |
|
|
|
|
|