Use of SQL parameters via ODBC drivers


J

JB

Hi All,

I run simple insert statements [e.g. INSERT INTO Table1 (Col1, Col2)
VALUES ('V1', 'V2')] many times on many different databases.
At the moment, I'm building each statement dynamically every time, and
I'd like to use SQL parameters instead. I'm wondering if and how it's
possible to use SQL parameters via ODBC driver in the same way for all
target databases (e.g. SQL Server, Oracle, Access, etc)

Thanks
JB
 
Ad

Advertisements

C

creamBoy

Hi All,

I run simple insert statements [e.g. INSERT INTO Table1 (Col1, Col2)
VALUES ('V1', 'V2')] many times on many different databases.
At the moment, I'm building each statement dynamically every time, and
I'd like to use SQL parameters instead. I'm wondering if and how it's
possible to use SQL parameters via ODBC driver in the same way for all
target databases (e.g. SQL Server, Oracle, Access, etc)

Thanks
JB

Yes it will. Or should work. The important thing is that the right
provider and connection properties are alright.
 
Ad

Advertisements

Z

zacks

Hi All,

I run simple insert statements [e.g. INSERT INTO Table1 (Col1, Col2)
VALUES ('V1', 'V2')] many times on many different databases.
At the moment, I'm building each statement dynamically every time, and
I'd like to use SQL parameters instead.  I'm wondering if and how it's
possible to use SQL parameters via ODBC driver in the same way for all
target databases (e.g. SQL Server, Oracle, Access, etc)

An ODBCCommand object does support Parameters, but the syntax in the
select statement is different. Instead of naming the parameters, you
use the question mark ("?") as a placeholder for the parameter.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top