Problem using TZQuery.Append
Posted: 17.09.2008, 10:05
Hello,
I ran into a problem when trying to do bulk insert using TZQuery.Append/Post.
Here's an excerpt of my code in case I forgot something :
The problem occurs with Query.Post. I traced it to ZGenericCachedResolver.PostUpdates. SQL before FillStatement seems Ok (table name found, all fields recognized), FillStatement seems to fetch data just fine, but the SQL query used in ExecuteUpdatePrepared is wrong ("INSERT INTO table VALUES (?,?,?,?...);"). I have this problem with (at least) Firebird and Oracle using Zeos-6.6.3-stable.
I think the code above should be ok, but feel free to correct me I if forgot something. I'm not really familiar with the Zeos ; do you have any advice where to look to debug it further ?
I ran into a problem when trying to do bulk insert using TZQuery.Append/Post.
Here's an excerpt of my code in case I forgot something :
Code: Select all
Query := TZQuery.Create(nil);
Query.Connection := Connection;
Query.SQL.Text := 'select * from '+TableName+' where 0=1';
Query.Open;
Query.Append;
Query.Fields[0].Value := Par.Id;
Query.Fields[1].Value := Par.Val;
Query.Post;
Query.Free;
I think the code above should be ok, but feel free to correct me I if forgot something. I'm not really familiar with the Zeos ; do you have any advice where to look to debug it further ?