If you have already created the database/tables in your sql file, you will need to issue commands against it to rename the table(alter table).
If you want to know more, i suggest taking PAEvenson advise and learn about the sqlite database structure and commands.
Other wise from the ground up,
in the file from Unify, dbAccess.js, there is a class called dbAccess, this has a function called CreateTable. When you execute ScriptThatUsesTheDatabase.js in the start function it uses the dbAccess class and tries to open the database file by name
public var DatabaseName : String = "TestDB.sqdb";
public var TableName : String = "TestTable";
the file name “TestDB.sqdb” can be whatever, you could rename it ‘abc.sqlllllite’ and open that file, sqlite doesn’t care. Back to the start function,
function Start() {
// Give ourselves a dbAccess object to work with, and open it
db = new dbAccess();
db.OpenDB(DatabaseName);
// Let's make sure we've got a table to work with as well!
var tableName = TableName;
var columnNames = new Array("firstName","lastName");
var columnValues = new Array("text","text");
try {
db.CreateTable(tableName,columnNames,columnValues);
}
catch(e) {// Do nothing - our table was already created
//- we don't care about the error, we just don't want to see it
}
}
The usage of db.CreateTable in a try/catch does one of two things, if the database doesn’t exist when db.CreateTable is invoked, it will create it, otherwise an exception is thrown and caught in the ‘catch(e)…’ line, the exception is swallowed because the assumption is the database exception thrown will be “the table already exists…” or some such exception.
Just remember if you change the name of the database file, then that file will not exist until you run this the first time.