View Single Post

Thread: Upcoming TABLE Code Changes

  1. - Top - End - #23
    Titan in the Playground
     
    Grey_Wolf_c's Avatar

    Join Date
    Aug 2007

    Default Re: Upcoming TABLE Code Changes

    Quote Originally Posted by Qwertystop View Post
    No way to say "only look within {TABLE}{/TABLE} tags?
    it probably could be done for posts containing a single table:

    Update Posts
    Set body = left(body, charindex(body, '{table}')) + (sql code to transform the table: a bunch of replaces on the string between the two tags) + right(body, len(body)-charindex(body, '{/table}'))
    where body like '%{table}%'
    --Confirm that there is only one table tag:
    and charindex(body, '{table}', charindex(body, '{table}')+1)=0

    But it could get very messy for more than one table in the same post: SQL doesn't really provide the kind of iterating tools and functions you would need.

    (Qwerty, if you want me to bore your ear off with SQL logic, drop me a PM)

    Grey Wolf, most definitely NOT offering advice on how to approach the change - just explaining the dangers of doing so with SQL
    Last edited by Grey_Wolf_c; 2014-02-19 at 08:02 PM.
    Interested in MitD? Join us in MitD's thread.
    There is a world of imagination
    Deep in the corners of your mind
    Where reality is an intruder
    And myth and legend thrive
    Quote Originally Posted by The Giant View Post
    But really, the important lesson here is this: Rather than making assumptions that don't fit with the text and then complaining about the text being wrong, why not just choose different assumptions that DO fit with the text?
    Ceterum autem censeo Hilgya malefica est