Re-ordering in Oracle.
Messages   Related Types
This message was discovered on ASPFriends.com 'ngfx-oracle' list.


Anandakumar Varatharajah
Hi,

I need to have table in Oracle, say like below

ProductNum        Des
----------        ---
1            AAAAAA
2            BBBBBB
3            CCCCCC

Now I wanted to insert a row so that the ProductNum will be 2 and Desc will
be AABB.
The original row with ProductNum 2, will become 3 and so on and so forth.

ProductNum        Des
----------        ---
1            AAAAAA
2            AABB
3            BBBBBB
4            CCCCCC

1] How can I do this in Oracle efficiently?
2] What is the best way to do the above with a DataSet in ASP.NET?
i.e. Reorganize the rows as mentioned above in a Dataset.

The requirement is the user should be able to select a row in the browser
and then select the option to move up or move down the row. When the
database is updated with the rows, the sequence in which the user wanted to
arrange the rows should be preserved.

I would greatly appreciate any help or pointers to help on this.

Thanks & Regards,

Anandakumar

Reply to this message...
 
    
Moua, Xay
On the oracle side:

update [table]
set productnum = productnum+1
where productnum>=[productnum inserting into]

insert into [table]
values
([productnum inserting into],'AABB')

Sorry, I can't help you on the Dataset side of it.

-----Original Message-----
From: Anandakumar Varatharajah [mailto:Click here to reveal e-mail address]
Sent: Thursday, April 25, 2002 6:24 PM
To: ngfx-oracle
Subject: [ngfx-oracle] Re-ordering in Oracle.

Hi,

I need to have table in Oracle, say like below

ProductNum        Des
----------        ---
1            AAAAAA
2            BBBBBB
3            CCCCCC

Now I wanted to insert a row so that the ProductNum will be 2 and Desc will
be AABB.
The original row with ProductNum 2, will become 3 and so on and so forth.

ProductNum        Des
----------        ---
1            AAAAAA
2            AABB
3            BBBBBB
4            CCCCCC

1] How can I do this in Oracle efficiently?
2] What is the best way to do the above with a DataSet in ASP.NET?
i.e. Reorganize the rows as mentioned above in a Dataset.

The requirement is the user should be able to select a row in the browser
and then select the option to move up or move down the row. When the
database is updated with the rows, the sequence in which the user wanted to
arrange the rows should be preserved.

I would greatly appreciate any help or pointers to help on this.

Thanks & Regards,

Anandakumar

| [ngfx-oracle] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/ngfx-oracle.asp = JOIN/QUIT

Reply to this message...
 
 
System.Data.DataSet




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com