|
Anaristos Sorcerer
Joined: 17 Jul 2007 Posts: 821 Location: California
|
Posted: 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 |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: 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 |
|
|
|
Anaristos Sorcerer
Joined: 17 Jul 2007 Posts: 821 Location: California
|
Posted: 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. |
|
|
|
Anaristos Sorcerer
Joined: 17 Jul 2007 Posts: 821 Location: California
|
Posted: 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. |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: 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 |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: 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.
|
|
|
|
|
|