Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Loop through Select statement

CrackerJackBobNov 11 2014 — edited Nov 11 2014

Hi all,

I have a fairly simple select statement in PL/SQL that returns car information once the filter is modified by the make and model of the car.  However, instead of manually updating the filter and running the statement I'm trying to automatically loop the statement based on how many car makes and models I may already have. 

For example, I have a separate table that store car makes and a separate table that stores car models.  Base on a loop that pulls these values I'd like to auto run the main PL/SQL code.  If that makes any sense.  Any help is appreciated. 

select *

from cars

where make = (&&make) --auto generate this based on loop or other select statement

and model = (&&model)  --auto generate this based on loop or other select statement

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 9 2014
Added on Nov 11 2014
3 comments
684 views