>> SQL Create Table - Line too Long! <<
#1

Hi! Please help me with this!

C:\Documents and Settings\SoNNy\Desktop\Fadmin\fadmin.pwn(997) : error 075: input line too long (after substitutions)
C:\Documents and Settings\SoNNy\Desktop\Fadmin\fadmin.pwn(99 : error 037: invalid string (possibly non-terminated string)
C:\Documents and Settings\SoNNy\Desktop\Fadmin\fadmin.pwn(99 : error 017: undefined symbol "CREATE"
C:\Documents and Settings\SoNNy\Desktop\Fadmin\fadmin.pwn(99 : error 017: undefined symbol "TABLE"
C:\Documents and Settings\SoNNy\Desktop\Fadmin\fadmin.pwn(99 : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


5 Errors.

pawn Код:
db_free_result( db_query( Database, "CREATE TABLE IF NOT EXISTS `Users` \
                                        ( `Nume` TEXT,\
                                          `IP` NUMERIC,\
                                          `Password` TEXT,\
                                          `Score` NUMERIC,\
                                          `Money` NUMERIC,\
                                          `VIPlevel` NUMERIC,\
                                          `AdminLevel` NUMERIC,\
                                          `JoinedOn` NUMERIC,\
                                          `Muted` NUMERIC,\
                                          `Frozen` NUMERIC,\
                                          `Warnings` NUMERIC,\
                                          `NameColor` CHARACTER,\
                                          `Kills` NUMERIC,\
                                          `Deaths` NUMERIC,\
                                          `Weapon1` NUMERIC,\
                                          `Weapon2` NUMERIC,\
                                          `Weapon3` NUMERIC,\
                                          `Weapon4` NUMERIC,\
                                          `Weapon5` NUMERIC,\
                                          `Weapon1Ammo` NUMERIC,\
                                          `Weapon2Ammo` NUMERIC,\
                                          `Weapon3Ammo` NUMERIC,\
                                          `Weapon4Ammo` NUMERIC,\
                                          `Weapon5Ammo` NUMERIC,\
                                          `Coins` NUMERIC )"
) );
Reply
#2

try use a string, try this
pawn Код:
new string[256];
format(string,256,"CREATE TABLE IF NOT EXISTS `Users` \
                                        ( `Nume` TEXT,\
                                          `IP` NUMERIC,\
                                          `Password` TEXT,\
                                          `Score` NUMERIC,\
                                          `Money` NUMERIC,\
                                          `VIPlevel` NUMERIC,\
                                          `AdminLevel` NUMERIC,\
                                          `JoinedOn` NUMERIC,\
                                          `Muted` NUMERIC,\
                                          `Frozen` NUMERIC,\
                                          `Warnings` NUMERIC,\
                                          `NameColor` CHARACTER,\
                                          `Kills` NUMERIC,\
                                          `Deaths` NUMERIC,\
                                          `Weapon1` NUMERIC,\
                                          `Weapon2` NUMERIC,\
                                          `Weapon3` NUMERIC,\
                                          `Weapon4` NUMERIC,\
                                          `Weapon5` NUMERIC,\
                                          `Weapon1Ammo` NUMERIC,\
                                          `Weapon2Ammo` NUMERIC,\
                                          `Weapon3Ammo` NUMERIC,\
                                          `Weapon4Ammo` NUMERIC,\
                                          `Weapon5Ammo` NUMERIC,\
                                          `Coins` NUMERIC )"
;
db_free_result( db_query( Database,string));
Reply
#3

I will try this thx! Now i'm at school
EDIT: Fail...C:\Documents and Settings\SoNNy\Desktop\Fadmin\fadmin.pwn(997) : error 075: input line too long (after substitutions)
C:\Documents and Settings\SoNNy\Desktop\Fadmin\fadmin.pwn(99 : error 037: invalid string (possibly non-terminated string)
C:\Documents and Settings\SoNNy\Desktop\Fadmin\fadmin.pwn(99 : error 017: undefined symbol "CREATE"
C:\Documents and Settings\SoNNy\Desktop\Fadmin\fadmin.pwn(99 : error 017: undefined symbol "TABLE"
C:\Documents and Settings\SoNNy\Desktop\Fadmin\fadmin.pwn(99 : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Reply
#4

pawn Код:
format(string, sizeof(string), "bla bla bla", var, var, var);
format(string, sizeof(string), "%s bla bla bla", string, var, var);
do it like that.
Reply
#5

i have this problem too

Код:
 
    new stringsql[256];
    format(stringsql, 256 ,"CREATE TABLE IF NOT EXISTS `users` ( \
		`id` int(30) NOT NULL AUTO_INCREMENT, \
		`name` varchar(24) NOT NULL, \
		`Key` varchar(129) NOT NULL, \
		`Level` int(12) NOT NULL, \
		`AdminLevel` int(12) NOT NULL, \
		`DonateRank` int(12) NOT NULL, \
		`UpgradePoints` int(12) NOT NULL, \
		`ConnectedTime` int(12) NOT NULL, \
		`Registered` int(12) NOT NULL, \
		`Sex` int(12) NOT NULL, \
		`Age` int(12) NOT NULL, \
		`Origin` int(12) NOT NULL, \
		`CK` int(12) NOT NULL, \
		`Muted` int(12) NOT NULL, \
		`Respect` int(12) NOT NULL, \
		`Money` int(12) NOT NULL, \
		`Bank` int(12) NOT NULL, \
		`Crimes` int(12) NOT NULL, \
		`Kills` int(12) NOT NULL, \
		`Deaths` int(12) NOT NULL, \
		`Arrested` int(12) NOT NULL, \
		`WantedDeaths` int(12) NOT NULL, \
		`PhoneBook` int(12) NOT NULL, \
		`LottoNr` int(12) NOT NULL, \
		`Fishes` int(12) NOT NULL, \
		`BiggestFish` int(12) NOT NULL, \
		`Job` int(12) NOT NULL, \
		`Paycheck` int(12) NOT NULL, \
		`HeadValue` int(12) NOT NULL, \
		`Jailed` int(12) NOT NULL, \
		`Materials` int(12) NOT NULL, \
		`Drugs` int(12) NOT NULL, \
		`Leader` int(12) NOT NULL, \
		`Member` int(12) NOT NULL, \
		`FMember` int(12) NOT NULL, \
		`Rank` int(12) NOT NULL, \
		`Char` int(12) NOT NULL, \
		`ContractTime` int(12) NOT NULL, \
		`DetSkill` int(12) NOT NULL, \
		`SexSkill` int(12) NOT NULL, \
		`BoxSkill` int(12) NOT NULL, \
		`LawSkill` int(12) NOT NULL, \
		`MechSkill` int(12) NOT NULL, \
		`JackSkill` int(12) NOT NULL, \
		`CarSkill` int(12) NOT NULL, \
		`NewsSkill` int(12) NOT NULL, \
		`DrugsSkill` int(12) NOT NULL, \
		`CookSkill` int(12) NOT NULL, \
		`FishSkill` int(12) NOT NULL, \
		`pSHealth` float NOT NULL, \
		`pHealth` float NOT NULL, \
		`Int` int(12) NOT NULL, \
		`Local` int(12) NOT NULL, \
		`Team` int(12) NOT NULL, \
		`Model` int(12) NOT NULL, \
		`PhoneNr` int(12) NOT NULL, \
		`House` int(12) NOT NULL, \
		`Bizz` int(12) NOT NULL, \
		`Pos_x` float NOT NULL, \
		`Pos_y` float NOT NULL, \
		`Pos_z` float NOT NULL, \
		`CarLic` int(12) NOT NULL, \
		`FlyLic` int(12) NOT NULL, \
		`BoatLic` int(12) NOT NULL, \
		`FishLic` int(12) NOT NULL, \
		`GunLic` int(12) NOT NULL, \
		`Gun1` int(12) NOT NULL, \
		`Gun2` int(12) NOT NULL, \
		`Gun3` int(12) NOT NULL, \
		`Gun4` int(12) NOT NULL, \
		`Ammo1` int(12) NOT NULL, \
		`Ammo2` int(12) NOT NULL, \
		`Ammo3` int(12) NOT NULL, \
		`Ammo4` int(12) NOT NULL, \
		`CarTime` int(12) NOT NULL, \
		`PayDay` int(12) NOT NULL, \
		`PayDayHad` int(12) NOT NULL, \
		`CDPlayer` int(12) NOT NULL, \
		`Wins` int(12) NOT NULL, \
		`Loses` int(12) NOT NULL, \
		`AlcoholPerk` int(12) NOT NULL, \
		`DrugPerk` int(12) NOT NULL, \
		`MiserPerk` int(12) NOT NULL, \
		`PainPerk` int(12) NOT NULL, \
		`TraderPerk` int(12) NOT NULL, \
		`Tutorial` int(12) NOT NULL, \
		`Mission` int(12) NOT NULL, \
		`Warnings` int(12) NOT NULL, \
		`Adjustable` int(12) NOT NULL, \
		`Fuel` int(12) NOT NULL, \
		`Married` int(12) NOT NULL, \
		`MarriedTo` varchar(24) NOT NULL, \
		PRIMARY KEY (`id`) \
	)", false, "SendQuery", "");
	mysql_function_query(mysqlh, stringsql)
errors:
error 075: input line too long (after substitutions)
error 037: invalid string (possibly non-terminated string)
error 017: undefined symbol "CREATE"
error 017: undefined symbol "TABLE"
fatal error 107: too many error messages on one line


what i can do?
Reply
#6

Why are you creating tables with the script?, specialy tables which are sized like this, why don't just make a folder somewere in your server map or on your pc with .sql files, and when you have to create them you import them from those files, because you only have to do this once in a long time normaly, so I don't get the point of making a script for it.
Reply
#7

Quote:
Originally Posted by Roel
Посмотреть сообщение
Why are you creating tables with the script?, specialy tables which are sized like this, why don't just make a folder somewere in your server map or on your pc with .sql files, and when you have to create them you import them from those files, because you only have to do this once in a long time normaly, so I don't get the point of making a script for it.
thanks man, i am begginer in mysql
Reply
#8

Quote:
Originally Posted by Roel
Посмотреть сообщение
Why are you creating tables with the script?, specialy tables which are sized like this, why don't just make a folder somewere in your server map or on your pc with .sql files, and when you have to create them you import them from those files, because you only have to do this once in a long time normaly, so I don't get the point of making a script for it.
I think the opposite, if the table creation is in the script its easy to modify the database on the go. Whereas if your just copying files the table structure is static. Unless you add/alter columns with a script which beats the point of not creating the db via script in the first place.

Not to mention if you update the table structure then copy it to your server, you loose all the records currently in the db, unless you do a huge query.

That's just me tho.
Reply
#9

Quote:
Originally Posted by iggy1
Посмотреть сообщение
I think the opposite, if the table creation is in the script its easy to modify the database on the go. Whereas if your just copying files the table structure is static. Unless you add/alter columns with a script which beats the point of not creating the db via script in the first place.

Not to mention if you update the table structure then copy it to your server, you loose all the records currently in the db, unless you do a huge query.

That's just me tho.
I totally agree, why would someone want to create a table from pawno script, while it can also be done in the phpmyadmin in 1 second without any issues, and it would be abit smarter aswell, especially if you met such issue.
Reply
#10

Quote:
Originally Posted by ikey07
Посмотреть сообщение
I totally agree, why would someone want to create a table from pawno script, while it can also be done in the phpmyadmin in 1 second without any issues, and it would be abit smarter aswell, especially if you met such issue.
That's what I mean, and if you store you SQL CREATE queries inside your pawno, and you edit some fields in phpmyadmin you still have to update the script inside your pawno to the recent one, normaly I just export my whole database each week while the server is in development, and if it is done, I just empty my database and export it to my gamemode location, and when I install it on any server I can just import the whole database and your are done...
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)