How many rows i can insert in SQLite?

Hi everybody!,

Im working with SQLite and i found this problem:

        exitScene Nombre_General

Runtime error

error loading module ‘Data_Base’ from file 'c:\users\qfrhern\document

s\pfg\dropbox\proyecto\on going\Data_Base.lua’:

        …qfrhern\documents\pfg\dropbox\proyecto\on going\Data_Base.

lua:1178: function at line 28

When I exit from one Scene to enter other (Data_Base) for create and insert data in my sqlite Data Base, I have the error in the same line, always, line 1178.

This Scene I use for create data bases, insert data (only SQLite)

I show you the “problematic” line in my code:

1175: local tableexperiencianew  = [[INSERT INTO experiencia VALUES (NULL, 1884850);]]

1176: db:exec ( tableexperiencianew )

1177:

1178: local tableexperiencianew  = [[INSERT INTO exp VALUES (NULL, 1939850);]]

1179: db:exec ( tableexperiencianew )

1180:

I have more lines to inserting data without fails.

What’s the problem?

Is limited the numer of lines to insert data in the data base?

I hope you can help me

Thanks in advance

The error says line 28.

What is there?

Hi,

Only comments:

10: --[[

25: RANGO – Tabla que contiene todos los rangos, con sus insignias y experiancia necesaria para obtenerlo

26:    id: Identificador Unico

27:    Nombre: Nombre del Rango

28:    Img/Insignia: Imagen asociada a este Rango

29:    Experiencia: Experiencia necesaria para tener este Rango

30:

31: ALMACEN  – Tabla donde se almacenaran las armas/usables que tiene el usuario

32:     id: Identificador Unico

32:     Nombre: Nombre del arma/usable

181: --]]

Is this error from the popup dialog box or was it taken from a console log?  If a dialog box, can you look at your console log and grab the messages just before it and afterwards?  If you need to know how to do this, please read:

https://coronalabs.com/blog/2013/07/09/tutorial-basic-debugging/

Thanks

Rob

Hi,

Im developing in Windows and only with Corona SDK.

The error is from “cmd”

I paste you the error with a snapshot

I was working with this file and seems that onlyy can execute a “limited” numer of lines.

The file have 1276 lines.

Im using this file like a scene. The previously Scene hace all the parameters, the “problematic” Scene only create the data base and insert lines. When finish with this process, jump to the next Scene

Your actual error is in the dialog box on the right.  You have more than 200 local variables.   This is a limit of Lua.  Most people would not have individual variables for your inserts like that.  If I read this right you have what is the equivalent of: 

local tableexperiencianew = “some string”

local tableexperiencianew = “some string”

local tableexperiencianew = “some string”

local tableexperiencianew = “some string”

local tableexperiencianew = “some string”

Because the word local is in front of each of these, they count as unqiue variables.  If you did this:

local tableexperiencianew = “some string”

tableexperiencianew = “some string”

tableexperiencianew = “some string”

tableexperiencianew = “some string”

tableexperiencianew = “some string”

Then you are only using one variable, just giving it different contents each time.   But this could be abstracted even more:

db:exec( [[INSERT INTO experiencia VALUES (NULL, 1884850);]] )

db:exec( [[INSERT INTO exp VALUES (NULL, 1939850);]] )

would accomplish the same thing.   Another option is to store all your data in a table:

local tableexperienceianew = {

[[INSERT INTO experiencia VALUES (NULL, 1884850);]],

[[INSERT INTO exp VALUES (NULL, 1939850);]],

}

for i = 1, #tableexperienceianew do

     db:exec( tableexperienceianew[i] )

end

Rob

Thanks Rob.

Tomorrow I will try the “table method”

Thanks a lot for your help!!

The error says line 28.

What is there?

Hi,

Only comments:

10: --[[

25: RANGO – Tabla que contiene todos los rangos, con sus insignias y experiancia necesaria para obtenerlo

26:    id: Identificador Unico

27:    Nombre: Nombre del Rango

28:    Img/Insignia: Imagen asociada a este Rango

29:    Experiencia: Experiencia necesaria para tener este Rango

30:

31: ALMACEN  – Tabla donde se almacenaran las armas/usables que tiene el usuario

32:     id: Identificador Unico

32:     Nombre: Nombre del arma/usable

181: --]]

Is this error from the popup dialog box or was it taken from a console log?  If a dialog box, can you look at your console log and grab the messages just before it and afterwards?  If you need to know how to do this, please read:

https://coronalabs.com/blog/2013/07/09/tutorial-basic-debugging/

Thanks

Rob

Hi,

Im developing in Windows and only with Corona SDK.

The error is from “cmd”

I paste you the error with a snapshot

I was working with this file and seems that onlyy can execute a “limited” numer of lines.

The file have 1276 lines.

Im using this file like a scene. The previously Scene hace all the parameters, the “problematic” Scene only create the data base and insert lines. When finish with this process, jump to the next Scene

Your actual error is in the dialog box on the right.  You have more than 200 local variables.   This is a limit of Lua.  Most people would not have individual variables for your inserts like that.  If I read this right you have what is the equivalent of: 

local tableexperiencianew = “some string”

local tableexperiencianew = “some string”

local tableexperiencianew = “some string”

local tableexperiencianew = “some string”

local tableexperiencianew = “some string”

Because the word local is in front of each of these, they count as unqiue variables.  If you did this:

local tableexperiencianew = “some string”

tableexperiencianew = “some string”

tableexperiencianew = “some string”

tableexperiencianew = “some string”

tableexperiencianew = “some string”

Then you are only using one variable, just giving it different contents each time.   But this could be abstracted even more:

db:exec( [[INSERT INTO experiencia VALUES (NULL, 1884850);]] )

db:exec( [[INSERT INTO exp VALUES (NULL, 1939850);]] )

would accomplish the same thing.   Another option is to store all your data in a table:

local tableexperienceianew = {

[[INSERT INTO experiencia VALUES (NULL, 1884850);]],

[[INSERT INTO exp VALUES (NULL, 1939850);]],

}

for i = 1, #tableexperienceianew do

     db:exec( tableexperienceianew[i] )

end

Rob

Thanks Rob.

Tomorrow I will try the “table method”

Thanks a lot for your help!!