maephisto
maephisto

Reputation: 333

bind variables in oracle?

I'm starting to work with Oracle DB, and I'm demanded to use bind variables in my app. Can someone give some brief directions what's bind variables advantage and when should i use them ?

Thanks!

Upvotes: 2

Views: 7357

Answers (4)

learner2360
learner2360

Reputation: 1

The app built using bind variable in Oracle DB improves overall performance of query because it's value doesn't occupy storage in Oracle database

Upvotes: 0

winkbrace
winkbrace

Reputation: 2711

Bind variables are also great against sql injection! :)

Upvotes: 0

Jagmag
Jagmag

Reputation: 10356

This is a very good article that consolidates a lot of information about Bind Variables in Oracle.

The link to the explanation by Tom Kyte referenced at the end of this article is broken but it can be found at Ask Tom : How To Use Bind Variables link instead

In case you are using .NET with Oracle, a code example of how to use Bind Variables can be found here

Upvotes: 6

sjngm
sjngm

Reputation: 12861

The big advantage of using bind variables is that you can write a full statement that Oracle can pre-compile already. In other words it doesn't need to re-parse the statement again just because you're looking for value 1 instead of 100. A bind variable more or less is a place-holder.

Upvotes: 1

Related Questions