Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ORDER BY w/ DataBlock Wizard?

Status
Not open for further replies.

kthompsn

Programmer
Feb 28, 2002
18
US
In FORMS, using a DataBlock Wizard to create block for tabular form. There is an 'ORDER BY' clause specified in the property pallette for the block; seems to be ignored. How do we do a sort in this case, pls?
 
Order By is applied to rows queried into a base table block. How do you feel this property ignored in your case?

[sup]Beware of false knowledge; it is more dangerous than ignorance.[/sup][sup] ~George Bernard Shaw[/sup]
Consultant/Custom Forms & PL/SQL - Oracle 8.1.7 - Windows 2000
 
The data on the form was not in sequence by the columns specified in the ORDER BY clause. In fact, it was in the order of appearance in the table from which it was extracted.
tke

 
Do you have a trigger that modifies the ORDER BY block property? Perhaps a PRE-QUERY?

[sup]Beware of false knowledge; it is more dangerous than ignorance.[/sup][sup] ~George Bernard Shaw[/sup]
Consultant/Custom Forms & PL/SQL - Oracle 8.1.7 - Windows 2000
 
Will check that.
Will also try specifying a different column in the ORDER BY, just to make sure that this is NOT just a perception problem.


Ken Thompson, Programmer & Mainframe Dinosaur
 
You could also try messaging out the :SYSTEM.LAST_QUERY in a post-select trigger to see exactly what the form is querying.
 
Kthompsn,
are you trying to sort ROWS or COLUMNS??
Apparently only the first is managed by ORDER BY clause.
The order of items is managed by the order in wich you've chosen items to display in New Block wizard or later by draggin items in Navigator tree.

BTW, are you familiar with SQL?

Regards, Dima
 
Greetings, Dima
We are (trying to) sort rows.

Am in the process of learning SQL, PL/SQL, Oracle FORMS & REPORTS. Massive learning curve.


Ken Thompson, Programmer & Mainframe Dinosaur
 
Do you still get your data unsorted?

Regards, Dima
 
Yes, data still unsorted. FWIW, columns in the original ORDER BY clause are 'calculated' rather than 'selected'; however, have tried specifying 'selected' columns in the ORDER BY, with no visible effect. At what point in time is the data actually sorted -- when the data is selected into IO_TABLE in the procedure, or when it is passed to the form for display?

Ken Thompson, Programmer & Mainframe Dinosaur
 
In Forms if the default orderby clause is set with a column, it takes precedence in the ordering the rows show in a datablock. The column must be present in the datablock for you order by its value. Hope its clear.

Suppose there is column expdate in a table expenses, you need to select this expdate also while forming the data block to sort it by exp_date.

Also check whether you are using execute_query or select statement to fetch records. If you are using a select statement with orderby clause then the select statement's order by or where clause will override the default value.

Hope it helps!
 
What is IO_TABLE ??? Is that block a CONTROL or DATABASE one? If you populate control block manually, ORDER BY has obviously no effect.

Regards, Dima
 
When an EXECUTE_QUERY is performed on a base table block the rows are returned sorted as specified in the ORDER BY clause. I suspect the calculated fields are null when the query is executed and not valued until forms fires it's POST-QUERY trigger. Try putting the calculation in the ORDER BY clause if possible.

[sup]Beware of false knowledge; it is more dangerous than ignorance.[/sup][sup] ~George Bernard Shaw[/sup]
Consultant/Custom Forms & PL/SQL - Oracle 8.1.7 - Windows 2000
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top