Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Sql > Re: After updat...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 12 Topic 3425 of 3717
Post > Topic >>

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

by spam_eater@[EMAIL PROTECTED] (Thomas Kellerer) Apr 22, 2008 at 12:11 PM

Nacef LABIDI, 22.04.2008 11:54:
> 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.

Rows in a relational database are not sorted. This is true for any RDBMS.

If you want to apply a certain sort order you *have* to use an ORDER BY
clause for your SELECT. 
If the rows show up in the order you "expect" without an ORDER BY this is
pure coincidence (even with SQL Server)

The simply solution is to add an ORDER BY that sorts e.g. by a timestamp
that is set when the row is created.

Regards
Thomas


-- 
Sent via pgsql-sql mailing list (pgsql-sql@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
 




 12 Posts in Topic:
After updating dataset the record goes to the end of the dataset
nacef.l@[EMAIL PROTECTED]  2008-04-22 11:54:26 
Re: After updating dataset the record goes to the end of the dat
nacef.l@[EMAIL PROTECTED]  2008-04-22 12:10:41 
Re: After updating dataset the record goes to the end of the dat
depesz@[EMAIL PROTECTED]   2008-04-22 12:15:23 
Re: After updating dataset the record goes to the end of the
craig@[EMAIL PROTECTED]   2008-04-22 20:46:30 
Re: After updating dataset the record goes to the end of the dat
spam_eater@[EMAIL PROTECT  2008-04-22 12:11:42 
Re: After updating dataset the record goes to the end of the dat
singh.gurjeet@[EMAIL PROT  2008-04-22 15:42:37 
Re: After updating dataset the record goes to the end of the dat
nacef.l@[EMAIL PROTECTED]  2008-04-22 12:31:54 
Re: After updating dataset the record goes to the end of the dat
depesz@[EMAIL PROTECTED]   2008-04-22 13:02:14 
Re: After updating dataset the record goes to the end of the
padam.singh@[EMAIL PROTEC  2008-04-22 16:32:57 
Re: After updating dataset the record goes to the end of the dat
pavan.deolasee@[EMAIL PRO  2008-04-22 16:15:10 
Re: After updating dataset the record goes to the end of thedata
nacef.l@[EMAIL PROTECTED]  2008-04-22 15:00:21 
Re: After updating dataset the record goes to the end of thedata
scott.marlowe@[EMAIL PROT  2008-04-22 09:16:44 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Oct 12 21:04:13 CDT 2008.