Avatar of MIHIR KAR
MIHIR KAR
Flag for India asked on

Could anybody explain what is the difference between cursor and collection in Oracle plsql ??

When to use cursor and when to use collection in plsql  and from where User Interface(UI) can fetch the required result set.
Oracle Database

Avatar of undefined
Last Comment
MIHIR KAR

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
slightwv (䄆 Netminder)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
slightwv (䄆 Netminder)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
MIHIR KAR

ASKER
Thnks sir, but one of my doubt is where exactly a Frontend(UI) able to get the required data.
SOLUTION
slightwv (䄆 Netminder)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
slightwv (䄆 Netminder)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
johnsone

Or, do you even need a procedure/function at all?  If it can be accomplished in a single query, why not have the front end run that query directly?  Cut out all the extra work of having a procedure run to get the same result.
SOLUTION
slightwv (䄆 Netminder)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
johnsone

Well, in my experience the developer that would write the front end code is the one that would write the stored procedure and it would be just as silly no matter which side the code is on.  And I can control their privileges just as much without having to call a procedure.

I seriously had a developer say that all queries need to be in one line stored procedures that return refcursors.  The explanation?  Because they could lose the front end code and then they wouldn't be able to change the query if they had to.  That was their real reason.  Seriously.  I'm not making that up.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
slightwv (䄆 Netminder)

>>And I can control their privileges just as much without having to call a procedure.

Not really.  Execute on a procedure and insert/update and delete on a table are very different.

If they have delete ability on a table and they have a SQL injection vulnerability, all your data can disappear.

If they have select and a security hole in the platform, all your data can be compromised.

Granted, stored procedures won't solve either of those problems by itself but it does help to mitigate them.

A lot also depends on the front end.  Would you have a public facing website directly access your back end database?

>>Because they could lose the front end code and then they wouldn't be able to change the query if they had to

lol... that is FUNNY!!!  See, developers do silly things!!!!!!
SOLUTION
johnsone

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
MIHIR KAR

ASKER
Thank you sir for your kind of intelligible answer. I oblised for that