|
Dimonytch Newbie
Joined: 08 Feb 2008 Posts: 2
|
Posted: Sat Feb 23, 2008 12:00 am
Parameterized query help needed |
Hi all,
#show %query(&MobName = "wenumic the roach") returns record ids as expected, unfortunately I can't figure out how one can pass mobname as a parameter.
I tried creating an alias 'test' as #show %query(&MobName = %1) which is not working (test "wenumic the roach").
Could someone help me with the syntax, please? |
|
|
|
Dharkael Enchanter
Joined: 05 Mar 2003 Posts: 593 Location: Canada
|
Posted: Sat Feb 23, 2008 12:28 am |
In the alias change %1 to %-1
Code: |
#show %query(&MobName = %-1) |
|
|
_________________ -Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style." |
|
|
|
Dimonytch Newbie
Joined: 08 Feb 2008 Posts: 2
|
Posted: Sat Feb 23, 2008 12:47 am |
No luck
Void result either. |
|
|
|
Dharkael Enchanter
Joined: 05 Mar 2003 Posts: 593 Location: Canada
|
Posted: Sat Feb 23, 2008 1:48 am |
Yeah Lame :(, I think query is kinda funky.
but if use a lua alias or func it should work out alright.
Code: |
<alias name="test" language="Lua" id="23">
<value>print( zs.func.query('&Name = "'..zs.params(1)..'"'))
</value>
</alias> |
Code: |
print( zs.func.query('&Name = "'..zs.params(1)..'"')) |
|
|
_________________ -Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style." |
|
|
|
Anaristos Sorcerer
Joined: 17 Jul 2007 Posts: 821 Location: California
|
Posted: Sat Feb 23, 2008 11:45 am |
I haven't use Lua yet, however, I do use %query with parameters in at least one function. As follows:
Code: |
$room = %-1
....
$rec = %find( $room, All|@MasterDB, Area)
....
gprec = %dbget($rec)
....
|
and it works just fine.
Edit: oops, wrong function, sorry. |
|
_________________ Sic itur ad astra. |
|
|
|
|
|