[Gambas-user] FIELDS LIMIT?
Che
cheguebeara at ...626...
Fri Jan 25 16:30:21 CET 2008
Wouldn't it be easier to just add a single Julian Date field and then
have your sql bring it back with filtering by 7's?
That would eliminate a lot of extra fields and allow you to modify your
reporting period down the road (single day, 7 day, fortnight, 30 day,
etc etc).
My experience in the past has been if you cut down on the number of
fields and let program bring back the data algorithmically you end up
with a way more efficient program...
My 2 cents worth...
Mark
On Fri, 2008-01-25 at 14:24 +0100, Benoit Minisini wrote:
> On vendredi 25 janvier 2008, 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',
> > semana4 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana5 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana6 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana7 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana8 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana9 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana10 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana11 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana12 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana13 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana14 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana15 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana16 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana17 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana18 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana19 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana20 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana21 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana22 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana23 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana24 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana25 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana26 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana27 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana28 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana29 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana30 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana31 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana32 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana33 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana34 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana35 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana36 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana37 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana38 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana39 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana40 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana41 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana42 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana43 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana44 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana45 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana46 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana47 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana48 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana49 INTEGER UNSIGNED NULL DEFAULT '0',
> > semana50 INTEGER UNSIGNED NULL DEFAULT '0',
> > 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
> > );
>
> 1) Don't write your mail subjects in upper case. I am maniac.
>
> 2) Please tell which database backend you use.
>
> 3) At the startup of your program, do a 'DB.Debug = TRUE'. This way, all
> requests sent to the database driver are written to the console. Copy the
> output and send it me.
>
> 4) Some years have more then 52 weeks!
>
> Regards,
>
More information about the User
mailing list