Page 1 of 1

I need an example

Posted: 29.09.2007, 22:54
by zettk
HI to all, i'm starting with Zeos and i cant insert into a database using a Zquery component, i used this code:

Code: Select all

With ZQuery1 do Begin
      Sql.Clear;
      Sql.Add('INSERT INTO CLIENTES (nombre, apellido) VALUES (:val1, :val2)');
      ZQuery1.ParamByName('val1').AsString:='xxxxx';
      ZQuery1.ParamByName('val2').AsString:='yyyyy';
      ExecSql;
   End;
the table name is CLIENTES and have 3 fiels:
id: primary key and autoincrement
nombre: char 20
apellido: char 20

the error i get says column unknown NOMBRE

can someone tellme whats wrong???

Posted: 23.10.2007, 14:05
by diegocm
Seemingly is correct. Case wants, send me a mail with your example and database that I see for you.

mail: diegomaciel@diretriz.net


Diego.

Posted: 25.10.2007, 09:44
by cipto_kh
What database you use?

Usually that error mean that column (NOMBRE) is not exists, please be carefull for some database like Firebird that can have case sensitive name by using "..." (surrounded that field with double quote). It depends on when you create that table

Posted: 06.11.2007, 22:52
by zettk
Thanks, i managed ti fixit

Posted: 07.11.2007, 08:44
by mdaems
How???? Just for the others who read this thread when they have a similar problem.

Posted: 09.11.2007, 10:54
by williamhur
It is problem Field Name when create Table.
PLs, rename to Field Name with Upper Case char.