Home » SQL & PL/SQL » SQL & PL/SQL » why order by is not wroking in pl/sql or form. (oracle-8i, form-6i)
why order by is not wroking in pl/sql or form. [message #312743] Wed, 09 April 2008 12:47 Go to next message
gajendra
Messages: 8
Registered: April 2008
Location: INDORE
Junior Member

hi all,


order by is not work in pl/sql and forms.why?

can anyone give the code for this?

i insert record from another table and it must be insert into ascending order.
Re: why order by is not wroking in pl/sql or form. [message #312745 is a reply to message #312743] Wed, 09 April 2008 12:49 Go to previous messageGo to next message
joy_division
Messages: 4640
Registered: February 2005
Location: East Coast USA
Senior Member
Makes no sense.
You INSERT data into a table. You SELECT data from a table, giving an ORDER BY clause if you would like to see it in a particular order.
There is no such thing a INSERT with an ORDER BY clause.
Re: why order by is not wroking in pl/sql or form. [message #312746 is a reply to message #312743] Wed, 09 April 2008 12:50 Go to previous messageGo to next message
BlackSwan
Messages: 25037
Registered: January 2009
Location: SoCal
Senior Member
>i insert record from another table and it must be insert into ascending order.
NONSENSE!

You have a basket of colored balls & you toss in a new ball.
How do you decide the proper order for the new ball?

A table is a collection of records WITHOUT any inherent order!
Re: why order by is not wroking in pl/sql or form. [message #312805 is a reply to message #312743] Wed, 09 April 2008 16:32 Go to previous messageGo to next message
cmerry
Messages: 109
Registered: November 2005
Location: Idaho
Senior Member
Unless you use an index-organized table or clustered table.
Re: why order by is not wroking in pl/sql or form. [message #312840 is a reply to message #312805] Wed, 09 April 2008 21:46 Go to previous messageGo to next message
rleishman
Messages: 3724
Registered: October 2005
Location: Melbourne, Australia
Senior Member
cmerry wrote on Thu, 10 April 2008 07:32
Unless you use an index-organized table or clustered table.

Oh no, not this argument again Sad
http://www.orafaq.com/forum/mv/msg/82165/239639/78693/#msg_239639
Re: why order by is not wroking in pl/sql or form. [message #312847 is a reply to message #312746] Wed, 09 April 2008 22:23 Go to previous messageGo to next message
cmerry
Messages: 109
Registered: November 2005
Location: Idaho
Senior Member
anacedent wrote on Wed, 09 April 2008 10:50
A table is a collection of records WITHOUT any inherent order!

Sorry, I should have emphasised my point. A table CAN store data with a specific order. That's all I'm saying. I'm not interested in debating HOW the database stores the data; it is indisputable that there actually is some kind of order placed on the data in an IOT or table cluster...maybe not physically in ASC or DESC order, but there is definitely an inherent order.
Re: why order by is not wroking in pl/sql or form. [message #312849 is a reply to message #312847] Wed, 09 April 2008 22:30 Go to previous messageGo to next message
rleishman
Messages: 3724
Registered: October 2005
Location: Melbourne, Australia
Senior Member
I understand your point, but I prefer the term "organised" - or even "deterministically organised" - rather than ordered.

Re: why order by is not wroking in pl/sql or form. [message #312853 is a reply to message #312849] Wed, 09 April 2008 22:58 Go to previous messageGo to next message
cmerry
Messages: 109
Registered: November 2005
Location: Idaho
Senior Member
Okay, your semantic preference is enough for me. From now on I guess I'll stick to "organized." Razz
Re: why order by is not wroking in pl/sql or form. [message #312875 is a reply to message #312743] Thu, 10 April 2008 00:42 Go to previous messageGo to next message
ap_karthi
Messages: 87
Registered: October 2007
Location: Bangalore
Member
I tried in SQL as shown below

1. create table kk (a number);

2. Please insert values (randomly) into above table.

3. create table bb (a number);

4. insert into bb select * from kk order by 1;

5. Now table bb will have values in order.
Re: why order by is not wroking in pl/sql or form. [message #312879 is a reply to message #312875] Thu, 10 April 2008 00:45 Go to previous messageGo to next message
Michel Cadot
Messages: 64110
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
This is plain wrong.
Read again what has been posted.

Regards
Michel
Re: why order by is not wroking in pl/sql or form. [message #312896 is a reply to message #312746] Thu, 10 April 2008 01:23 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
A wise man once said
You have a basket of balls & you toss in a new ball.
How do you decide the proper order for the new ball?

A table is a collection of records WITHOUT any inherent order!

ap_karthi wrote on Thu, 10 April 2008 07:42
5. Now table bb will have values in order.


I have a bag and I put in balls in a certain order. Do I end up with a bag with my balls ordered in them?

[Updated on: Thu, 10 April 2008 01:24]

Report message to a moderator

Re: why order by is not wroking in pl/sql or form. [message #312923 is a reply to message #312896] Thu, 10 April 2008 02:23 Go to previous messageGo to next message
Littlefoot
Messages: 20894
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Frank
I have a bag and I put in balls in a certain order. Do I end up with a bag with my balls ordered in them?

Yes, if this is how the bag looks like:

./fa/4128/0/

Not if this is your bag:

./fa/4129/0/
  • Attachment: bag_1.jpeg
    (Size: 2.51KB, Downloaded 311 times)
  • Attachment: bag_2.jpeg
    (Size: 4.39KB, Downloaded 310 times)
Re: why order by is not wroking in pl/sql or form. [message #312929 is a reply to message #312923] Thu, 10 April 2008 02:48 Go to previous messageGo to next message
Michel Cadot
Messages: 64110
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Well, in the first case, I bet you will not get the balls in the same order you enter them. Grin

Regards
Michel
Re: why order by is not wroking in pl/sql or form. [message #312932 is a reply to message #312929] Thu, 10 April 2008 02:51 Go to previous messageGo to next message
rleishman
Messages: 3724
Registered: October 2005
Location: Melbourne, Australia
Senior Member
LF: ./fa/3958/0/
Re: why order by is not wroking in pl/sql or form. [message #312940 is a reply to message #312929] Thu, 10 April 2008 03:05 Go to previous message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Michel Cadot wrote on Thu, 10 April 2008 09:48
Well, in the first case, I bet you will not get the balls in the same order you enter them. Grin

plus the fact that naming an image bag.jpg doesn't really make everything in the image a bag Smile

I really lolled at your post though, thanks for lighting up my morning-coffee, Littlefoot!
Previous Topic: Compilation errors
Next Topic: package compiling problem
Goto Forum:
  


Current Time: Mon Dec 05 11:15:51 CST 2016

Total time taken to generate the page: 0.11003 seconds