About Us
Products
Purchase
Downloads
Support
Forums
Contact Us
Site
 Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
liujc
Beginner


Joined: 02 Mar 2007
Posts: 23
Location: China, BeiJing

PostPosted: Fri Mar 02, 2007 12:51 pm   

How to use two database?
 
I tried to load two database, for example: npc.db and weapon.db. But it seems the zmud only support one database at the one time. I rewrote my program, closed the every database after used, but I found it is slow when load or close the database. What should I do?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Fri Mar 02, 2007 9:46 pm   
 
to load two databases, use the #DBLOAD command. You could alternatively do this via the DB Module GUI, as well. In either case, the last load operation will be the database that is available to all of the data-related commands and functions.

Not sure if there's a long-name method to directly access a database, however, but I doubt there is.
_________________
EDIT: I didn't like my old signature
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Fri Mar 02, 2007 10:43 pm   
 
#dbload "C:\mydatabases\npc.db"

Works.

Thing is you can only Access one database at a time, but you can have multiple ones open. So you could do something like.

@npc=%query("Like blah blah blah in here") then #dbload "C:\mydatabases\weapon.db" @weapon=%query("Gee what does this guy wield?")

There are many ways to deal with it but there is a about 1 second delay between loading a database into memory depending on the size of course. So if you made an alias to load all of the databases that you would use wait a few seconds then use your databases with little or no delay. When you are done then close your database window.

The last database that you used #DBLOAD on is the one that you are able to access via the database commands/functions.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
liujc
Beginner


Joined: 02 Mar 2007
Posts: 23
Location: China, BeiJing

PostPosted: Sat Mar 03, 2007 4:51 pm   
 
Thanks a lot!
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net