This chapter picks up where Chapter 8 leaves off, and here you see how to use the Oracle Command object to execute SQL statements and stored procedures on an Oracle 9i database.In the first part of this chapter, you learn how to use the visual Oracle Command object to execute simple SQL DDL action queries on the target database.After a add button is clicked, I want to be able to add a record into an Oracle database with the info added into textboxes. Private Sub btn Add Sub Update Profile() Dim int SMSMessage As Integer Dim str User Type As String Dim obj Business Logic As New mylogic. Similarly I want an update button to update a record in an Oracle database with info added into textboxes.
In the previous chapter, you saw how to use the Sql Command object to execute SQL statements and stored procedures on a SQL Server database.In older Java projects I've been writing and reading CLOBS and I know you have to handle those fields a bit different than normal VARCHARs and such. NET Dynamic Help and whatever I could find on the Internet, and the funny thing is I found three different ways of doing it; 2 really simple and one not so simple.The weird thing is that I don't think the first two options is supposed to be working - but when I test them they work just fine. To test this, I have created a simple table in Oracle, which consists of 2 fields; ID (INT) and TEXT (CLOB). I'm reading a simple text-file created with Notepad, which is 499 KB in size.The code for this example is illustrated in Listing 2. Then you must set up the parameters and finally call the procedure using Execute Non Query method of the Oracle Command object.The first thing to do is to import the object's class residing in the namespace System. The following code in Listing 3 shows how to create a function named get_count_emp_by_dept which receives as its input parameter the department number and returns the number of employees in this department.Next, the chapter provides an example that illustrates how to execute an Oracle stored procedure with named parameters.