|
Drewbie Newbie
Joined: 27 Nov 2011 Posts: 6
|
Posted: Sun Nov 27, 2011 7:27 am
%concat and quotes/#query problem |
#QUERY %concat("((&MobName=",$quest_mob,") && (&Area=",$quest_area,"))") All
so, this obviously does not work because the search is not surrounded by quotes. I can not figure out how to surround this search with quotes, becaue %concat will not ingnore them by placing a ~ before a quote.
I can not however put the quotes around the %concat function either because then that function gets ignored. I was having trouble with the variables expanding, which is why I'm using it. Any help would be hot. My areas and mobs are almost always multi word searches, fyi. Just looking to get a working #QUERY on my DB.
Thanks |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4715 Location: Pensacola, FL, USA
|
Posted: Sun Nov 27, 2011 12:39 pm |
have you tried wrapping the entire query command in curly braces, or inserting it inside an #EXEC for the sake of expanding some things?
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
Drewbie Newbie
Joined: 27 Nov 2011 Posts: 6
|
Posted: Sun Nov 27, 2011 6:23 pm |
thanks for the respons, though neither of these suggestions worked for me. Honestly, I am only used to coding very basic things. This is my first step into using the database at all and most of these commands as well.
|
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sun Nov 27, 2011 10:53 pm |
Should be able to use ~" on either side of the concat. This lets the concat function execute and return a result, and then puts that between the "" for the #query. Beyond that, you just need more double quotes. If I recall """ is the same as ~"
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Drewbie Newbie
Joined: 27 Nov 2011 Posts: 6
|
Posted: Sun Jan 22, 2012 6:11 am |
So, after much work I've gotten virtually nowhere. I've looked at other people's difficulty with #QUERY for some possible solutions. Here's what I've attempted. Again, any help would be hot. Personally I think the help files should be vastly expanded on this function. I've copy/pasted this mob into my database so, I know it's there. I am getting NO OUTPUT from the #QUERY or #FIND functions. I'm not sure what to expect when I actually get this working correctly, so I've stacked this mess together. It's just 3 attempts at getting the SAME thing to #QUERY properly.
$mob=%gmcp.comm.quest.targ
$area=%gmcp.comm.quest.area
#DBRESET
#EXEC {#QUERY ~"%concat("(&Name=",%gmcp.comm.quest.targ,")")"}
#SHOW &Name
#DBRESET
#QUERY ~"%concat("""((&Name=",$mob,")&&(&Area=",$area,"))")"
#SHOW &Name
#DBRESET
$string=~"%concat("((&Name=",$mob,")&&(&Area=",$area,"))")~"
#QUERY $string
#SHOW &Name
#SHOW $string
#SHOW $mob
#SHOW $area
output:
a baby
a baby
a baby
"((&Name=a nomad's horse)&&(&Area=Plains of Nulan'Boar))"
a nomad's horse
Plains of Nulan'Boar |
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|