fetchall to false and queryrecount to true for postgresql

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
ROD
Devart Team
Posts: 23
Joined: Mon 07 May 2012 09:09

Re: fetchall to false and queryrecount to true for postgresq

Post by ROD » Thu 10 May 2012 14:15

Hi, Lao

It works. I cannot reproduce the error.
Please, describe your actions in details (the whole code list) and the scripts for creating tables.

lao
Posts: 71
Joined: Wed 10 Dec 2008 10:56

Re: fetchall to false and queryrecount to true for postgresql

Post by lao » Tue 08 Jan 2013 10:23

happy new year,
i do what Alexp sayd:
constructor TDADataSetOptions.Create(Owner: TCustomDADataSet);
begin
inherited Create;

FOwner := Owner;

SetFieldsReadOnly := True;
RequiredFields := True;
StrictUpdate := True;
TrimFixedChar := True;
LongStrings := True;
FlatBuffers := False;
RemoveOnRefresh := True;
UpdateBatchSize := 1;
QueryRecCount := True;
end;
and :
FDataSetOptions.Add(TBooleanOption.Create('FetchAll', prFetchAll, [TPgSQLRecordSet], FALSE));
and:
....................
TCustomDADataSet(FUpdateQuery).Options.SetEmptyStrToNull := FDataSet.Options.SetEmptyStrToNull;
TCustomDADataSet(FUpdateQuery).Options.FlatBuffers := True;
TCustomDADataSet(FUpdateQuery).Options.QueryRecCount := False; //<-add this line

now i create a project with 2 uniquery and one memo(users enter sql requests in this memo)
the uniquerys havent now defaults specificoptions fetchall=false and queryreccount=true;

the first uniquery just select data in the table and it is open(select * from A).
If in the second uniquery i make a mistake for exemple in table name( select * from Bx) instead of ( select * from B) i receive message'relation Bx does not exists'.
i correct the sql and when open the query i receive the message 'current transaction is aborted, commands ignored until end of transaction block'.

i don't use transaction.

maybe i need to change something more in src for fetchall like isfetchall or nonblocking.
please help me.
thanks

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: fetchall to false and queryrecount to true for postgresql

Post by AlexP » Wed 09 Jan 2013 11:28

Hello,

The specified problem doesn't occur after performing the described steps. Please try to reproduce the problem on the latest UniDAC version 4.6.11

lao
Posts: 71
Joined: Wed 10 Dec 2008 10:56

Re: fetchall to false and queryrecount to true for postgresql

Post by lao » Wed 09 Jan 2013 13:19

Hi,
i try with latest unidac and i have same problem:
1) don't close application after open uniquery with bad table name.
2)don't change fetchall = false in code(it's set by default with changes in src)
because if i do uniquery1.specificoptions['Fetchall']:='False' before opening it, everything is ok.
Regrads

lao
Posts: 71
Joined: Wed 10 Dec 2008 10:56

Re: fetchall to false and queryrecount to true for postgresql

Post by lao » Wed 09 Jan 2013 14:55

hi,
the problem occur only if the first uniquery is open in design time;
Don't close it when the programm is running, and try with the second uniquery
first to select in a bad table name, and second in t a good table name
between the 2 tests don't close programm (use memo to change uniquery2 sql)
I am sorry my english is pour
Regrads

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: fetchall to false and queryrecount to true for postgresql

Post by AlexP » Thu 10 Jan 2013 14:45

Hello,

To make your code work, you should apply your changes before components installation and build UniDAC using the make.bat file locating in the ..\Source\DelphiXX directory, then copy the created bpl to the System32 directory (from the ..\bin\DelphiXX directory), and install from the Components->Install Packages menu (you can read more detailed manual in the ReadMeSrc.html file)

Post Reply