Initializing help system before first use

Example

Assume that the Oracle database contains a table ``pricelist'' of the following form:

articlenum color price
1001 blue 10.49
1002 red 10.49
1003 black 5.99
1004 blue 3.99
...

The following small example shows how to logon to a database from an Mosel model file, read in data, and logoff from the database.

model 'OCIexample'
 uses 'mmoci'

 declarations
  prices: array (range) of real
 end-declarations

 setparam("OCIverbose", true)   ! Enable OCI message printing in case of error
 OCIlogon("scott","tiger","")   ! connect to Oracle as the user 'scott/tiger'

 writeln("Connection number: ", getparam("OCIconnection"))

 OCIexecute("select articlenum,price from pricelist", prices)
                                ! Get the entries of field `price' (indexed by
                                ! field `articlenum') in table `pricelist'

 OCIlogoff                      ! Disconnect from the database
end-model

Here the OCIverbose control parameter is set to true to enable OCI message printing in case of error. Following the connection, the procedure OCIexecute is called to retrieve entries from the field price (indexed by field articlenum) in the table pricelist. Finally, the connection is closed.

For further examples of working with databases and spreadsheets, the reader is referred to the Xpress whitepaper Using ODBC and other database interfaces with Mosel.

© 2001-2020 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.