Raised This Month: $51 Target: $400
 12% 

Sql query Compiler error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
marquezs
Member
Join Date: Jun 2010
Old 07-03-2011 , 12:48   Sql query Compiler error
Reply With Quote #1

Code:
static query_ins[512];
		formatex(query, sizeof(query_ins) - 1,"INSERT INTO `%s` (`%s`, `%s`, `%s`, `%s`, `%s`, CURRENT_TIMESTAMP, `%s`, `%s`, `%s`, `%s`, `%s`, `%s`, `%s`, `%s`)\
		VALUES ('%i', '%s', '%i', '%i' ,'%i' ,'%s', '%s', '%i', '%i', '%i', '%i', '%i')",\
		BALELOS1, BALELOS3, BALELOS4, BALELOS2, BALELOS5, BALELOS6, BALELOS7, BALELOS8, BALELOS9, BALELOS10, BALELOS11,\
		BALELOS12, BALELOS13, BALELOS14,value1, value12, value13, value14, value15, value16, value17, value18, value19,\
		value111, value122, value133)
BALELOS1,2,3,4... are defines with the name of the column. all columns have at least 4 characters.

Then we have the value1,2,3... most of them are integers and some are strings with at least 10 characters.

I've tried increasing the size of the array but I have always this error when I try to compile:

Error: Input line too long (after substitutions) on line 197


Thanks.
marquezs is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 07-03-2011 , 13:37   Re: Sql query Compiler error
Reply With Quote #2

You should add it to string in parts like this:
PHP Code:
static query_ins[1024];
new 
pos
pos 
+= formatex(query_ins[pos], sizeof(query_ins) - pos"INSERT INTO `%s` (`%s`, `%s`, `%s`, `%s`, `%s`, ",BALELOS1BALELOS3BALELOS4BALELOS2BALELOS5BALELOS6)
pos += formatex(query_ins[pos], sizeof(query_ins) - pos"CURRENT_TIMESTAMP, `%s`, `%s`, `%s`, `%s`, `%s`, "BALELOS7BALELOS8BALELOS9BALELOS10BALELOS11)
pos += formatex(query_ins[pos], sizeof(query_ins) - pos"`%s`, `%s`, `%s`)VALUES ('%i', '%s', '%i', ",BALELOS12BALELOS13BALELOS14,value1value12value13)
pos += formatex(query_ins[pos], sizeof(query_ins) - pos"'%i' ,'%i' ,'%s', '%s', '%i', '%i', '%i', '%i', '%i')"value14value15value16value17value18value19value111value122value133
__________________
Impossible is Nothing
Sylwester is offline
marquezs
Member
Join Date: Jun 2010
Old 07-03-2011 , 13:52   Re: Sql query Compiler error
Reply With Quote #3

Thanks! It works now
marquezs is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:46.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode