|
godzilla1 Beginner
Joined: 14 Jul 2005 Posts: 22 Location: Budapest
|
Posted: Thu Jul 14, 2005 4:26 pm
search in database |
How can i search in database?
I have database with 2 (or more) columns. first column for names, second for whatever.
I have just for the example 2 names in the first column, "peter" and "pete". With triggers i gain information about "pet" (3rd name), and i need to check if this name exist alredy. If there isnt "pet" then i add it to the database with the #new command.
If there is "pet", then i change it.
But here is the problem, how to check database if pet exist or not? how to search for exact pattern? (#find pet will find pete and peter too...)
editet----
Also i request a new help file for databases!!!
Why? Because it doesnt worth anything. The examples in the help files dont work at all. For example #DBFIRST;#WHILE (!%null(%rec)) {#SHOW &Name;#DBNEXT} or #LOOPVIEW {#SHOW &Name}. These examples are in the help file, but what do they do? Show the &name of the first record X times. #LOOPVIEW {#DBGET;#SHOW &Name} would work probably. |
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Thu Jul 14, 2005 11:18 pm |
Maybe #find or #query are what you're after
From the help files:
#FIND blue Potions
Displays all of the records in the Potions view whose first column contains the string "blue".
#QUERY ((&Hit>2) & (&Dam > 2)) Weapons
displays all of the records in the Weapons view whose Hit and Dam fields are both greater than 2. Always make sure there are parenthesis around the entire first expression. |
|
_________________ CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;) |
|
|
|
godzilla1 Beginner
Joined: 14 Jul 2005 Posts: 22 Location: Budapest
|
Posted: Fri Jul 15, 2005 5:46 am |
I try to explain again.
I have a database with similar names. Like Peter, Pete.
I type '#find Pet' and - althought there is no "Pet" name in the base at all, the command will display Peter and Pete.
I dont want to find similar names, i want to find the exact matching pattern.
#find and #query arent what i am after - unless there are wildchars what i can use in these commands! |
|
|
|
Aarlot Adept
Joined: 30 Dec 2003 Posts: 226
|
Posted: Fri Jul 15, 2005 6:55 am |
#AL dbcheck {#QUERY (&Name = "%-1")}
|
|
_________________ Everyone is entitled to their beliefs - until they die. Then only the truth matters. |
|
|
|
godzilla1 Beginner
Joined: 14 Jul 2005 Posts: 22 Location: Budapest
|
Posted: Fri Jul 15, 2005 7:42 am |
Thanks
|
|
|
|
|
|