I need an example

Forum related to Firebird

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
zettk
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 29.09.2007, 22:43

I need an example

Post 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???
diegocm
Fresh Boarder
Fresh Boarder
Posts: 16
Joined: 22.10.2007, 19:48

Post 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.
User avatar
cipto_kh
Senior Boarder
Senior Boarder
Posts: 83
Joined: 28.09.2005, 11:22
Location: Indonesia
Contact:

Post 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
zettk
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 29.09.2007, 22:43

Post by zettk »

Thanks, i managed ti fixit
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

How???? Just for the others who read this thread when they have a similar problem.
williamhur
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: 20.04.2007, 07:09

Post by williamhur »

It is problem Field Name when create Table.
PLs, rename to Field Name with Upper Case char.
William Hur
Post Reply