Home » Developer & Programmer » Forms » update sl_no sequencely
update sl_no sequencely [message #299977] Wed, 13 February 2008 22:47 Go to next message
salwa
Messages: 76
Registered: December 2007
Member
dear sir

my table data row=73
now another colmun sl_no
and update sl_no sequencely
1
2
3
4
.
.
.
73
how it possiable
please help
Re: update sl_no sequencely [message #299980 is a reply to message #299977] Wed, 13 February 2008 22:57 Go to previous messageGo to next message
azamkhan
Messages: 548
Registered: August 2005
Senior Member
Crate another table with same sturcture. Now with the help of INSERT SELECT STATEMENT with ROWNUM in your SELECT STATEMENT as a colmun for your sl_no colmun insert all updated sl_no data into this new table and then delete all data from your current table an insert it back into it from the newly created table that holds the sequenced sl_no values.

Or simple you can issue and update like this

UPDATE [YOUR_TABLE] SET sl_no = rownum;

IF you want to order the data with respect to any column then do so.

Regards,
Azam Khan
Re: update sl_no sequencely [message #299982 is a reply to message #299977] Wed, 13 February 2008 23:01 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Do you wish to update each row or just display a line number?

David
Re: update sl_no sequencely [message #299984 is a reply to message #299982] Wed, 13 February 2008 23:04 Go to previous messageGo to next message
azamkhan
Messages: 548
Registered: August 2005
Senior Member
Dear David,

I think that he needs to update a colmun sl_no. And I think that it is best that he should issue following

UPDATE TABLE [your_table] SET sl_no = ROWNUM
WHERE [if any]
ORDER BY [if any]

Regards,
Azam Khan
Re: update sl_no sequencely [message #299986 is a reply to message #299982] Wed, 13 February 2008 23:10 Go to previous message
salwa
Messages: 76
Registered: December 2007
Member
thanks azamkhan
its done
Previous Topic: Reading an XML document into oracle forms
Next Topic: Date convertion and other issues.
Goto Forum:
  


Current Time: Fri Dec 02 12:41:12 CST 2016

Total time taken to generate the page: 0.15995 seconds