Home » SQL & PL/SQL » SQL & PL/SQL » Updating Data
Updating Data [message #390453] Fri, 06 March 2009 06:42 Go to next message
mankensin
Messages: 2
Registered: March 2009
Junior Member
Please help me out. I am currently new in PL/SQL. I have a table in my Oracle DB with the column names and data as indicated in the attached Sample_Data.csv file.

I need to achieve the following on the table;
A procedure that query the table, starting from the first row and check if the (Deal_Type) column is "Fixed Call Money" then go to the next row, if on this next row the (Descriptn) Column is "Place Money Reversed" and the (Amount) value on this row is equal to the (Amount) value in the previous row, it should update the (Descriptn) value to "Place Fixed Money Reversed". If not it should go to the next row and check this same condition.
The procedure should continue this to the end of the row in the table.

Thank you,
Austin Olojede
Re: Updating Data [message #390455 is a reply to message #390453] Fri, 06 March 2009 06:53 Go to previous messageGo to next message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
Are you expecting us to do your work for you? If you read the forum guide you will find that we expect you to show us what you have tried along with DDL and DML statements to create a test case.
Re: Updating Data [message #390457 is a reply to message #390455] Fri, 06 March 2009 06:59 Go to previous messageGo to next message
mankensin
Messages: 2
Registered: March 2009
Junior Member
Sorry I just need a guide. I am sorry I didnt read the forum guide.
Re: Updating Data [message #390458 is a reply to message #390457] Fri, 06 March 2009 07:03 Go to previous message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
Then please do so.
As for a guide, look at the LAG function (and think about ORDER
Previous Topic: Merge with Both Update and Insert at the Same Time
Next Topic: how to send data into ref cursor
Goto Forum:
  


Current Time: Sun Dec 04 08:24:10 CST 2016

Total time taken to generate the page: 0.20379 seconds