Declaring a query

Bumbulla

Active Member
Hey folks

using the same sheme as in example script.

declare Level13Friends sqlitequery ${PlayerInfoDB.ExecQuery["SELECT * FROM Amadeus_Friends where level=13;"]}
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?
 

Kannkor

Ogre
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?
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)
 
Top Bottom