|
This section describes how to use the Powersoft INFORMIX IN4 and IN5 database interfaces in PowerBuilder or InfoMaker.
You may wish to also read the description of Using embedded SQL with INFORMIX.
Supported versions
Powersoft supplies two INFORMIX database interfaces:
These interfaces use different Powersoft DLLs and access different versions of the INFORMIX database server software and INFORMIX-NET client software, as listed in the following table:
|
Powersoft INFORMIX interface
|
Powersoft interface DLL
|
INFORMIX database server software
|
INFORMIX-NET client software
|
|
IN4
|
PBIN4040.DLL
|
INFORMIX -SE 4.x INFORMIX-SE 5.x INFORMIX-OnLine 4.x INFORMIX-OnLine 5.x
|
INFORMIX-NET 4.x
|
|
IN5
|
PBIN5040.DLL
|
INFORMIX-SE 5.x INFORMIX-SE 6.x INFORMIX-OnLine 5.x INFORMIX-OnLine 6.x
|
INFORMIX-NET 5.x
|
Supported data types
PowerBuilder and InfoMaker support the following INFORMIX data types in DataWindows, reports, and embedded SQL.
Byte, text, and VarChar data types are not supported in INFORMIX SE. Float and real data types are not supported in INFORMIX Local.
|
Byte (a maximum of 231 bytes)
|
Integer (4 bytes)
|
|
Character (1 to 32,511 bytes)
|
Money
|
|
Date
|
Real
|
|
DateTime
|
Serial
|
|
Decimal
|
SmallInt (2 bytes)
|
|
Float
|
Text (a maximum of 231 bytes)
|
|
Interval
|
VarChar (1 to 255 bytes)
|
Data type conversion When you retrieve or update columns, PowerBuilder or InfoMaker converts data appropriately between the INFORMIX data type and the Powersoft data type.
DateTime data type
The DateTime data type is a contiguous sequence of fields. Each field represents a component of time that you want to record. The syntax is:
PowerBuilder and InfoMaker default to Year TO Fraction(5).
To create your own variation of the DateTime data type:
- In the Database painter Create Table dialog box, create a table with a DateTime column.
- Click the Log Only button.
PowerBuilder or InfoMaker writes the CREATE TABLE statement only to the log file; it does not submit it to the DBMS.
- In the Database Administration painter, modify the DateTime syntax and execute the CREATE TABLE statement.
Time data type
PowerBuilder and InfoMaker also support a time data type. The time data type is a subset of the DateTime data type. The time data type uses only the time qualifier fields.
Interval data type
The interval data type is one value or a sequence of values that represent a component of time. The syntax is:
PowerBuilder and InfoMaker default to Day(3) TO Day.
Preparing to use the database
The procedure for preparing to use an INFORMIX database depends on whether you access it with the IN4 or IN5 interface.
Preparing to use the database with the IN4 interface
Before you define the interface and connect to an INFORMIX database with the IN4 interface, follow these steps to prepare the database.
To prepare an INFORMIX database that you access with the IN4 interface:
- Install the database server software and database network software, following the instructions in your INFORMIX documentation.
You must obtain the database server software from INFORMIX.
- Make sure the appropriate network software is installed at your site. INFORMIX-NET supports the following network protocols:
- Novell IPX/SPX
- Any Windows Sockets compliant TCP/IP protocol
You must obtain the network software from your network vendor.
- Install the appropriate INFORMIX-NET Version 4.x client software on your computer, following the instructions in your INFORMIX-NET documentation.
You must obtain the INFORMIX-NET client software from INFORMIX.
- Install the Powersoft IN4 database interface (PBIN4040.DLL) on your computer.
- Make sure the following files are installed on your computer, and that the directory containing these files appears in your program search path. (These files are usually installed in the INFORMIX \BIN directory.)
- LDLLSQLW.DLL
- SETNET.EXE
- REMSQL.EXE
- Make sure the following line appears in your AUTOEXEC.BAT file:
SET INFORMIXDIR=INFORMIX-NET_directory
For example:
SET INFORMIXDIR=C:\INFORMIX\BIN
- Load the INFORMIX-NET client software and set connection attributes.
One way to do this is to issue the REMSQL command from DOS. Issuing REMSQL loads the INFORMIX-NET software and sets the attributes in the client software network layer that you will use to communicate with the INFORMIX database server.
To issue the REMSQL command, type the following at a DOS prompt:
|
arameter
|
Description
|
|
hostname
|
The name of the host computer running the INFORMIX database process
|
|
username
|
Your user ID or name
|
|
password
|
Your password
|
|
servicename
|
The name of the service to which REMSQL should connect
|
For example:
remsql -h solar -u informix -p informix -s ol4
- Make sure you can connect to the INFORMIX database server and to the INFORMIX database you want to access from outside PowerBuilder or InfoMaker.
- Start Windows on your computer.
Preparing to use the database with the IN5 interface
Before you define the interface and connect to an INFORMIX interface with the IN5 interface, follow these steps to prepare the database.
To prepare an INFORMIX database that you access with the IN5 interface:
- Install the database server software and database network software, following the instructions in your INFORMIX documentation.
- If you are using INFORMIX Version 5.x--You must install database server software and database network software.
- If you are using INFORMIX Version 6.x or higher--You can install just the database server software. You need not install a separate database network component (such as INFORMIX-STAR or INFORMIX-NET) on the server.
You must obtain the database server and database network software from INFORMIX.
- Install the appropriate INFORMIX-NET for Windows Version 5.x client software on your computer, following the instructions in your INFORMIX-NET documentation.
INFORMIX-NET supports the following network protocols:
- Novell IPX/SPX
- Any Windows Sockets compliant TCP/IP protocol
You must obtain the INFORMIX-NET client software from your network vendor.
- Install the Powersoft IN5 database interface (PBIN5040.DLL) on your computer.
- Make sure the following files are installed on your computer, and that the directory containing these files appears in your program search path. (These files are usually installed in the INFORMIX \BIN directory.)
LDLLSQLW.DLL is an INFORMIX software module that allows PowerBuilder or InfoMaker to communicate with a remote INFORMIX database server.
Since PowerBuilder and InfoMaker work with Versions 4.x and 5.x of the INFORMIX-NET client software, you may have both the 4.x and 5.x versions of LDLLSQLW.DLL installed on your computer. (Version 4.x of the LDLLSQLW.DLL file is dated before 1994, and Version 5.x is dated 1994 or later.)
To ensure that you use the Version 5.x LDLLSQLW.DLL file with INFORMIX-NET Version 5.x client software, make sure both of the following are true:
- Version 5.x of the LDLLSQLW.DLL file appears in your program search path before the Version 4.x LDLLSQLW.DLL file.
- Version 4.x of the LDLLSQLW.DLL file does not appear in the program search path. If it does, rename or delete it.
- Make sure the following line appears in your AUTOEXEC.BAT file:
SET INFORMIXDIR=INFORMIX-NET_directory
For example:
SET INFORMIXDIR=C:\INFORMIX\BIN
- Make sure the INFORMIX.INI configuration file in your Windows directory is properly edited for your environment.
When you install INFORMIX-NET Version 5.x client software on your computer, it automatically creates a file named INFORMIX.INI and places it in the Windows directory.
The INFORMIX.INI file contains default parameters that define your network configuration, network protocol, and environment variables. If you omit these values from the database profile when you define the Powersoft INFORMIX database interface, they default to the values specified in your INFORMIX.INI file.
If necessary, you can modify the INFORMIX.INI file by:
- Editing it with any text editor
- Running the Windows-based SETNET utility that comes with INFORMIX-NET for Windows Version 5.x
- Make sure you can connect to the INFORMIX database server and to the INFORMIX database you want to access from outside PowerBuilder or InfoMaker.
INFORMIX provides the ILOGIN.EXE demo program for this purpose. For instructions on using ILOGIN.EXE, see your INFORMIX documentation.
Defining the database interface
This section describes how to define the IN4 and IN5 Powersoft INFORMIX database interfaces.
Defining the IN4 database interface
The following table lists the values you should supply for each field in the Database Profile Setup dialog box when defining the Powersoft IN4 database interface.
|
Field
|
Value
|
|
Profile Name
|
The name of your database profile.
|
|
DBMS
|
IN4 - I-Net v4.x
|
|
User ID
|
Not applicable for use with PowerBuilder or InfoMaker.
|
|
Password
|
Not applicable for use with PowerBuilder or InfoMaker.
|
|
Database Name
|
The name of the INFORMIX database you want to access.
|
|
Prompt for Database information during Connect
|
Select this checkbox if you want to be prompted for connection information when creating or selecting a profile to connect to the database.
|
|
Server Name
|
Not applicable for use with PowerBuilder or InfoMaker.
|
|
Login ID
|
Not applicable for use with PowerBuilder or InfoMaker.
|
|
Login Password
|
Not applicable for use with PowerBuilder or InfoMaker.
|
|
DBParm
|
Specify DBMS-specific connection parameters in this field.
|
Defining the IN5 database interface
The following table lists the values you should supply for each field in the Database Profile Setup dialog box when defining the Powersoft IN5 database interface.
|
Field
|
Value
|
|
Profile Name
|
The name of your database profile.
|
|
DBMS
|
IN5 - I-Net v5.x
|
|
User ID
|
The user ID required to connect to your database. This is your user account name on the host computer running the INFORMIX database server.
If you do not supply this value, it defaults to the user ID specified in your INFORMIX.INI file.
In order to properly create the Powersoft repository tables, make sure the first person to connect to the database has sufficient authority to create tables and grant permissions to public.
|
|
Password
|
The password required to connect to your database. This is your account password on the host computer running the INFORMIX database server.
The actual password does not display in this field. Small Xs appear in place of the characters you type.
If you do not supply this value, it defaults to the password specified in your INFORMIX.INI file.
|
|
Database Name
|
The name of the INFORMIX database you want to access.
|
|
Prompt for Database information during Connect
|
Select this checkbox if you want to be prompted for connection information when creating or selecting a profile to connect to the database.
|
|
Server Name
|
The name of the host computer running the INFORMIX database server.
If you do not supply this value, it defaults to the server (host) name specified in your INFORMIX.INI file.
|
|
Login ID
|
Not applicable for use with PowerBuilder or InfoMaker.
|
|
Login Password
|
Not applicable for use with PowerBuilder or InfoMaker.
|
|
DBParm
|
Specify DBMS-specific connection parameters in this field.
|
Connecting to INFORMIX in a PowerBuilder script
If you are connecting to an INFORMIX database in a PowerBuilder script, you can obtain the serial number of the row inserted into an INFORMIX table by checking the value of the SQLReturnData attribute of the transaction object.
After a embedded SQL INSERT statement executes, SQLReturnData contains the serial number that uniquely identifies the row inserted into the table.
PowerBuilder updates SQLReturnData following an embedded SQL statement only; it does not update it following a DataWindow operation.
|