Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / December 2005

Tip: Looking for answers? Try searching our database.

Issuing a PLSQL command from c#

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Randy - 15 Dec 2005 14:50 GMT
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
Nicholas Paldino [.NET/C# MVP] - 15 Dec 2005 15:18 GMT
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.

Signature

         - Nicholas Paldino [.NET/C# MVP]
         - mvp@spam.guard.caspershouse.com

> Hello,
> I'm trying to find out if it is possible, and if so...how to accomplish
[quoted text clipped - 9 lines]
>
> Thanks
Randy - 15 Dec 2005 15:23 GMT
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.

> Randy,
>
[quoted text clipped - 18 lines]
>>
>> Thanks
Ignacio Machin ( .NET/ C# MVP ) - 15 Dec 2005 15:31 GMT
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,

Signature

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

> 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
[quoted text clipped - 23 lines]
>>>
>>> Thanks
Randy - 15 Dec 2005 18:36 GMT
I don't think you can send two commands at once...

> Hi,
>
[quoted text clipped - 36 lines]
>>>>
>>>> Thanks

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.