OLEDB parameter names starting with an @ sign
604519Oct 3 2008 — edited Sep 14 2009Hi guys,
I am using ORACLE.OleDB provider from .Net to execute parameterized queries for example
select * form :1;
What I want to achieve is to name my parameters to start with an @ sign for example:
select * from :@1;
I know that there must be a way since the following:
select * from "@tablename"; works just fine.
does anybody know how to do that ?
In case you wander why do I need this, I need it because I am using a SQL Factory which has generic methods and I support both SQL Server and Oracle so I want to be able to do:
cmd.parameters["@param"].Value = "somevalue";
instead of
if(Oracle)
{
cmd.parameters["param"].Value = "somevalue";
} else if(SQL Server)
{
cmd.parameters["@param"].Value = "somevalue";
}
Thank you in advance.
Kostadin