[Gambas-user] Re(x3): fields limit? (primary key)

Nx GT-R BOY nxgtrturbo at ...626...
Fri Jan 25 19:52:45 CET 2008


>It seems that this sql statement is incorrect. There should be something
>between SELECT and FROM, shouldn't it?

Yes, of course, there's a problem at SELECT <nothing here> FROM asistencia
LIMIT 64.  (Any known reason?)

>Did you add a primary key to your table? This is mandatory in most part of
the
>Gambas database things.

Yes, of course, I have added a primary key (I designed everything with
DBDesigner4.x, that helps a lot), but the primary key is FOREIGN

My table structure is:
CREATE TABLE asistencia (
empleados_numero INTEGER UNSIGNED NOT NULL,
semana1 INTEGER UNSIGNED NULL DEFAULT '0',
... <same here….. from 2 to 51>

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
);

But thinking about the primary key, this is the only problem (this kind)  I
have had, and this is the only table that hasn't (own) primary key (only a
foreign one)

But technically speaking is there something wrong with a table with only
foreign key?

Must I add "something" just to have a (not foreign) primary key? (Should
try, I loose nothing)

By the way, a (own) primary key is mandatory IN MOST PARTS or IN ALL PARTS?

Really, thanks a lot.
-- 
Nx GT-R



More information about the User mailing list