Home » Developer & Programmer » Forms » How to Update a column from the other column?
How to Update a column from the other column? [message #325044] Wed, 04 June 2008 21:57 Go to next message
svloke
Messages: 23
Registered: May 2007
Location: Mumbai
Junior Member
For a report purpose I have created a table having three columns (c1(varchar2), c2(date) & c3(date)).
C1 & c2 are filled columns. I need to update 'n'th row of c3 with 'n+1'th row of c2.
I request all seniors to kindly guide me.

svloke

[Updated on: Wed, 04 June 2008 22:48]

Report message to a moderator

Re: How to Update a column from the other column? [message #325071 is a reply to message #325044] Wed, 04 June 2008 23:31 Go to previous messageGo to next message
athar.fitfd@hotmail.com
Messages: 193
Registered: October 2007
Location: pakistan
Senior Member
please explain little more
Re: How to Update a column from the other column? [message #325123 is a reply to message #325044] Thu, 05 June 2008 01:39 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
If you know how to sort these records, no problem; research use of the LEAD / LAG Oracle functions.
Re: How to Update a column from the other column? [message #325125 is a reply to message #325071] Thu, 05 June 2008 01:45 Go to previous messageGo to next message
svloke
Messages: 23
Registered: May 2007
Location: Mumbai
Junior Member
An equipment is shuttled from one location to the other. The report regarding history of shutteling is required. The parent table is having date and location of its installation as two columns.
Using explicit cursor I plan to inser location, date of installation, date of de-installation in the columns c1(varchar2 100), c2(date) and c3(date) of new temp table. The installation date at 1st onward location will be de-installation date for the previous location.
How can it be done? is it possible to do it without using an explicit cursor?

svloke

[Updated on: Thu, 05 June 2008 01:46]

Report message to a moderator

Re: How to Update a column from the other column? [message #325133 is a reply to message #325123] Thu, 05 June 2008 02:01 Go to previous messageGo to next message
svloke
Messages: 23
Registered: May 2007
Location: Mumbai
Junior Member
please explain.
Re: How to Update a column from the other column? [message #325186 is a reply to message #325133] Thu, 05 June 2008 04:45 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
LF
research use of the LEAD / LAG Oracle functions
Re: How to Update a column from the other column? [message #325206 is a reply to message #325186] Thu, 05 June 2008 05:14 Go to previous messageGo to next message
svloke
Messages: 23
Registered: May 2007
Location: Mumbai
Junior Member
Incomplete reply. No text is seen. Please re-send.
Re: How to Update a column from the other column? [message #325245 is a reply to message #325206] Thu, 05 June 2008 06:33 Go to previous message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
On the contrary, everything I meant to say is visible. But it seems that your are incapable to understand it. OK, I'll try once again:
  • Go to Oracle documentation
  • Choose SQL Reference Guide book
  • Go to "Functions" chapter
  • Research use of LAG and LEAD functions
  • Test them on simple examples (Scott's schema)
  • Apply your new knowledge to your task
  • Return here if you have a question about a specific problem
  • If necessary, include CREATE TABLE and INSERT INTO sample data scripts
  • Post what you've done and explain why it doesn't work as expected
  • Properly format code and use [code] tags to preserve formatting

(It's much better now, isn't it?)
Previous Topic: Oracle Forms Check Box 'FRM-40505'
Next Topic: FRM-21011:pl/sql unhandled exception ORA-06502
Goto Forum:
  


Current Time: Sat Dec 10 05:29:56 CST 2016

Total time taken to generate the page: 0.26145 seconds