I don't have a SQL version so here is my xBase code
GO top
LOCATE FOR myField = "/DeviceRGB {} cs"
DO WHILE FOUND()
DELETE REST WHILE f1 <> "(Section Ends Here)) 198.636 Tj"
DELETE
CONTINUE
ENDDO
Hope this fits your needs ........... Rich
>I have a table with around 1000 records. I need to delete some range of records from it. The record I want starts with "/DeviceRGB {} cs" and Ends with "(Section Ends Here)) 198.636 Tj". I need to delete all the records between these two (including these two also).
>
>After "(Section Ends Here)) 198.636 Tj" again few records are there which I do not want to delete, but want to keep.
>I want to delete all such instances from the Table.
>
>Currently I am using Locate for command and Recno() to acertain the record range and deleting all the occurrences. But this is taking enough time.
>
>Here is the record (Varchar) which I want to delete
>
>
>0 Tc
> [1 0 0 1 0 0] Tm
>0 0 Td
>/DeviceRGB {} cs
>[0 0 0] sc
>f
>/DeviceRGB {} cs
> [1 0 0 1 0 0] Tm
>0 0 Td
>0 Tc
>/F22_0 14 Tf
>/F42_0 12 Tf
>(Section Ends Here)) 198.636 Tj
>0 Tc
> [1 0 0 1 0 0] Tm
>0 0 Td
>[0 0 0] sc
>f
>/DeviceRGB {} cs
>[0 0 0] sc
>f
>/DeviceRGB {} cs
> [1 0 0 1 0 0] Tm
>0 0 Td
>0 Tc
>/F22_0 14 Tf
>/DeviceGray {} cs
>0 Tc
> [1 0 0 1 0 0] Tm
>0 0 Td
>/F42_0 12 Tf
>(Section Ends Here)) 198.636 Tj
>0 0 Td
>/F42_0 12 Tf
>0 Tc
> [1 0 0 1 0 0] Tm
>
>
>In the above case I need to Delete records from 4 to 13 and 19 to 32. There may be n number of such cases in my table. Is there can be any SQL or command that can do it fast and at one stretch.
>
>Kindly Guide
>Thanks as Always.