Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Anaristos
Sorcerer


Joined: 17 Jul 2007
Posts: 821
Location: California

PostPosted: Fri Mar 11, 2011 1:46 am   

[333aPro] Questions on sql procedures
 
I have decided to give CMUD's sql functions and commands a try. However, I am running into some problems:

A) There are no error reporting protocols. If something goes wrong, an exception is thrown. I find this a rather abrupt way to end a script.
Even this would be helpful except that only SQLITE_ERROR is returned (SQL error or missing database) which covers a multitude of sins.
The database is not missing (as the list returned by #SQLDB attests) and the query statement is valid (it works with my own data provider and on any SQLite3 viewers I've tried)
so the error can't be SQLITE_ERROR. What I did to test was basically take the example from the docs and change the pertinent data: database and table, and do a general query against it.

B) If I run the example in the docs, everything works fine including the #SQLCLOSE command. This command, however, throws an exception (Invalid pointer) after it disconnects. My guess is that it tries to do something after it closes the connection. What, I have no idea.

C) If the %sql function returns no rows (the COM object which represents the rows is null) @comobject.Eof() is meaningless so any looping will be infinite. So, perhaps it is my responsibility to make sure the COM object is really a COM object, but if so, the docs should say so. Note here that all the helpful properties such as RecordCount won't be available.

EDIT: Corrected the mistake pointed to by MattLfton
_________________
Sic itur ad astra.

Last edited by Anaristos on Fri Mar 11, 2011 2:40 am; edited 1 time in total
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Fri Mar 11, 2011 2:19 am   
 
Which helpfile are you looking at that shows using #DBCLOSE with an SQL database? My quick glance seems to indicate that this command doesn't apply to anything other than the built-in DB module stuff, and that you should instead use #SQLCLOSE.
_________________
EDIT: I didn't like my old signature
Reply with quote
Anaristos
Sorcerer


Joined: 17 Jul 2007
Posts: 821
Location: California

PostPosted: Fri Mar 11, 2011 2:42 am   
 
My apologies, thanks for pointing out the mistake. It is #SQLCLOSE to which I refer, old habits die hard. I edited the post above.
_________________
Sic itur ad astra.
Reply with quote
Anaristos
Sorcerer


Joined: 17 Jul 2007
Posts: 821
Location: California

PostPosted: Tue Mar 15, 2011 2:53 am   
 
Does the lack of response to my questions mean that I will have to wait (again) for someone else to complain about this before my questions might be considered as addressing a potential problem? Had I figured how to make it work, I wouldn't have posted anything to begin with. I realize this is a "production" forum, but since there is no longer a beta forum, I don't see where else I can ask my questions.
_________________
Sic itur ad astra.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Tue Mar 15, 2011 4:09 am   
 
You didn't ask any questions. You just pointed out a few things with the SQL functionality in CMud. Pretty much all of them are either external to CMud entirely (point A) and therefore likely unable to be fixed easily, or internal to the CMud code such that regular users will only be able to explain to you why your scripts aren't working and that you'll need to shelve the project for, say, another year or so before Zugg gets a chance to pour more effort into that part of CMud.
_________________
EDIT: I didn't like my old signature
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue Mar 15, 2011 6:40 pm   
 
I agree that there should be improved error handling in the SQL functions. Ideally this would have been caught during the long beta testing process. I've added it to the to-do list for the future, but I can't give any sort of ETA on when something like that might be added. It is much slower to add new stuff once CMUD is Public because I don't want to add new bugs or decrease stability. As you are aware from beta testing, even the smallest addition often has side effects and issues. So I usually only add new stuff to beta versions, and the v4 beta is currently on hold.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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