update date value in oracle 9i

5 pts.
Tags:
Oracle
Oracle 9i
VB.NET
VB.NET 2005
Visual Basic .NET
What is the code to update a date value in oracle 9i from vb.net

Answer Wiki

Thanks. We'll let you know when a new response is added.

Have a look at <a href=”http://www.oracle.com/technology/pub/articles/price_dbtrans_dotnet.html”>this Oracle Document</a> which explain the basics about coding transactions.

There is good example of an insert statement, explained step by step. If what you need to do is an update, just replace the sql command int the example, with the desired update statement.

Summarizing :

-Importing the Namespaces
<pre>Imports System
Imports Oracle.DataAccess.Client</pre>

-create an OracleConnection object
<pre>Dim myOracleConnection As New OracleConnection( “User Id=store;Password=store;Data Source=ORCL”)
myOracleConnection.Open()</pre>

-create an OracleTransaction object and start the transaction
<pre>Dim myOracleTransaction As OracleTransaction = myOracleConnection.BeginTransaction()</pre>

-create an OracleCommand object to store a SQL statement.
<pre>Dim myOracleCommand As OracleCommand = myOracleConnection.CreateCommand</pre>

-set the CommandText property of the OracleCommand object
<pre>myOracleCommand.CommandText = “INSERT INTO product_types (” & ” product_type_id, name” & “) VALUES (” & ” 3, ‘Magazine’” & “)”</pre>

-run the sql statement
<pre>myOracleCommand.ExecuteNonQuery()</pre>

-commit the transaction in the database
<pre>myOracleTransaction.Commit()</pre>

-close the OracleConnection
<pre>myOracleConnection.Close()</pre>

Regards,

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following