MySQL Forums
Forum List  »  Delphi

Problem with insert statement in Delphi
Posted by: Tomasz Kręciński
Date: March 28, 2006 03:06AM

Hi,
I have downloaded odbc driver 3.51 v, installed it and configure in Control Panel/Administrative Tools/Odbc Source.
I have successfully connected in delphi through ADO and the problem is with SQL - insert - statement.

I have a field: 'Percent' float NOT NULL.

These lines, I use to insert data:

adoMySQL.sql.clear;
adoMySQL.sql.add ('insert into sth values(:p1, :p2, :p3, :p4, :p5 ); ');

Parameters from p1 to p4 ....
adoMySQL.Parameters.ParamByName ('p5').Value := 4.5;
adoMySQL.ExecSQL;

it fails on last one (real type Field) with error:
Data truncated for column 'Percent' on line 1 ...
However if i try to execute this sql straight in my Mysql Manager program
it works good ....


Please help, what is wrong ??

Thank you for any help

Options: ReplyQuote


Subject
Written By
Posted
Problem with insert statement in Delphi
March 28, 2006 03:06AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.