Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

REG Select on AFRU table

Former Member
0 Likes
562

Hi All,

while fetching data from AFRU table with select query , Normally for most of the orders Data fetched is in Ascending order of order No and Operation No.But in Some cases it not happening . I want to know Why in some cases its not happening.

Regards,

PradeepM.

Hi All,

while fetching data from AFRU table with select query , Normally for most of the orders Data fetched is in Ascending order of order No and Operation No.But in Some cases it not happening . I want to know Why in some cases its not happening.

Regards,

PradeepM.

2 REPLIES 2
Read only

ThomasZloch
Active Contributor
0 Likes
514

Don't rely on any fixed order when reading data from a relational database. If your process requires a fixed order, you need to ensure it by using the ORDER BY option of the SELECT statement or by sorting the data inside internal tables.

As for the "why", I assume a potential reason is the chronological sequence in which the records are inserted into the DB.

Thomas

Read only

AbhishekV
Explorer
0 Likes
514

Hi Pradeep,

Avoid using 'order by' as it would degrade the performance.

Instead take data into internal table and then you can sort according to the desired fields.

<begging removed by moderator>

Edited by: Thomas Zloch on Jan 17, 2012