Hello!
Has somebody an idea, where i can get an excellent documentation with examples about pg_query, pg_table, tfields and database-programming?
The documentation in delphi2009 is... uggly. No examples and else.
Currently i try -something "easy"- like "to copy one record from Database A, table B to Database B table b with same definition.
This costs much time and is very inefficient. try and error. And drives me crazy. That must be easier to go.
And I am not an beginner!
---
self.PgTable_mts.Append;
// for i := 0 to self.PgTable_mts.Fields.Count - 1 do begin
// if self.PgTable_mts.Fields.FieldName = 'be_seq' then begin
// // self.PgQuery2.SQL.Append('be_seq='+inttostr(sequence));
// end else
// self.PgTable_mts.Fields.Value := self.PgTable_tmp_mts.Fields.Value;
// end; //for
self.PgTable_mts.FieldByName('be_diag').Value := '1';
self.PgTable_mts.Post;
thank you for answering me.
Documentation with examples, reference manual
Yes.
But the greater problem was to FIND out that
was right and
was wrong.
Do you understood my problem?
I need some hint thought the 100 possible methods and properties.
thanks for answering me.
But the greater problem was to FIND out that
Code: Select all
PgTable.ApplyUpdates;
Code: Select all
PgTable.Post
Do you understood my problem?
I need some hint thought the 100 possible methods and properties.
thanks for answering me.
We don't have any tutorial about using data access components. You can find information about using standard components like BDE, ADO or dbExpress in the Internet. PgDAC has the same interface as standard components. So you can use this information when working with PgDAC.
You need to call the Post method anyway. If you have enabled CachedUpdates mode, you need to call ApplyUpdates after you post some records.
You need to call the Post method anyway. If you have enabled CachedUpdates mode, you need to call ApplyUpdates after you post some records.
They key to working with postgresql and inserting a bunch of records from one db to another is to do it like you are doing, but to get speed you need to start a transaction on the database you are inserting into and do a commit like every 1000 records, this will speed it up by a large margin.
By default Postgresql will do a autocommit on each insert you do and this can cause a big performance hit.
You may not be doing the inserts yourself, but the library is doing them for a append. Doing a post or apply updates does not commit the transaction.
By default Postgresql will do a autocommit on each insert you do and this can cause a big performance hit.
You may not be doing the inserts yourself, but the library is doing them for a append. Doing a post or apply updates does not commit the transaction.