[Gambas-user] FIELDS LIMIT?

Ron Onstenk ronstk at ...239...
Fri Jan 25 08:43:23 CET 2008


On Friday 25 January 2008 06:12, Nx GT-R BOY wrote:
> FIELDS LIMIT?
> (by the way, how do I send code?, just attach it to this mail?)
> 
> Hi, I am having troubles with a table, my table has 54 fields (53 INT and 1
> YEAR), I am trying just to write to it values like 1,2,3,4,5... to each
> field, theres no manual-code, just a form, drag a datasource, databrowser
> and datacontrols, the reason I need that amount of fields is because I am
> going to manage a value per week, so, I need a lot of space.
> 
> Thinking about there was a lot of data to write, I delete every datacontrol,
> and just try to write the first INT and the YEAR, but that "brick" my table,
> and I wasn't able to read that table again (from my program, because from
> console works perfect), every time I tried to open the form that calls that
> table, the program crash saying I have an error at my SQL query near: 'FROM
> weeks LIMIT 64' at line 1. (to solve that, I drooped the database and create
> it again, then everything goes ok, until I try to write it again, then comes
> the same story)
> 
> I have not idea why the "64", I check the local variables and notice iLimit
> is 64, and my NULL variables are: aVal, rData, $aCol, $rData.
> 
> The stack backtrace says;
> DataTable.LoadUnit.77
> DataTable._get.127
> (native code)
> DataView.GridView_Data.187
> 
> My table structure is this:
> CREATE TABLE asistencia (
> empleados_numero INTEGER UNSIGNED NOT NULL,
> semana1 INTEGER UNSIGNED NULL DEFAULT '0',
> semana2 INTEGER UNSIGNED NULL DEFAULT '0',
> semana3 INTEGER UNSIGNED NULL DEFAULT '0',

----8<----

> semana51 INTEGER UNSIGNED NULL DEFAULT '0',
> semana52 INTEGER UNSIGNED NULL DEFAULT '0',
> periodo YEAR NULL,
> INDEX asistencia_FKIndex1(empleados_numero),
> FOREIGN KEY(empleados_numero)
> REFERENCES empleados(numero)
> ON DELETE NO ACTION
> ON UPDATE NO ACTION
> );
> 
> 

Be carefull with the fieldnames. Once in time you want to sort the fieldnames.
Use 2 digit numbers for the first 9 weeks as 01,02 etc
I had lot of trouble because I got such declared table in the past.
(sorting those names are done for alfabet and not nummeric)

Ron




More information about the User mailing list