.NETGURU
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




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification