View previous topic :: View next topic |
Author |
Message |
highv priest
Joined: 01 Mar 2013 Posts: 111
|
Posted: Sun Apr 27, 2014 8:42 Post subject: Can The .Tables command be used? |
|
|
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 |
|
|
highv priest
Joined: 01 Mar 2013 Posts: 111
|
Posted: Sun Apr 27, 2014 11:33 Post subject: |
|
|
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!) |
|
Back to top |
|
|
Aliraza2
Joined: 05 Sep 2014 Posts: 1
|
Posted: Fri Sep 05, 2014 9:42 Post subject: |
|
|
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 |
|
|
|
|
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
|