D
Davidb
Hi,
We are currently developping a system that has to work with both Oracle and
SQL Server. So far we've built a small library to help us connect to SQL
Server and Oracle using the IDb* interfaces instead of using each provider
specific classes. It works well.
Unfortunately we still have to deal with the differences in the SQL syntax.
The JOIN syntax is probably the most obvious difference between SQL Server
and Oracle. We would like to avoid using If and Case to define two different
queries. I'd like to know how to deal with this problem in a more
maintanable way... Any idea?
Maybe there is a product that could allow me to define a query in an OO
fashion and then translate it to the current dbms syntax? Somethig like:
Dim select as SelectStatement = currentProvider.GetSelectStatement()
Dim t as table = new Table("Publishers", "P")
select.Fields.Add(t, "*")
select.From = t
select.From.InnerJoin(new Table("Titles"), "ID", "pub_ID")
Dim command as IDbCommand = select.GetCommand()
....
Thanks,
David
We are currently developping a system that has to work with both Oracle and
SQL Server. So far we've built a small library to help us connect to SQL
Server and Oracle using the IDb* interfaces instead of using each provider
specific classes. It works well.
Unfortunately we still have to deal with the differences in the SQL syntax.
The JOIN syntax is probably the most obvious difference between SQL Server
and Oracle. We would like to avoid using If and Case to define two different
queries. I'd like to know how to deal with this problem in a more
maintanable way... Any idea?
Maybe there is a product that could allow me to define a query in an OO
fashion and then translate it to the current dbms syntax? Somethig like:
Dim select as SelectStatement = currentProvider.GetSelectStatement()
Dim t as table = new Table("Publishers", "P")
select.Fields.Add(t, "*")
select.From = t
select.From.InnerJoin(new Table("Titles"), "ID", "pub_ID")
Dim command as IDbCommand = select.GetCommand()
....
Thanks,
David