SQLite long query
#1

Recently interested in SQLite but I couldn't figure out this table is not being created, any idea why?

Код:
new string2[1500];
    strcat(string2, "CREATE TABLE IF NOT EXISTS teams (teamid INTEGER PRIMARY KEY AUTOINCREMENT,");
	strcat(string2, "teamname VARCHAR(24) COLLATE NOCASE,");
	strcat(string2, "colour INTEGER DEFAULT 0 NOT NULL,");

	strcat(string2, "skin1 INTEGER DEFAULT 0 NOT NULL,");
	strcat(string2, "skin2 INTEGER DEFAULT 0 NOT NULL,");
	strcat(string2, "skin3 INTEGER DEFAULT 0 NOT NULL,");

	strcat(string2, "skin1weap1 INTEGER DEFAULT 0 NOT NULL,");
	strcat(string2, "skin1weap2 INTEGER DEFAULT 0 NOT NULL,");
	strcat(string2, "skin1weap3 INTEGER DEFAULT 0 NOT NULL,");

	strcat(string2, "skin2weap1 INTEGER DEFAULT 0 NOT NULL,");
	strcat(string2, "skin2weap2 INTEGER DEFAULT 0 NOT NULL,");
	strcat(string2, "skin2weap3 INTEGER DEFAULT 0 NOT NULL,");

	strcat(string2, "skin3weap1 INTEGER DEFAULT 0 NOT NULL,");
	strcat(string2, "skin3weap2 INTEGER DEFAULT 0 NOT NULL,");
	strcat(string2, "skin3weap3 INTEGER DEFAULT 0 NOT NULL,");

	strcat(string2, "skin1ammo1 INTEGER DEFAULT 0 NOT NULL,");
	strcat(string2, "skin1ammo2 INTEGER DEFAULT 0 NOT NULL,");
	strcat(string2, "skin1ammo3 INTEGER DEFAULT 0 NOT NULL,");

	strcat(string2, "skin2ammo1 INTEGER DEFAULT 0 NOT NULL,");
	strcat(string2, "skin2ammo2 INTEGER DEFAULT 0 NOT NULL,");
	strcat(string2, "skin2ammo3 INTEGER DEFAULT 0 NOT NULL,");

	strcat(string2, "skin3ammo1 INTEGER DEFAULT 0 NOT NULL,");
	strcat(string2, "skin3ammo2 INTEGER DEFAULT 0 NOT NULL,");
	strcat(string2, "skin3ammo3 INTEGER DEFAULT 0 NOT NULL)");

	strcat(string2, "spawn1X FLOAT DEFAULT 0.0,");
	strcat(string2, "spawn1Y FLOAT DEFAULT 0.0,");
	strcat(string2, "spawn1Z FLOAT DEFAULT 0.0,");
	strcat(string2, "spawn2R FLOAT DEFAULT 0.0,");

	strcat(string2, "spawn2X FLOAT DEFAULT 0.0,");
	strcat(string2, "spawn2Y FLOAT DEFAULT 0.0,");
	strcat(string2, "spawn2Z FLOAT DEFAULT 0.0,");
	strcat(string2, "spawn2R FLOAT DEFAULT 0.0,");

	strcat(string2, "spawn3X FLOAT DEFAULT 0.0,");
	strcat(string2, "spawn3Y FLOAT DEFAULT 0.0,");
	strcat(string2, "spawn3Z FLOAT DEFAULT 0.0,");
	strcat(string2, "spawn3R FLOAT DEFAULT 0.0)");
	
	db_query(Database, string2);
Reply
#2

enable "dbquerry"ing and check the server log for errors.
Reply
#3

Quote:
Originally Posted by xVIP3Rx
Посмотреть сообщение
enable "dbquerry"ing and check the server log for errors.
I don't know neither what do you mean nor how to do
Reply
#4

Add this in server.cfg
Код:
db_log_queries 1
db_logging 1
This will log all the queries to server log, post it.
Reply
#5

strcat(string2, "skin3ammo3 INTEGER DEFAULT 0 NOT NULL)");

strcat(string2, "spawn1X FLOAT DEFAULT 0.0,");
Reply
#6

Quote:
Originally Posted by xVIP3Rx
Посмотреть сообщение
Add this in server.cfg
Код:
db_log_queries 1
db_logging 1
This will log all the queries to server log, post it.
I see it ends somewhere early and a duplicated one exists so:

Quote:
Originally Posted by Matess
Посмотреть сообщение
strcat(string2, "skin3ammo3 INTEGER DEFAULT 0 NOT NULL)");

strcat(string2, "spawn1X FLOAT DEFAULT 0.0,");
Yes, working.

Cheers both xVIP3Rx and Matess
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)