fx8i: Oracle Spatial

A database interface used to connect to an Oracle object-relational database. Note that Oracle database versions 8.1.x and 9.x can store data in both a traditional relational format and the newer object-relational format. fx8i can only be used with the latter. See the section below to see how to access the relational Oracle model.

Connect String

An Oracle connect string, typically specified via a command line option, takes one of the following forms:

-c=<user_id>/<password>[@tns_name]

or

-c=<keyword>=<value>[,<keyword>=<value>]

where <keyword>=<uid>|<pwd>|<host>

<uid> = Oracle User ID
<pwd> = Oracle User password
<host> = Oracle database server TNS alias

To hide any sensitive connection information from prying eyes, an encoded string may be used. The utility fxencode is available for such encoding.

Extensions to Standard Commands

objfetch

objfetch

objfetch accepts no arguments. This command causes the results of a previously submitted SQL SELECT statement, to be retrieved. Depending on whether certain symbologies have been defined, either EIM compound structures or gstructures are created. If no symbology has been defined and the only column type retrieved is an Oracle geometry then "raw" EIM graphic entities are created. If the Oracle SELECT statement does not return any geometry data, gstructures with attributes (corresponding to the columns selected) are returned.

plsql

fx8i permits a single PL/SQL statement to be sent to the database. Oracle procedures and functions are supported. The syntax is:

plsql :<Fire_variable> = <PL/SQL_function>

plsql <PL/SQL_procedure>

The first statement shows how to call a PL/SQL function which by definition must return a value. The following return types are supported:

numeric
string
time (maps to an Oracle date type)

The following example illustrates how to call the Oracle sysdate function and retrieve the the return value into an EIM host variable:

time dt
*plsql :dt=sysdate()
tell dt

EIM host variables may also be passed as arguments to function and procedure calls. The arguments may be IN, OUT or IN/OUT as defined in the Oracle PL/SQL documentation. Note: No attempt is made to differentiate between these modes - all host variables are treated as potential IN/OUT arguments. It is the application programmer's responsibility to know which argument(s) may contain an OUT value upon return from the PL/SQL call. The maximum string length that can be returned in an OUT string type parameter is 1024 characters.

Below is an example of a procedure call where the second argument is known to be an OUT argument:

numeric arg1 = 10
string arg2
*plsql myPLSQLproc(:arg1,:arg2)
tell arg2

Additional Commands

defsymb

defsymb <keyword> = <value>[{,|;} <keyword> = <value>]

defsymb is used to define the symbology of entities that will be created upon submitting an objfetch command. Keywords are shown in the following table.

Keyword

Value Type

Description

color

string

Color to use when drawing entities

thickness

numeric

Thickness to use when drawing entities

fillstyle

string

Fill characteristics used when drawing entities

fillcolor

string

Fill color used to flood polygons

groupname

string

Entities will be added to this groupname

linestyle

string

Linestyle used when drawing entities

markerstyle

string

Marker style to use for node entities

markerheight

numeric

Marker height to use for node entities

markerangle

numeric

Marker angle for node entities

classname

string

The compound class type definition used for entity creation

objectcolumn

string

A database table column who's value will be used to construct a unique name for the compound instance.

objectprefix

string

A prefix used in defining the compound name. The Oracle GID will be automatically appended to this.

set_2d / set_3d

These commands, which do not take any parameters, are used to tell the interface whether incoming graphic entity values are to be recorded in the database with 2-D or 3-D co-ordinates, e.g. via the SQL INSERT command.

When the setting is 2-D, the default when the interface starts, Z ordinates are discarded, and points are entered into the database as 2-D only.

When the setting is 3-D, points are entered into the database in full 3-D.

The default setting may be changed by including the appropriate command in a startup script. This avoids the necessity of having to override the default at the start of every client session.