Questions tagged [oraclecommand]

An OracleCommand object represents a SQL command, a stored procedure, or a table name.

An OracleCommand object represents a SQL command, a stored procedure, or a table name. The object is responsible for formulating the request and passing it to the database. If results are returned, OracleCommand is responsible for returning results as an OracleDataReader, a .NET XmlReader, a .NET Stream, a scalar value, or as output parameters.

The execution of any transaction-related statements from an OracleCommand is not recommended because it is not reflected in the state of the OracleTransaction object represents the current local transaction, if one exists.

ExecuteXmlReader, ExecuteStream, and ExecuteToStream methods are only supported for XML operations.

ExecuteReader and ExecuteScalar methods are not supported for XML operations.

More information:

45 questions
13
votes
1 answer

Performing an Oracle Transaction using C# and ODP.NET

I'm confused. On the face of it, performing a transaction in C# seems simple. From here: http://docs.oracle.com/cd/B19306_01/win.102/b14307/OracleTransactionClass.htm string constr = "User Id=scott;Password=tiger;Data…
bornfromanegg
  • 2,826
  • 5
  • 24
  • 40
8
votes
2 answers

viewing exact sql after parameter substitution C#

Is there a way to access the CommandText just after it gets executed? I have the following code: cmd = new OracleCommand(sql.ToString(), conn); cmd.Parameters.Add(new OracleParameter("@parm", parmValue)); OracleDataAdapter da = new…
RavenXV
  • 367
  • 1
  • 5
  • 15
4
votes
4 answers

OracleCommand command, ExecuteNonQuery issue

I have to clear certain tables in the oracle database however when I'm having issues with running the following code public static void ClearDataTables(IList tableNames) { string connectionString = "CONNECTIONSTRING"; …
ChickSentMeHighE
  • 1,706
  • 6
  • 21
  • 30
3
votes
2 answers

ORA-01036: illegal variable name/number

I retrieve data from Oracle database and populate a gridview. Next, I try to run a query to select some data but I get an error. Here is the code: Db.cs: public static OracleConnection GetConnection() { OracleConnection connection = null; …
Nikita Silverstruk
  • 1,097
  • 1
  • 20
  • 42
3
votes
2 answers

Specified cast is not valid. Is it because I am attempting to cast an object?

I have the following C# code that I am using to attempt to query an oracle database. I am simply trying to get the numeric result so that I can output it to the console and eventually hold it in a variable. I keep getting the following error…
jjones150
  • 168
  • 2
  • 14
3
votes
3 answers

System.ObjectDisposedException: Cannot access a disposed object. Object name: 'OracleConnection' Reuse of OracleConnection object

I would to reuse a OracleConnection object for more queries so I wrote a simple class: public static class DbConnectionsManager { /// /// /// private static OracleConnection _dbConnection =…
Safari
  • 11,437
  • 24
  • 91
  • 191
3
votes
1 answer

How to execute an update query?

I know how I do this, I have actually done it before, but the following code HANGS (not throw an exception) in this update statement below, and I don't see a reason for it. Can anyone see why? I don't think is important but id is the primary key of…
ender.an27
  • 703
  • 1
  • 13
  • 35
2
votes
2 answers

Odac ORA-00911: invalid character

I am writing a C# code that connects to ODAC. I think my query got no errors, but I get this error, I don't know how to solve. This is my query comm.CommandText = "SELECT * FROM ZAEDBA WHERE USER_ID = '" + login_id + "' AND APPID…
msytNadeem
  • 173
  • 1
  • 4
  • 15
1
vote
2 answers

Is there a way to use a generic DbCommand to do an Asynchronous update?

When using a generic DbCommand to perform an update, it will hang indefinately if the row being updated is locked. The underlying connection used is is Devart's Oracle provider, Devart.Data.Oracle.OracleConnection Setting the…
vzczc
  • 9,270
  • 5
  • 52
  • 61
1
vote
2 answers

Getting ORA-01036: illegal variable name/number error on select query vb.net code

I am getting below error while executing a select statement on vb.net for oracle. I am trying to pass account number as a parameter to the select statement . Below is the SQL statement Dim strSearchSQL As String strSearchSQL = "SELECT…
sid
  • 9
  • 2
1
vote
1 answer

Problem with translating mysql command to oracle command - triggers

I had trouble converting the following command to the oracle command. I will be glad if you help! Create Trigger sales_stock_reduction On SalesMovements After insert as Declare @ProductId int Declare @Piece int Select @ProductId=ProductId,…
anyone
  • 15
  • 5
1
vote
1 answer

Error ORA-06550 and PLS-00103 When Running Oracle Command

When running cmd.ExecuteNonQuery, the following error is displayed: System.Exception: 'ORA-06550: Line 1, Column 13: PLS-00103: The symbol "NET_BUSCAR_SOCIO_P1" was found when one of the following symbols was expected: := . ( @ % ; using…
Pedro Tomaz
  • 41
  • 1
  • 5
1
vote
1 answer

Oracle ODP data types error calling stored procedures

I am converting a legacy application from using the deprecated Microsoft .Net data provider for Oracle (Sql.Data.OracleClient.dll) to Oracle's own .Net ODP provider (OracleManagerDataAccess.dll) using the latest Nuget package. The database server is…
haughtonomous
  • 4,602
  • 11
  • 34
  • 52
1
vote
2 answers

OracleCommand Update does not commit changes

I am using the following code to update a table in oracle. It executes but the update does not commit. If I run the query with Oracle SQL Developer it works fine. What am I missing? SELECT statements work as expected. `Dim BillOfLadingNumber As…
Geovani Martinez
  • 2,053
  • 2
  • 27
  • 32
1
vote
3 answers

How to pass parameters in a oracle SQL query?

For the past few days I cannot pass any fixed parameters to my SQL query. I try all possible tutorials to pass the parameter to a query, but nothing works. However, I have seen by putting fixed parameters directly in the query (method 1) it worked…
Millet Antoine
  • 405
  • 1
  • 6
  • 24
1
2 3