Home » SQL & PL/SQL » SQL & PL/SQL » Cursors (Oracle9i)
Cursors [message #377879] Fri, 26 December 2008 00:51 Go to next message
vasantha17
Messages: 10
Registered: April 2008
Location: Hyderabad
Junior Member
Hi,


CURSOR c_mfgprt IS
SELECT mfg_part_num
, part_desc
, last_update_date
FROM mfgpart1
WHERE source_system_geo = pv_source_system_geo;

I am using the above cursor in a procedure to fetch the records by dynamically passing the AMER,EMEA,LA and APAC values to the procedure as SOURCE_SYSTEM_GEO.

But now I have to change the cursor to get the Records of both AMER,LA by passing the AMER as a parameter to the SOURCE_SYSTEM_GEO and EMEA records by passing the EMEA value and APAC records by passing the APAC.

Could you please suggest me how i have to change the cursor to handle the above scenario.

Thanks in advance,

-Vasantha
Re: Cursors [message #377891 is a reply to message #377879] Fri, 26 December 2008 02:03 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter), use code tags.
Use the "Preview Message" button to verify.
Also always post your Oracle version (4 decimals).

You can use IN and DECODE.

Regards
Michel
Re: Cursors [message #377892 is a reply to message #377879] Fri, 26 December 2008 02:04 Go to previous messageGo to next message
Olivia
Messages: 519
Registered: June 2008
Senior Member
Quote:

The solution depends on the specifications of your data.
What are the different cases you can have?

Post a Test case: create table and insert statements along with the result you want with these data.
Please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Use the "Preview Message" button to verify.




The requirement is not much clear to me. What I understood from your post is you want to pass multiple values as a parameter.

Search for 'Varying In-list' here to see ways of solving this problem.

Regards,
Oli
Re: Cursors [message #377901 is a reply to message #377879] Fri, 26 December 2008 03:06 Go to previous messageGo to next message
vasantha17
Messages: 10
Registered: April 2008
Location: Hyderabad
Junior Member
Thanks Oli.
Re: Cursors [message #377906 is a reply to message #377901] Fri, 26 December 2008 03:52 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
vasantha17 wrote on Fri, 26 December 2008 10:06
Thanks Oli.

Except that this will not help you to get the solution for your problem.

Regards
Michel

Re: Cursors [message #377921 is a reply to message #377901] Fri, 26 December 2008 05:25 Go to previous message
Olivia
Messages: 519
Registered: June 2008
Senior Member
Quote:

Thanks Oli.



See Michel's reply.His reply was as per your requirement.



Regards,
Oli


Previous Topic: update one table and compare with another table
Next Topic: Create User (merged 4)
Goto Forum:
  


Current Time: Sun Dec 11 00:11:53 CST 2016

Total time taken to generate the page: 0.22639 seconds