Parameterized queries to different data providers



Hi,

I would like to build my app so it can connect to SQL Server, Oracle
or mySQL and query data.
Data queries should be parameterized to reduce impact of SQL
Injection.

SQLServer Dataprovider uses named parameters (i.e. @name)
OracleClient Dataprovider uses named parameters (i.e. :name)
mySQL ODBC Dataprovider uses question marks (i.e. ?) on the place of a
parameter (so order of question marks is important)

How do I write my queries easily so they will work with all 3 of these
data providers?

For example how do I write this to work with all tree:

SELECT a1, a2 FROM table1 WHERE a1 = 'blah' AND a2 = 'blahblah'

thank you
_dino_
.



Relevant Pages

  • RE: Windows Services and SQL Server
    ... There are managed providers for Oracle, MySQL and other RDBMS's. ... SqlClient class with a regular SQL Server login? ... I'm using ODBC Drivers ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Oracle - MySQL decision
    ... I'm suprised you've not considered Microsoft SQL Server 2005 Express edition ... I'd choose Oracle since I have used it since version 7 and I ... > MySQL 5.0 on the other hand is a close contender. ... Many potential customers have flexible site ...
    (comp.databases)
  • Re: Iseries/AS400 access to external databases
    ... You can read/write data from any RPG program to SQL Server, Oracle, MySQL or ... external clients via ODBC, service programs, etc. ... guess Oracle and MySQL might be other sources but not in our case). ...
    (comp.sys.ibm.as400.misc)
  • Re: alternative to DTS
    ... Alternatively FastReader can write data ... I used to use DTS for transferring data between Informix and SQL Server ... I now need to replicate data between Oracle ... and MySQL and need a similar tool. ...
    (microsoft.public.sqlserver.dts)
  • Re: IOT, memory and transaction time
    ... easily generate it with DBMS_METADATA.GET_DDL if your verison of Oracle ... were pretty consistent no matter how big the table (this transaction ... FOREIGN KEY (versionNo) REFERENCES T_TRANSACTIONS, ... Oracle provides read consistency and SQL Server ...
    (comp.databases.oracle.misc)