Re: After updating dataset the record goes to the end of the dataset

From: "Gurjeet Singh" <singh(dot)gurjeet(at)gmail(dot)com>
To: "Nacef LABIDI" <nacef(dot)l(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: After updating dataset the record goes to the end of the dataset
Date: 2008-04-22 10:12:37
Message-ID: 65937bea0804220312s2e873084n4741fa8e1cc3e26b@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Tue, Apr 22, 2008 at 3:24 PM, Nacef LABIDI <nacef(dot)l(at)gmail(dot)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[(dot)singh](at)EnterpriseDB(dot)com
singh(dot)gurjeet(at){ gmail | hotmail | indiatimes | yahoo }.com

EnterpriseDB http://www.enterprisedb.com

Mail sent from my BlackLaptop device

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message hubert depesz lubaczewski 2008-04-22 10:15:23 Re: After updating dataset the record goes to the end of the dataset
Previous Message Thomas Kellerer 2008-04-22 10:11:42 Re: After updating dataset the record goes to the end of the dataset