Re: After updating dataset the record goes to the end of the dataset - Mailing list pgsql-sql

From Gurjeet Singh
Subject Re: After updating dataset the record goes to the end of the dataset
Date
Msg-id 65937bea0804220312s2e873084n4741fa8e1cc3e26b@mail.gmail.com
Whole thread Raw
In response to After updating dataset the record goes to the end of the dataset  ("Nacef LABIDI" <nacef.l@gmail.com>)
List pgsql-sql
On Tue, Apr 22, 2008 at 3:24 PM, Nacef LABIDI <nacef.l@gmail.com> wrote:
Hi all,

I am using Postgres in a Delphi application through ODBC. I am having an issue with updating records.

When I create a dataset to get the records in a table then after I update one of these records and then refresh the dataset, the record goes to the end of the dataset. This is disappointing when editing records on a DBGrid, where users find their updated records jump to the end of the grid. Even after restarting the application, the updated record keeps showing at the end of the grid. I have tried the same thing with SQL Server and it works normally, so I thought it was a postgres behvior.

Has anyone an idea about what could be the cause of such a behavior.

The data is not guaranteed to be ordered if you do not specify an ORDER BY clause in your query. Try adding a meaningful ORDER BY clause, that should solve the problem.

HTH,

Best regards,
--
gurjeet[.singh]@EnterpriseDB.com
singh.gurjeet@{ gmail | hotmail | indiatimes | yahoo }.com

EnterpriseDB http://www.enterprisedb.com

Mail sent from my BlackLaptop device

pgsql-sql by date:

Previous
From: Thomas Kellerer
Date:
Subject: Re: After updating dataset the record goes to the end of the dataset
Next
From: hubert depesz lubaczewski
Date:
Subject: Re: After updating dataset the record goes to the end of the dataset