OracleDatabase

From Xojo Documentation
Jump to: navigation, search

Class (inherits from Database)

Use with the Oracle plug-in to connect to an Oracle database.

Properties
DatabaseName ErrorCode ReadOnlyProperty.png MultiThreaded
Debug ErrorMessage ReadOnlyProperty.png Password
Error ReadOnlyProperty.png Host UserName


Methods
Close IndexSchema SQLExecute
Commit InsertRecord SQLSelect
Connect Prepare TableSchema
FieldSchema Rollback

Notes

Oracle 8i and above are supported. The Oracle OCI client 9i or later must be installed.

In order to use this class, you must have the OraclePlugin database plug-in in your plugins folder.

The OracleDatabase engine supports all four RecordSet navigation methods: MoveFirst, MoveNext, MovePrevious, and MoveLast.

Threading

SQLSelect and SQLExecute statements do not block when called from within Threads.

Connect to Oracle from CGI Web Applications on Linux

A CGI web application is launched by a Perl script. Since the Oracle plugin needs to be able to access the Oracle OCI libraries, you may need to alter the Perl script to make sure that the LD_LIBRARY_PATH is properly configured. Adding this command to the Perl script is sometimes necessary:

 PassEnv LD_LIBRARY_PATH

Sources: [1] [2]

Xojo Cloud

Oracle databases cannot be accessed from Xojo Cloud.

Downloads

In order to use OracleDatabase, you need to install the Oracle Instant Client which can be downloaded from here:

You'll also need to make sure that your system path contains the folder with the Oracle Instant Client.

Examples

The following example connects to an Oracle Express database hosted at 10.0.1.14:

db = New OracleDatabase

db.DatabaseName = "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.0.1.14)(PORT=1521))(CONNECT_DATA=(SID=XE)))"
db.UserName = "SYSTEM"
db.Password = "dbexample"
db.Debug = 1

If db.Connect Then
MsgBox("Connected to Oracle!")
Else
MsgBox("Error connecting to Oracle: " + db.ErrorMessage)
End If

See Also

Database Class, DatabaseRecord, OracleSQLPreparedStatement, PreparedSQLStatement, RecordSet classes.

Personal tools
Namespaces

Variants
Actions
Main
Content
Starting Out
Dig Deeper
More Help
Toolbox
About