Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Bind variables
silvia.fama wrote:
> Hi,
> I'd need a support to use bind variables.
>
> In my program I have a lot of tables, everyone with a different column
> number.
>
> I'm going to use bind variables; so every time I create an sql
> statement with a different number of bind variables (all the values to
> associate to the bind variables are loaded into an array);
> e.g.
> I could have
> "select * from tableA where col1 = :1, col2 = :2, col3 = :3"
> or
> "select * from tableA where col1 = :1, col2 = :2, col3 = :3, ..., coln
> =:n"
> n could be 70.
> So I should call OCIBindByPos 70 times (for cycle), before to call the
> OCIStmtExecute.
> Is there a way to use an OCI function to connect all the value in the
> array with the bind variables?
Sure. Just have a look at the OCI interfaces written for various scripting languages like perl or python. Its always the same procedure (with the usual small differences;):
>
> I hope to be able to explain my problem.
Hope I've got it right.
Mathias Received on Tue Nov 28 2006 - 06:01:40 CST