Use of SQL parameters via ODBC drivers

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • JB

    Use of SQL parameters via ODBC drivers

    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
  • creamBoy

    #2
    Re: Use of SQL parameters via ODBC drivers

    On Jun 11, 3:20 pm, JB <jb.bross...@gm ail.comwrote:
    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.

    Comment

    • zacks@construction-imaging.com

      #3
      Re: Use of SQL parameters via ODBC drivers

      On Jun 11, 10:20 am, JB <jb.bross...@gm ail.comwrote:
      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.

      Comment

      Working...