Subject | Re: [IBO] Optimize updating of large database |
---|---|
Author | Lucas Franzen |
Post date | 2001-07-19T15:12:48Z |
Johan Kotze schrieb:
Set the param, open the query.
If it is empty (Qry.IsEmpty) INSERT, if not EDIT it.
I think you should do this with all tables, be it some records or
millions...
(this is way I do always make a difference between browsing queries (not
updatable) and insertable/editible ones and keep the inserting apart
from the browsing (ie you can browse the table and when doing an
INSERT/EDIT I'll call a seperate form. Thus you can also restirct
yourself in the sql of the browse query to the really necessay fields
and don't have to do a SELECT * there; if you want to see the detailed
info of the current record you could also the dataform for just showing
the record in total).
Luc.
Luc.
>SELECT * FROM TABLE WHERE ID_FIELD = :VALUE
> I have a database of 1 million+ entries and I am looking for the
> quickest way of retrieving a record (specified by a unique key
> value), change a field in the record (not the key field) and
> applying the change to the database. To complicate matters, if the
> key does not exist, a new record needs to be added to the database.
> I am currently using a TIB_Query component and using TIB_Query.Lookup
> to find the record, put the record in edit mode and executing post. I
> was thinking along the lines of a stored proc, but how do you
> accomplish this in a stored proc.
>
> Any ideas will be much appreciated.
>
> Johan Kotze
Set the param, open the query.
If it is empty (Qry.IsEmpty) INSERT, if not EDIT it.
I think you should do this with all tables, be it some records or
millions...
(this is way I do always make a difference between browsing queries (not
updatable) and insertable/editible ones and keep the inserting apart
from the browsing (ie you can browse the table and when doing an
INSERT/EDIT I'll call a seperate form. Thus you can also restirct
yourself in the sql of the browse query to the really necessay fields
and don't have to do a SELECT * there; if you want to see the detailed
info of the current record you could also the dataform for just showing
the record in total).
Luc.
Luc.