PostgreSQL : Can not update this query type

The alpha/beta tester's forum for ZeosLib 7.0.x series

Report problems concerning our Delphi 2009+ version and new Zeoslib 7.0 features here.

This is a forum that will be removed once the 7.X version goes into stable!!

Moderators: gto, EgonHugeist, olehs

WorldWalker
Junior Boarder
Junior Boarder
Posts: 25
Joined: 10.10.2009, 18:57

PostgreSQL : Can not update this query type

Postby WorldWalker » 22.12.2012, 10:46

Hi all,
First of all I'd like to thank for your nice work.
I am using a Run Time Fields control creation from TZQuery+TDatasource both created at design time.
e.g.: I create a TDBEdit for every character varying field retrieved from the metadata.
I'm receiving the 'Can not update this query type' when I try to post after editing a record.
I found in ZeosDBO Change Notes that its a random bug with PostgreSQL and it seems it was fixed since 6.5.
I'm using Lazarus 1.0.2,Postgres 8.4.1, Zeos 7.0.1
Thanks

User avatar
EgonHugeist
Zeos Dev Team
Zeos Dev Team
Posts: 1701
Joined: 31.03.2011, 22:38

Postby EgonHugeist » 22.12.2012, 11:34

WorldWalker,

this error happens if the table name can't be determined:

Code: Select all

function TZGenericCachedResolver.DefineTableName: string;
var
  I: Integer;
  Temp: string;
begin
  Result := '';
  for I := 1 to Metadata.GetColumnCount do
  begin
    Temp := ComposeFullTableName(Metadata.GetCatalogName(I),
      Metadata.GetSchemaName(I), Metadata.GetTableName(I));
    if (Result = '') and (Temp <> '') then
      Result := Temp
    else if (Result <> '') and (Temp <> '') and (Temp <> Result) then
      raise EZSQLException.Create(SCanNotUpdateComplexQuery);
  end;
  if Result = '' then
    raise EZSQLException.Create(SCanNotUpdateThisQueryType);
end;


can you give me an example, please?

You can also use the TZUpdateSQL Component to handle complex queryies like joins over several tables..
King regards, Michael

You want to help? viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image

WorldWalker
Junior Boarder
Junior Boarder
Posts: 25
Joined: 10.10.2009, 18:57

Postby WorldWalker » 22.12.2012, 11:59

EgonHugeist,
Thank you very much for your quick reply and your support, as you said the error is related to the missed table name and raised within
TZGenericCachedResolver.DefineTableName
TZAbstractDataset.InternalUpdate
Anyway TZUpdateSQL solves the problem, despite the query is a simple SELECT * FROM foo.
If I you want me to debug further more, or If you want a simple project with a create script please let me know, I'll try to do it asap.
Special thanks.

User avatar
EgonHugeist
Zeos Dev Team
Zeos Dev Team
Posts: 1701
Joined: 31.03.2011, 22:38

Postby EgonHugeist » 22.12.2012, 12:08

WorldWalker,

no problem. I try to support where i can.

It would be very nice if you can attach a simple template app, which points me to this issue. Each closed leak is a good leak (((:

Thanks in advance.
King regards, Michael

You want to help? viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image

WorldWalker
Junior Boarder
Junior Boarder
Posts: 25
Joined: 10.10.2009, 18:57

Postby WorldWalker » 28.12.2012, 08:48

Hello,
Well I found some difficulties to give the step by step guide to reproduce the bug, as it's a part of complexe code and I didn't found the easiest way to extract the methode as it's a part of many different units, and while doing that I found that the problem only occurs on Windows plateform (vista32) but disappears on Linux (Mint32). Could this be a Lazarus dependent plateform bug?
Tested with Postgres 8 and 9.
Thanks

User avatar
EgonHugeist
Zeos Dev Team
Zeos Dev Team
Posts: 1701
Joined: 31.03.2011, 22:38

Postby EgonHugeist » 29.12.2012, 12:52

WorldWalker,

Could this be a Lazarus dependent plateform bug?


We had such spezial issues previously. It might be possible but without more informations i can't say your suggestion is right or wrong. *Nix systems are UTF8-Based and Windows isn't. Is it posible your selected table uses some spezial chars?

Anyway thanks for the hint to a plattform spezial issue.
King regards, Michael

You want to help? viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image

WorldWalker
Junior Boarder
Junior Boarder
Posts: 25
Joined: 10.10.2009, 18:57

Postby WorldWalker » 06.01.2013, 09:10

Hello,
No, there is no special chars in the table.
MFG

User avatar
EgonHugeist
Zeos Dev Team
Zeos Dev Team
Posts: 1701
Joined: 31.03.2011, 22:38

Postby EgonHugeist » 08.01.2013, 22:22

WorldWalker,

well that's frustrating. Like you wrote it seems to be a random issue. Did you think about a little demo application? If i can see an issue then i hope i can help..
King regards, Michael

You want to help? viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image


Return to “ZeosLib 7.0 Beta Forum”

Who is online

Users browsing this forum: No registered users and 1 guest