2

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!

1
  • 2
    What language are you writing your App in? Commented Dec 16, 2010 at 7:10

4 Answers 4

6

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

Sign up to request clarification or add additional context in comments.

Comments

1

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.

Comments

0

Bind variables are also great against sql injection! :)

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.