Page 1 of 1

Specifying key fields in WHERE clause of UPDATE query ?

Posted: 12.06.2006, 21:20
by thixp
Hi, sorry for this repeated post. I know this issue has already been discussed in http://zeos.firmos.at/viewtopic.php?t=504, but no solution has been found on that topic.

Here is the deal... I am using ADO/ODBC to connect to a Pervasive database, and being a deprecated database, it has no concepts of "primary key" or "null values". So, the resolver always puts every single column of the table in the where clause.

I am trying to update values in a table with Float fields, and they always appear in the where clause, causing incorret value comparision in the database... I also noticed that some empty valued strings are treated as nulls, what makes the desirable row unable to be found with the where clause.

So, it looks like I'm in big trouble... that's why I'm here to ask for any suggestion that would solve this issue, or maybe even where whithin Zeos source code I could access the ProviderFlags property of the TFields so I could manually create the correct where clause.

Thank you in advance, and sorry for any english mistakes.

Posted: 12.06.2006, 22:19
by mdaems
Hi,

Have you tried using ZUpdateSql components to manuallywritethe update statements? For documentation I adviseyouto usethe Delphi Docs for BDE UpdateSql component. I think that should be very similar.

Mark

Posted: 12.06.2006, 22:23
by kmr
Hi there,

just assume your Query/Table is not writable and use TZUpdateSQL
Look here for example

Posted: 12.06.2006, 22:32
by thixp
Actually, I have a 16 form delphi project to maintain data from about 30 tables. Not all of then are behaving like this, but my question is:

Will I have to use TZUpdateSQL for every single TZQuery in every form of the project? Isn't there a way to make things easier?

anyway, thanks, I'll implement that as a temporary solution.

Posted: 12.06.2006, 22:55
by kmr
No, I don't think you have to use TZUpdateSQL for every table, just for the ones that behave like that.

Which version of Pervasive do you use?
And what do you mean by "it has no concepts of primary key"?
Even the ancestor of Pervasive - "Btrieve" - did have primary key concepts.
Maybe the primary key is just not working with ADO/ODBC?
Could you post your Create Table Statement for that problematic table - so I could look at it and try to solve the prob.

For further Pervasive Docs look here

Posted: 13.06.2006, 00:19
by thixp
I read the pervasive documentation now.

Some tables are freshly created in the system, and may include the primary key clause on the create table statement... so, some part of the problem is solved this way.

But I have some tables, that are shared with a Btrieve/Novell software running on MS-Dos and cannot be re-created. To read these tables, we have created DDF files according to the .INC files of the MS-Dos Advanced Basic (QBX) software.

This reduces my problematic tables to something around four or five tables, won't be too much trouble at all to use ZSqlUpdate in all of these ones.

thank you for the support.

Posted: 13.06.2006, 07:36
by chrisv5
Is there any reason why you are not using PDAC (Pervasive Data Access Components)?

Posted: 13.06.2006, 19:38
by zippo
How do you update the values - can you post any code here?