From the course: Advanced SQL for Application Development

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Parameterizing SELECT statements

Parameterizing SELECT statements

From the course: Advanced SQL for Application Development

Start my 1-month free trial

Parameterizing SELECT statements

- [Instructor] Now I'm going to pick up where I left off in the previous video. Now one thing I'm going to do is, I want to remove that global variable called cursor that I just created, so I'll just delete it. And I'm going to do that because I'm going to create a local variable called cursor. Now that wouldn't conflict, but I want to avoid any potential confusion. So one of the things I would like to do, is I want to be able to execute a query. And I want to be able to parameterize that query. So let's take a look at how we do that. And the task we're going to do is to create a query that returns a list of all products of a particular type. Now as you may recall from our discussion of the data model, in our products table, we have a product ID attribute, a product name, and a product type. And we use product type for grouping things together. So let's take advantage of having that type information. Now, the first thing…

Contents