Click to See Complete Forum and Search --> : Sql Insert Into


kizildag
September 28th, 2005, 05:34 PM
Hi,

i m trying to insert datas into a table with SQL.

TQuery *InsertQuery;
InsertQuery= new TQuery (this);

InsertQuery->DatabaseName = "TEMP";
InsertQuery->SQL->Add ("INSERT INTO [dbo].["+tname+"] (openvalue,closevalue,high,low,average) VALUES ("+FloatToStr(open)+","+FloatToStr(close)+","+FloatToStr(highestarr,ffFixed,18,8)+","+FloatToStr(lowest)+","+FloatToStr(average)+")");
InsertQuery->ExecSQL();

Number of columns and their data types are same but it gives error message ( there are fewer columns in the INSERT statement than values specified in the VALUES clause )

please help me




there are fewer columns in the INSERT statement than values specified in the VALUES clause

olivthill
September 29th, 2005, 04:56 PM
Maybe, in your system, the decimal point is a comma, and you'll get things like
...VALUES (100, 200, 300, 400, 500, 3,14)
instead of
...VALUES (100, 200, 300, 400, 500, 3.14)

Siddhartha
September 30th, 2005, 04:12 AM
[ redirected ]

Regards,
Siddhartha