Home » SQL & PL/SQL » SQL & PL/SQL » how to get the previous value in the loop into, 2 separate variable without overwriting
how to get the previous value in the loop into, 2 separate variable without overwriting [message #627871] Mon, 17 November 2014 12:32 Go to next message
venki459
Messages: 5
Registered: November 2014
Location: CHENNAI
Junior Member
select * from income_type

Des Type cat
--------------------------------------------
Distributedincome DIc D

Non Distributedincome Ndic N

-->only 2 records will be preset in table.


-->my requiement is by taking loop i need to fetch 'Cat' colum into 2 seperate
variables without overwriting.

-->I had used 2 fetches it was bad.how to get the 'cat' colum records into
2 variables by using loop? pls can you suggest..
  • Attachment: sample.txt
    (Size: 0.49KB, Downloaded 1038 times)
Re: how to get the previous value in the loop into, 2 separate variable without overwriting [message #627872 is a reply to message #627871] Mon, 17 November 2014 12:38 Go to previous messageGo to next message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
What value is in the CAT column?
Re: how to get the previous value in the loop into, 2 separate variable without overwriting [message #627873 is a reply to message #627871] Mon, 17 November 2014 12:38 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
Since you decide to ignore Posting Guidelines that you have been shown numerous times on previous threads, I decide to not answer your questions
Re: how to get the previous value in the loop into, 2 separate variable without overwriting [message #627877 is a reply to message #627871] Mon, 17 November 2014 13:39 Go to previous messageGo to next message
Michel Cadot
Messages: 68645
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.

With any SQL or PL/SQL question, please, Post a working Test case: create table (including all constraints) and insert statements along with the result you want with these data then we will be able work with your table and data. Explain with words and sentences the rules that lead to this result.

Re: how to get the previous value in the loop into, 2 separate variable without overwriting [message #628048 is a reply to message #627871] Wed, 19 November 2014 09:22 Go to previous message
sandeep_orafaq
Messages: 88
Registered: September 2014
Member
this is not at all clear description. This looks just w piece of bigger picture. Can you please explain more with the guidelines.
2 seperate variables, then why the over write will happen?

BAsed on little information, my suggestion would be use of associated array.
Previous Topic: Inner Loop Stops Iterating through the cursor's values
Next Topic: how to use analytical function
Goto Forum:
  


Current Time: Thu Apr 25 18:55:21 CDT 2024