Subject Re: [firebird-support] Insert or append record
Author Helen Borrie
At 08:20 PM 28/10/2004 +0200, you wrote:

>sorry if this not not the right place for this question...

It's not, so you will need to take any further IBX questions to the Borland

>Using IBX components I can use Append or Insert method of TIBDataSet
>component to add a record to table.
>If I don't use order by at select statement, using Append, each record
>appended is at the end of records of one table. If I use Insert method,
>newly inserted record could be somewhere in between records, when I execute
>select statement.
>Just for my knowledge, is there realy any difference in physical location of
>new record, if it is Inserted or Appended ?

No. Firebird has no notion of "record ordering" in tables, other than an
absolute physical address (named RDB$DB_KEY) that it uses internally to
locate and relocate records.

>In which side stands sql INSERT statement?

INSERT is an SQL language token. It stands on the client side as part of
the syntax convention recognised by the server as a request to add a record
to a table.

>Could it be compared to Insert method of DataSet ?


The Insert method of a client-side dataset is part of the application
layer. It doesn't do anything on the server. The first "knowledge" that
the server has of the client request is when your application layer calls
its Post method. If Post is successful, the new record is written to the
disk but is not visible to any other transactions.

The new record becomes visible to other transactions after the application
successfully commits the transactiion in which the INSERT statement was

>Which mechanism is used with Append and Insert record ? Is this internaly
>made with sql language ?

No. Firebird's SQL has no concept of "Append". Append is entirely a
method of the application layer.