SQL Tutorial: Introduction. SQL is a language used to retrieve and manipulate data in a RDMS. SQL stands for Structured Query Language. This section of FreeVBCode provides free code on the topic of Database. These free Visual Basic code snippets, examples, and articles are available for you to download and review.
The Oracle Items for OLE (OO4O) Code Wizard generates OO4O codé that executes 0racle PL/SQL ánd Java stored methods.
The sorcerer creates code into personal Microsoft Visual Basic or Active Server Page and VBScript subroutines from existing Oracle saved techniques and deals. Furthermore, the sorcerer can generate total implementations of COM Automation items in the form of VB course data files. The created COM Automation object methods take action as client stubs for the setup of stored procedures included in a given bundle. All the OO4O code necessary for insight/output parameter holding and saved procedure execution is immediately generated.
The wizard can become utilized as a command-line application or as a Visible Fundamental add-in. The wizard automates the entire process of interacting with stored processes using COM interfaces, thus significantly reducing development time and the possibility of coding errors.
This chapter contains these subjects:
Oracle Objects for OLE Code Wizard Components
The OO4O Code Sorcerer contains the following elements:
A command line tool,
OO40CodeWiz.exe
, thát turns PL/SQL and Java stored processes to OO4U code.A Visible Fundamental Add-in sorcerer that guides you through a collection of steps to generate OO4U code fór PL/SQL ánd Coffee stored procedures. The wizard displays Oracle deals and stored methods from a tree control therefore that the consumer can choose which items to produce code.
Bóth of these parts allow users to convert whole stored process deals to OO4O codé.
Data Sorts Supported by the OO4O Code Wizard
The code wizard facilitates all information sorts, except for PL/SQL tables. When a PL/SQL table is utilized, an
unsupportedType
key word is certainly used instead, and the generated code does not put together.The result code may have got to become customized for managingObject .
Null
ideals. For example, whén a VB variable is initialized to a parameter value, anisNull
check may possess to be included ifNull
ideals are anticipated.Null
values are correctly dealt with for VB variables of typeAlternative
andUsing the OO4O Code Sorcerer
The OO4O Code Sorcerer can become used as a command word line tool or as a Visual Fundamental Add-in.
0O4U Code Wizard Command-Line Electricity
Thé
OO40CodeWiz.exe
is certainly a command-line power that creates a Visual Basic course, a Visual Basic document, or an Energetic Server Web page/VB Screenplay document from existing PL/SQL or Java stored procedures, as nicely as packages, within an Oracle database. Call the energy in the adhering to way:username
security password
connectstring
deal
storedprocedure
Example
Option
Documents Generated
The code sorcerer utilizes the information described on the control line to figure out which kind of output file to produce.
If a document title and one óf the permitted document extensions are usually specified, after that they are usually utilized. In the préceding example, án ASP file is created in theempfile.asp result. The consumer can designate the subsequent éxtensions:
.cIs
.bás
.asp
lf no file extension will be stipulated, the right after rules reveal what type of file is produced, based on additional command-line specs.
- Package deal brands without a kept procedure title generate a
.cls
file. - Bundle brands with method names generate a
.bas
file.
Table 7-1 and Desk 7-2 provide good examples.
Desk 7-1 Package deal Title Without Stored Procedure Name
Document Spécified | Order | Document Kind Génerated |
---|---|---|
File name with no document extension createsfiIename.cls. | 0O4OCodeWiz worker | empfiIe.cls |
Nó file name or expansion: generates
| 0O4OCodeWiz worker |
.cls |
Document title with document extension createsfiIename.fileexten. | 0O4OCodeWiz scott/gambling@Exampledb employee | empfiIe.asp |
Desk 7-2 Package deal Name With Stored Method Title
Document Spécified | Control | File Kind Génerated |
---|---|---|
Document name with no file extension generatesfiIename.bas. | 0O4OCodeWiz employee | empfiIe.bas |
Nó document name or extension: generates
| 0O4OCodeWiz employee |
.bas |
Document name with file extension generatesfiIename.fileexten. | 0O4OCodeWiz scott/gambling@Exampledb worker | empfiIe.asp |
0O4U Code Sorcerer Visual Basic Sorcerer Add-in
Láunch the OO4U Code Wizard by choosing Oracle Code Wizard for Stored Methods in the Add-Ins menus of Microsoft Visual Simple.
ThéConnect Tó Oracle Data sourcediscussion box seems:
Explanation of the representation connéct.gif
Entér the consumer title and password to connect to the data source. A connection string is certainly required if the data source is not set up on the user's regional pc.
ClickOkay.
The sorcerer shows the Oracle packages and kept procedures obtainable to the user in a forest.
Description of the representation wizpróc.gif
SeIect one of thé stored techniques or packages displayed.
Enter án result file name or click on theBrowse.switch to navigate to a different website directory in which to place the file.
Choose thé file kind from theComponent kindlisting. There are three choices: a VB course module (.cls), a VB document (.bas
), or some other. Theotherchoice creates a VB document (.bas
), but enables you to identify your own file extension.Click onOkay.
A dialog box seems suggesting that a brand-new OO4U file was produced.
ClickYesto create another document, or clickNoto return to Visual Simple.
Code Wizard Good examples
Théoo4ocodewizsamples directory website contains structure applications excessive code produced by the sorcerer. The pursuing examples show the generated VB code output from Oracle stored procedures making use of the OO4U code sorcerer:
0RACLEBASEORACLEHOME
Getting at a PL/SQL Stored Function with Visible Fundamental and Dynamic Server Webpages
This example displays a PL/SQL kept functionality,
GetEmpSal
, and then the Visual Basic (.cls
) file that the code sorcerer produces fór it.Thé generated code fór the
GetEmpSaI
saved function is:ln a VB course,
OraDatabase
seems as an feature of the course. This feature provides to become set before any strategies of the course can end up being invoked. For a VB file (.bas), the generated codé for theGetEmpSal
kept function is usually the same as the VB class file, except for the function statement:![Visual Visual](/uploads/1/2/5/8/125827082/170792852.jpg)
.asp
), the functionality declaration also differs for theGetEmpSalkept function as follows, but the entire body of the code remains the exact same:Interacting with a PL/SQL Stored Process Using the LOB Kind with Visual Basic
The right after example shows how a Visible Basic document accesses a PL/SQL saved treatment with L0Bs:
Thé pursuing displays the generated Visual Fundamental code for théGETCHAPTERsaved method:Being able to access a PL/SQL Stored Process Using the VARRAY Kind with Visual Basic
The adhering to example displays how a PL/SQL stored procedure uses the Oracle selection typeVARRAY:Thé sorcerer creates the following Visual Fundamental code for this saved procedure:
Interacting with a PL/SQL Stored Process Making use of the Oracle OBJECT Type with Visual Simple
The sticking with example displays how a PL/SQL kept procedure utilizes the Oracle item type:
The wizard produces the adhering to Visual Fundamental code for this kept method: