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!

bind variables

Roger25Jan 6 2014 — edited Jan 7 2014

Hello,

I'm reading about bind variables and their advantages. I see many examples of simple select statements, where the non-use of bind variable and the use of this variables are compared. But, in pl/sql, this binding is done automatically (except the "execute immediate 'select...' "), in fact a pl/sql variable is a bind variable.

Then, where are useful bind variables? When a developer should use a bind variable in his development tasks, if he, probably works in a company where the database application consists of triggers, packages, procedures, maybe he develop some scripts, so all are pl/sql constructs.

I have never used them (except "execute immediate" in the pl/sql block).

In many examples over the Internet I see only simple sql statements, but 97% from my development time I use pl/sql constructs (unnamed blocks, or other database objects). So, when are useful bind variables and in which application code (just database code; except Java, where I use bind variables every time I write a select) ?

I'm a little bit confused.

Thank you.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 4 2014
Added on Jan 6 2014
16 comments
969 views