|
Cleaner Newbie
Joined: 09 May 2004 Posts: 5 Location: South Africa
|
Posted: Tue Dec 27, 2005 10:16 pm
%find in database problem |
I don't know if I just don't understand the help file correctly or if I'm typing something wrong, but as I understand the help file and the way the client responds to my commands something is seriously wrong. The whole problem comes in when I want to do %find for a column other than the first one.
I have an equipment database called "Aardeq" and it is my only database. It is constantly open.
Here's what I get:
#echo %find(evil)
gets me the result:
48aa|92aa|116aa|463aa|466aa
This is correct, because the first column entries for the records are:
48 - Evil Touch
92 - Damian's Sight Of Evil
116 - an evil looking black dagger
463 - an evil gem
466 - an evil charm
Next I do:
#echo %find(evil,Armor)
which gets me:
92aa|466aa
This is also correct, because only records 92aa and 466aa are Armor types.
All of these queries continue to work correctly if I add ItemDescription as the column it should look in, i.e. #echo %find(evil,Armor,ItemDescription)
Now everything goes haywire and cock-eyed when I use what I understand to be the full %find function to look in another column.
The field name for the first column is ItemDescription. The second column is ItemNames.
#echo %find(evil,Armor,ItemNames)
this bags me:
62aa
Which is completely and utterly wrong. Here's record 62aa's first three columns:
ItemDescription: Clear Vision
ItemNames: clear vision path perspective
ItemType: Armor
I get the same result as above with all the various ways of putting "" in there.
#echo %find(evil,Armor,"ItemNames")
#echo %find(evil,"Armor",ItemNames)
#echo %find(evil,"Armor","ItemNames")
#echo %find("evil",Armor,ItemNames)
#echo %find("evil",Armor,"ItemNames")
#echo %find("evil","Armor",ItemNames)
#echo %find("evil","Armor","ItemNames")
They all just say:
62aa
And as if I'm not confused enough already:
#echo %find(evil,All)
48aa|92aa|116aa|463aa|466aa
#echo %find(evil,All,1)
61aa|62aa|187aa|190aa|216aa|259aa|295aa|315aa|327aa|349aa|365aa|486aa|576aa|648aa|676aa|684aa|687aa|691aa
Somebody please tell me what's going on here.
All I want to do is be able to query my own database to see which items have a Dex or Strength bonus on it, or a skill modifier, etc. I read the help file on %query and I can't comprehend how I can use it for my purpose. The field containing stat mods is called ItemStatMods and it is a text field.
Any help will be greatly appreciated. |
|
_________________ The first step to Control is Understanding. |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Thu Dec 29, 2005 6:11 pm |
Your're right there seems to be a hiccup there... I tried it out myself and get similar results. Strangely enough the #FIND works just fine. You can try that instead. Unfortunately I didn't come up with an easy way for you use the %query command to search on the name. Good luck.
|
|
_________________ Asati di tempari! |
|
|
|
digits Beginner
Joined: 17 Jul 2004 Posts: 15
|
Posted: Thu Dec 29, 2005 9:41 pm |
Isn't it easier to just make a script that queries iwuvaard's database? (www.iwuvaard.org)
You can even mail them and ask them do send a dump of their database if you want... ;P
Sadly I have no answer to why it bugs out for you...
Quote: |
All I want to do is be able to query my own database to see which items have a Dex or Strength bonus on it, or a skill modifier, etc. I read the help file on %query and I can't comprehend how I can use it for my purpose. The field containing stat mods is called ItemStatMods and it is a text field. |
It's been a long time since I had anything to do with the databse but
If you have all of those in one field you're in for it... but if you have separated them into different fields you could just do a
Code: |
#echo %query((&Str>0) & (&Con >0) & (&Align = "evil"), Armor) |
|
|
|
|
Cleaner Newbie
Joined: 09 May 2004 Posts: 5 Location: South Africa
|
Posted: Thu Dec 29, 2005 11:46 pm |
Thanks for the feedback folks, will try out a few things.
The reason I didn't seperate the stats is because I didn't feel like seperating any of the others (500+ different skill mods, 30 or so different resistances), but I reckon I can just make seperate fields in the database for the stats, it's like 12 of them. I made the database with the purpose of looking up items by looking at the database itself, sorting the items into views according to type, level, worn location, etc. but I will have to make an interface for displaying items now, because having to look at all those fields will be annoying.
Thanks again for the replies, appreciate it. |
|
_________________ The first step to Control is Understanding. |
|
|
|
kohl Beginner
Joined: 15 May 2012 Posts: 15
|
Posted: Sat May 19, 2012 4:39 pm |
Try putting the armor in () and leave Itemnames without ""
|
|
|
|
kohl Beginner
Joined: 15 May 2012 Posts: 15
|
Posted: Sat May 19, 2012 4:41 pm |
wow, this was an old post I replied to. nevermind.
|
|
|
|
|
|
|
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
|
|