logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Can The .Tables command be used?

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows technical support
View previous topic :: View next topic  
Author Message
highv priest



Joined: 01 Mar 2013
Posts: 111

PostPosted: Sun Apr 27, 2014 8:42    Post subject: Can The .Tables command be used? Reply with quote

I tried various ways of getting .Tables to work in SQlite, but it always registers a syntax error, which is problematic since this is the only problem I had besides it not committing past resets.

I've seen various work around options posted in other forums for doing a SQL search for all of them using sqlite_master, but I wasn't sure if .tables works, and if it did I'd prefer not to write a while loop for it.
Back to top
View user's profile Send private message
highv priest



Joined: 01 Mar 2013
Posts: 111

PostPosted: Sun Apr 27, 2014 11:33    Post subject: Reply with quote

Just incase no such option exists... Here is the function available that I created.

Code:
string GetAllActiveSQLTables()
{
object oModule = GetModule();
SQLExecDirect("SELECT name FROM sqlite_master WHERE type = 'table'");
SetLocalString(oModule, "NWNX!ODBC!FETCH", GetLocalString(oModule, "NWNX!ODBC!SPACER"));
string sFetch = GetLocalString(oModule, "NWNX!ODBC!FETCH");
string sTotal = "ACTIVE TABLES= "+sFetch+"\n";
string sExclusion = "AND name!= '"+sFetch+"'";
while(GetStringLength(sFetch) > 0)
{
SQLExecDirect("SELECT name FROM sqlite_master WHERE type = 'table' "+sExclusion);
SetLocalString(oModule, "NWNX!ODBC!FETCH", GetLocalString(oModule, "NWNX!ODBC!SPACER"));
sFetch = GetLocalString(oModule, "NWNX!ODBC!FETCH");
sExclusion+= " AND name!= '"+sFetch+"'";
sTotal+= sFetch+"\n";
}
return sTotal;
}


EDIT= So far as I can tell... Row numbers(or really any unique identifiers besides good ole names) don't exist for tables themselves, which is the reason for my implementation above, if there is less... Messy ways please let me know. An important note is that utilizing:

Code:
SELECT name FROM sqlite_master
WHERE type='table'
ORDER BY name;


Does NOT work to display all of them(though it is nice to have the first alphabetical one show up!) Very Happy
Back to top
View user's profile Send private message
Aliraza2



Joined: 05 Sep 2014
Posts: 1

PostPosted: Fri Sep 05, 2014 9:42    Post subject: Reply with quote

The issue was actually caused by Microsoft's own error-reporting dialogue. I found there was a way to turn said dialogue off. It has not crashed yet, so I have yet to fully test it, but I don't see any reason why it wouldn't have done the trick.
_________________
You can get score highest marks in braindumps dumps exam using Bloomfield College .
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows technical support All times are GMT + 2 Hours
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


Powered by phpBB © 2001, 2005 phpBB Group