Difficulties With Premature Table.EOF

I have two tables, master and detail. I am using a Parameters-based M/D 
approach. The detail dataset has a where clause that references an 
identically named field in the master dataset. In all other respects 
default values are used for both TFDQuery components except, of course, 
the actual query statements and component names. The code intends to 
process each row in the master and insert a corresponding row in the 
detail. The first key field for the detail dataset is inserted 
automatically by FireDAC:

       while not Master.Eof do
         begin
           Detail.Insert;
           Detail.FieldByName('SecondKey').AsString := '1/1/2000';
           Detail.FieldByName('DataValue').AsBoolean := True;
           Detail.Post;
           Master.Next;
         end;

However, the Master.Eof becomes True after processing 50 records (the 
size of the rowset.)

If I change Detail.Post to Detail.Cancel, all master records are handled 
but obviously no records are inserted into the detail.

If I change the master so that Mode=fmALL is specified (and Detail.Post 
is used) then all master records are processed and all inserts are 
correctly done.

This seems like odd behavior to me. Is there something I don't 
understand in the way I have this set up?
-- 
Milan Vydareny
0
Milan
8/4/2015 4:39:23 PM
embarcadero.delphi.firedac 822 articles. 2 followers. Follow

2 Replies
830 Views

Similar Articles

[PageSpeed] 36

This is probably related to FireDAC auto-commit behavior. So, Post leads to 
auto-commit with corresponding consequences. More details:
http://docwiki.embarcadero.com/RADStudio/XE8/en/Managing_Transactions_%28FireDAC%29#Transactions_and_Cursors

-- 
With best regards,
Dmitry Arefiev / FireDAC Architect
0
Dmitry
8/9/2015 3:46:36 PM
On 8/9/2015 10:46 AM, Dmitry Arefiev wrote:
> This is probably related to FireDAC auto-commit behavior. So, Post leads to
> auto-commit with corresponding consequences. More details:
> http://docwiki.embarcadero.com/RADStudio/XE8/en/Managing_Transactions_%28FireDAC%29#Transactions_and_Cursors
>

Thanks for the reply. I looked into the problems that might be 
associated with transactions but can't discover any resolution. I am 
actually controlling the transactions myself. In my original post I 
omitted the transaction statements. It should have appeared:

        ibConnection.StartTransaction;
        while not Master.Eof do
          begin
            Detail.Insert;
            Detail.FieldByName('SecondKey').AsString := '1/1/2000';
            Detail.FieldByName('DataValue').AsBoolean := True;
            Detail.Post;
            Master.Next;
          end;
        ibConnection.Commit;

I unchecked AutoCommit, AutoStart and AutoStdop (since I handle those 
myself anyway) but that didn't resolve the issue of EOF after the first 
row set.

My workaround of setting Mode to fmALL works so it's not a critical 
issue. Thought you might want to know about it, however.

Best,


-- 
Milan Vydareny
0
Milan
8/13/2015 11:41:06 PM
Reply:

Similar Artilces:

Delphi XE6 FireDAC SQLite copy a table from one database to another
How do I copy a single table from one SQLite database to another? Is there a simple command to do this? Thanks! > How do I copy a single table from one SQLite database to another? Is there a simple command to do this? Thanks! You should use ATTACH command. For example: {code} ATTACH 'c:\secondDB.sdb' AS sec; INSERT INTO SomeTab SELECT * FROM sec.SomeTab; {code} -- With best regards, Dmitry Arefiev / FireDAC Architect Thanks! > {quote:title=Dmitry Arefiev wrote:}{quote} > > How do I copy a single table from one SQLite database to another? Is there a...

FireDac, table not found (wrong table owner) [Edit]
Hello, I am testing an small project with Delphi XE7 and Firedac. My DB system is SQL Anywhere Version 11. I created the DB connection like this: FDConnection1 (with Login Dialog) -> FDQuery1 (SQL: select Titel from DOC where docid = '000000000' -> Datasource1 -> DBEdit1 (for editing Column 'Titel') Connection to DB, selecting, etc. works perfect. But when i try to edit and post the new value, FireDac says 'Table DOC not found'... The Table 'DOC' has the (default) owner named 'olympia'. When i analyze the update statement with FDMonito...

FireDAC and Delphi Pro XE4... firedac tab not visible?
I am moving from a very old Borland product (2006) to Delphi XE4 Professional with FireDAC addon. I purchased both from Embarcadero, and have downloaded both. The documentation says the FireDAC components should automagically appear in the tabset for Delphi. They do not. I don't want to fool around too much as my environment is strictly controlled by IT, and they are very slow to do anything. Is there something that I should have done, but did not do? I installed XE4 first, registered it, then used the link in my email from Embarcadero to download the FireDAC components. Then I ra...

From Table to Table
I am working in Delphi 4 and ran into a roadblock I am unfamiliar with. I am trying to search and find values in one table based off of matching values in another. For example a table of objects with fields like name, description, type, ect; and a table of object properties in which each object can be represented multiple times based on the settings on the page at the time. So if i search the object property table (and eventually loop through to repeat for all objects) to find all cases of visible objects when a certain criteria is met. It stops on the first object with "Yes" in th...

Tables?! Why Tables?!
Bit random...but why does everything have to be rendered as a table?  It's starting to get quite annoying.  Formview - does this need to be a table?  the Menu??  Wouldn't it make sense to allow the option to...say...not render a Menu as a table?  Am I the only one that thinks this or are there others?  www.internetgeeks.co.ukwww.norwichbookclub.co.uk You can use CSS Adapters to create your own adapters to override how the controls render it self. In the next version of ASP.Net, you will probably have more flexibility to specify the surrounding elements of th...

New table in Interbase not listed in Delphi XE2 for table name [Edit]
I created a new Interbase table in IBConsole and entered some data. When I go into Delphi and use a TSQLTABLE and try to enter the table name, the new table does not appear though the other tables do. I thought it might be related to permissions, but the properties of the new table sow permissions are there for SYSDBA, the same as the other tables, and sysdba is the user I connect to Interbase from Delphi as. I also have permissions set for PUBLIC. Also in IBCONSOLE when I click on the Server menu, the submenu included "user security" but it is grayed out, so I do not know ho...

FireDAC issue with EOF
Hello, I am having an issue with EOF on a FireDAC table. Products.First; while not Products.EOF do begin // ... do something here ... Products.Next; end; The application either repeats the last record multiple times or gets stuck in an infinite loop. It appears that either Next isn't moving the cursor or EOF isn't picking up the end of the table. If I use a For loop and Products.RecordCount the loop completes properly every time. There are no events on the Products table and this is happening with other tables in the database as well. Delphi Version X...

FireDac Delphi Xe2
Hello, I have FireDac components installed to Delphi Xe2, My version of FireDac is 8.0.1 but in this version I have probelm with TAdoquery with StrsEmpty2Null param. It doesn't work. Maybe someone know what I have to change in FiredAc source ro remove this issue. I suggest to the FireDAC newgroup. You'll probably get a better response there. Sebastian Kumor wrote: > Hello, > I have FireDac components installed to Delphi Xe2, > My version of FireDac is 8.0.1 but in this version I have probelm with TAdoquery with StrsEmpty2Null param. > It doesn't work. Mayb...

proxy tables with Delphi
This lead to my first question (with an addend): Is anyone using proxy tables *with Delphi*? Thanks (the refresh option really works fine). And the other question is: is there any other difference between proxy tables and "normal" tables? Marcos Chris Twiner <ctwiner@avsoft.co.uk> escreveu nas not�cias de mensagem:30SJpZFp$GA.299@forums.sybase.com... > In the ISQL options there is an automatic refresh option. Turn it off and > you should not get the message, but you will have to rerun the select to see > the change. > > As to the different...

FireDAC for Delphi 2007 ?
Hello, I would like to know if FireDAC Client/Server Pack can be installed on Delphi 2007 pro. Thanks, Regards, Emmanuel Lion FireDAC Client/Server Pack for XE5 - No FireDAC Client/Server Pack for XE4/XE3, see: http://support.embarcadero.com/article/42970 M. E.L. wrote: > Hello, > > I would like to know if FireDAC Client/Server Pack > can be installed on Delphi 2007 pro. > > Thanks, > Regards, > > Emmanuel Lion > On 02.10.2013 18:17, quinn wildman wrote: > FireDAC Client/Server Pack for XE5 - No > FireDAC Client/Server Pack ...

a table component in delphi?
Hi, I working with delphi i would like to knew if there is a table component not to represent a database but to represent a table that contains rows and columns.(like Jtable in java for example) In fact, I have a list of employees that I recover from the database and I wanted to see reflected in the attachment. Thankyou in advance. > {quote:title=boaubdi medi wrote:}{quote} > Hi, > I working with delphi i would like to knew if there is a table component not to represent a database but to represent a table that contains rows and columns.(like Jtable in java for example) >...

FireDac Delphi Xe2
Hello, I have FireDac components installed to Delphi Xe2, My version of FireDac is 8.0.1 but in this version I have probelm with TAdoquery with StrsEmpty2Null param. It doesn't work. Maybe someone know what I have to change in FiredAc source to remove this issue. To set the Param on NULL value before executing the query I do: {code} with qryExample.ParamByName('Example_id') do Begin DataType:=ftInteger; Clear; // Bound := True; End; {code} > {quote:title=Robert Triest wrote:}{quote} > To set the Param on NULL value before executing the query I do: >...

FireDac Delphi Xe2
Hello, I have FireDac components installed to Delphi Xe2, My version of FireDac is 8.0.1 but in this version I have probelm with TAdoquery with StrsEmpty2Null param. It doesn't work. Maybe someone know what I have to change in FiredAc source to remove this issue. To set the Param on NULL value before executing the query I do: {code} with qryExample.ParamByName('Example_id') do Begin DataType:=ftInteger; Clear; // Bound := True; End; {code} > {quote:title=Robert Triest wrote:}{quote} > To set the Param on NULL value before executing the query I do: >...

FireDac Delphi Xe2
Hello, I have FireDac components installed to Delphi Xe2, My version of FireDac is 8.0.1 but in this version I have probelm with TAdoquery with StrsEmpty2Null param. It doesn't work. Maybe someone know what I have to change in FiredAc source ro remove this issue. I suggest to the FireDAC newgroup. You'll probably get a better response there. Sebastian Kumor wrote: > Hello, > I have FireDac components installed to Delphi Xe2, > My version of FireDac is 8.0.1 but in this version I have probelm with TAdoquery with StrsEmpty2Null param. > It doesn't work. Mayb...

Web resources about - Difficulties With Premature Table.EOF - embarcadero.delphi.firedac

Difficulties in Diagnosing Lewy Body Dementia - pt 1 - YouTube
Pt 1. - From the January 2007 "Many Faces of Lewy Body Dementia" series at Coral Springs Medical Center, FL. A presentation by Dr. Jonathan T. ...

ATO's case against Chevron underlines difficulties of tax reform
I wish I could get a list of G20 delegates and send them copies of the documents Chevron and the Australian Tax Office have filed for Chevron&#8217;s ...

The Bachelorette Australia 2015: double date difficulties, Kayne Buik sent home
"Is it awkward" could have been the catch cry of the episode.

Pyke's twist will cause difficulties but Swans' chances won't dive
Pyke's twist will cause difficulties but Swans' chances won't dive

Children with learning difficulties need programs based on science, not anecdote and neurobabble
Parents are understandably drawn to programs promising miracle results for their child with dyslexia, but all programs need to be appropriately ...

Qld minister admits casino 'difficulties'
Queensland's deputy premier admits a Gold Coast casino plan poses major environmental difficulties, and defends proposals for three new gaming ...

Facing difficulties: why people with bipolar disorder don't always see how you feel
People with bipolar disorder often experience amplified emotions, and consequently struggle in their inter-personal relations. They can also ...

Dairy difficulties inspire Tasmania farmer Regan Tucker's country songs
Dark days on his dairy inspire Tasmanian farmer Regan Tucker's original country songs.

BIXI's 'financial difficulties' a concern for Toronto
The company that operates Toronto's public bicycle program is having "financial difficulties" that have been brought to the attention of the ...

How will HK go through economic difficulties in 2012
How will HK go through economic difficulties in 2012 People's Daily Online By Wang Ping ( People's Daily Overseas Edition) The export-oriented ...

Resources last updated: 12/6/2015 6:01:29 AM