Specific Aspects of LINK2i Functions
LINK2i connection strings
To run LINK2i functions that are taking connString parameter in input, you have to generate a connection string using GetConnectionString function.
This connection string is generated from the IP address of the targeted IBM i and username/password of an IBM i session.
LINK2i license status
LINK2i functions that are taking licenseStatus parameter are returning (ByRef) the state of the current LINK2i license key in remaining days.
Session identifiers in LINK2i functions
Most of LINK2i functions require a session identifier (SessionID) to operate.
It is a 15 characters string used to identify a transaction on the IBM i.
You can use the ASP Session.SessionID property or create your own based on unique user identifier, date/time or random characters.
It can be composed by any ASCII character.
SQL and LINK2i
Many LINK2i functions are taking SQL SELECT queries as input parameter. Please note that simple queries and join queries can be used when performing SELECT queries.
Therefore, join queries cannot be used in processes that imply modifications to the targeted IBM i database (UPDATE, INSERT INTO... performed on join queries).
Some libraries/databases are using prefixed tables/files names (common in 36 environments). To use such prefixed names in SQL queries, surround them by double quotes ( " or ASCII chr(34)).
Example: select * from qs36f."T.CUST" where CUSTID=’00736’
Mass extraction chunking
When performing a massive data extraction using GetMassiveData function, LINK2i retreives data in chunks. The size of these chunks can be adjusted via the chunk parameter.
For maximal performance, chunks size has to be tuned according to:
The IBM i's capacity: Each chunk requires an access and a session opening on the IBM i
The Windows machine performance: Each chunk is stored in RAM when received and cannot excess available memory in size.
Network quality: Depending on the reliability of the network, packets of data may have to be sent multiple times. For low connection speeds and/or low available RAM on th Windows machine, choose a value of chunk under 500.
For faster connections, this value can be increased up to the total number of records to extract.
Fine tuning the chunk is a trial & error process. We recommend you to use 500 in distant networks and 100 000 in local networks as default values and fine tune it for recurrent applications.
Utility functions and ASP.NET controls
LINK2i functions prefixed by Utility are designed to offer an out-of-the-box user interface via ASP Panel controls.
These funtions automatically populate panels with TextBox and Label controls to allow the user to interact with data or compose CL command as a green screen interface would offer.
Therefore it is up to you wheter to use or not this feature. Panel parameters are optional and Utility functions also return raw data as XML string for you to create custom user interfaces.
The XML string can then be modified and applied to the IBM i.
Two cycles are used to display data and post edited data on the IBM i:
Using ASP Panels
Using XML streams
Refer to XML data model and code example of Utility functions for more details about XML data structures and implementation of Utility functions in your projects.