Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

OLEDB parameter names starting with an @ sign

604519Oct 3 2008 — edited Sep 14 2009
Hi 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 12 2009
Added on Oct 3 2008
1 comment
4,797 views