Discussion in 'isxSQLite' started by Bumbulla, Apr 30, 2011.

  1. Bumbulla

    Bumbulla Active Member

    Messages:
    26
    Hey folks

    using the same sheme as in example script.

    As some parts of my code are in a loop it happens sometimes that some of the declared querys already exist in that scope and script will abort asap. I tried avoiding it via "exists" checking but seems if the requirements are met and it exists already it'll not update the query anymore and i'll only have "old" data.
    How do i avoid this?
  2. Kannkor

    Kannkor Ogre

    Messages:
    3,632
    If it exists delete it.
    Lavish wiki: "deletevariable"

    Although.. you can just update the query instead of deleting and re-creating it..
    Here's some of how I use it..

    declare qPlayerExists sqlitequery
    (inside a loop below)
    qPlayerExists:Set[${PlayerDB.ExecQuery["SELECT PlayerName FROM EQ2_Players WHERE PlayerName='${Me.Raid[${iCounter}].Name}';"]}]
    qPlayerExists:Finalize
    (end of loop)
    ..
    (inside a new loop below)
    qPlayerExists:Set[${PlayerDB.ExecQuery["SELECT PlayerName FROM EQ2_Players WHERE PlayerName='${Me.Group[${iCounter}].Name}';"]}]
    qPlayerExists:Finalize
    (end of loop)

Share This Page