471,605 Members | 1,607 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,605 software developers and data experts.

Issuing a PLSQL command from c#

Hello,
I'm trying to find out if it is possible, and if so...how to accomplish
issuing a PLSQL command from within C#. The command is...
SET SCAN OFF;
What is happening is I'm trying to insert/update records with strings which
contain "&" (this causes a prompt in oracle for a parameter) and this causes
the query to fail in C#. I need to turn it off just for my application and
then turn it back on after updating.
I need to be able to do this from within my application and I can't make
anything work.
Can this be done?

Thanks
Dec 15 '05 #1
4 3322
Randy,

You should be able to issue the command through the OleDbCommand class,
or through the OracleCommand class (depending on the provider you are
using). While I am not that specific with Oracle, I would think you would
have to issue it once for each open connection though.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Randy" <te**@temp.com> wrote in message
news:e1**************@TK2MSFTNGP14.phx.gbl...
Hello,
I'm trying to find out if it is possible, and if so...how to accomplish
issuing a PLSQL command from within C#. The command is...
SET SCAN OFF;
What is happening is I'm trying to insert/update records with strings
which contain "&" (this causes a prompt in oracle for a parameter) and
this causes the query to fail in C#. I need to turn it off just for my
application and then turn it back on after updating.
I need to be able to do this from within my application and I can't make
anything work.
Can this be done?

Thanks

Dec 15 '05 #2
Thanks...Yes...I tried issuing it through the OracleCommand class using the
ExecuteNonQuery but it still fails. I'm not sure which exact method in this
class I should use or if there's any special formatting of the command
string I need to do.

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:u%****************@TK2MSFTNGP09.phx.gbl...
Randy,

You should be able to issue the command through the OleDbCommand class,
or through the OracleCommand class (depending on the provider you are
using). While I am not that specific with Oracle, I would think you would
have to issue it once for each open connection though.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Randy" <te**@temp.com> wrote in message
news:e1**************@TK2MSFTNGP14.phx.gbl...
Hello,
I'm trying to find out if it is possible, and if so...how to accomplish
issuing a PLSQL command from within C#. The command is...
SET SCAN OFF;
What is happening is I'm trying to insert/update records with strings
which contain "&" (this causes a prompt in oracle for a parameter) and
this causes the query to fail in C#. I need to turn it off just for my
application and then turn it back on after updating.
I need to be able to do this from within my application and I can't make
anything work.
Can this be done?

Thanks


Dec 15 '05 #3
Hi,

How fails?

It depends of the scope of "SET SCAN OFF" construction, if it's based on
the session , it will be active while you have the connection open, if it's
reset each time you issue a new command, well that is a problem

Just to be sure, can you send two SQL instructions in one command:
theOracleComamnd.CommandText = " SET SCAN OFF; UPDATE TABLE ... ; " ?
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Randy" <te**@temp.com> wrote in message
news:ee**************@TK2MSFTNGP14.phx.gbl...
Thanks...Yes...I tried issuing it through the OracleCommand class using
the ExecuteNonQuery but it still fails. I'm not sure which exact method in
this class I should use or if there's any special formatting of the
command string I need to do.

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in message news:u%****************@TK2MSFTNGP09.phx.gbl...
Randy,

You should be able to issue the command through the OleDbCommand
class, or through the OracleCommand class (depending on the provider you
are using). While I am not that specific with Oracle, I would think you
would have to issue it once for each open connection though.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Randy" <te**@temp.com> wrote in message
news:e1**************@TK2MSFTNGP14.phx.gbl...
Hello,
I'm trying to find out if it is possible, and if so...how to accomplish
issuing a PLSQL command from within C#. The command is...
SET SCAN OFF;
What is happening is I'm trying to insert/update records with strings
which contain "&" (this causes a prompt in oracle for a parameter) and
this causes the query to fail in C#. I need to turn it off just for my
application and then turn it back on after updating.
I need to be able to do this from within my application and I can't make
anything work.
Can this be done?

Thanks



Dec 15 '05 #4
I don't think you can send two commands at once...

"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:u7*************@tk2msftngp13.phx.gbl...
Hi,

How fails?

It depends of the scope of "SET SCAN OFF" construction, if it's based on
the session , it will be active while you have the connection open, if
it's reset each time you issue a new command, well that is a problem

Just to be sure, can you send two SQL instructions in one command:
theOracleComamnd.CommandText = " SET SCAN OFF; UPDATE TABLE ... ; " ?
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Randy" <te**@temp.com> wrote in message
news:ee**************@TK2MSFTNGP14.phx.gbl...
Thanks...Yes...I tried issuing it through the OracleCommand class using
the ExecuteNonQuery but it still fails. I'm not sure which exact method
in this class I should use or if there's any special formatting of the
command string I need to do.

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in message news:u%****************@TK2MSFTNGP09.phx.gbl...
Randy,

You should be able to issue the command through the OleDbCommand
class, or through the OracleCommand class (depending on the provider you
are using). While I am not that specific with Oracle, I would think you
would have to issue it once for each open connection though.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Randy" <te**@temp.com> wrote in message
news:e1**************@TK2MSFTNGP14.phx.gbl...
Hello,
I'm trying to find out if it is possible, and if so...how to accomplish
issuing a PLSQL command from within C#. The command is...
SET SCAN OFF;
What is happening is I'm trying to insert/update records with strings
which contain "&" (this causes a prompt in oracle for a parameter) and
this causes the query to fail in C#. I need to turn it off just for my
application and then turn it back on after updating.
I need to be able to do this from within my application and I can't
make anything work.
Can this be done?

Thanks



Dec 15 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

15 posts views Thread by marvado | last post: by
reply views Thread by sybrandb | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by MichaelMortimer | last post: by
reply views Thread by CCCYYYY | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.