The FairCom DB SQL import utility, ctsqlimp, utility “registers” or links existing c-tree files with a FairCom DB SQL database without modifying the table structure such that the files remain accessible from the original application and also accessible from FairCom DB SQL.
For more information about this utility, see ctsqlimp - SQL Import Utility.
Operational Model:
ctsqlimp is used as follows (after creating the database file):
ctsqlimp <filename> [-d database] [-s server] [-u userid] [-a password]
[-n symbolic] [-o userid]
[-i] [-r] [-k] [-c] [-x] [-p|-P] [-z] [-g] [-b|-B] [-j]
[-w script] [-m idxname] [-e xmlfile] [-f s|z|sz] [-l size] [-q prefix]
[-h] [--rowid_fld] [--rowid_idx] [--tls] [--tls_cert cert]
Note: If both -B and -b are specified, the read-only setting takes precedence. Notice that the owner of the table and the DBA have all the permissions.
This introduces a change in behavior for existing applications because this switch is now-case sensitive.
Note: The parameters are case-sensitive. By default they are lower case unless otherwise stated.
Example
To make existing c-tree files mydata.dat (containing proper IFIL and DODA resources) and mydata.idx accessible via FairCom DB SQL, follow these steps:
ctsqlimp custmast.dat -u ADMIN -a ADMIN -s FAIRCOMS
SELECT * FROM custmast;
Unicode
In V11.8 and later, the SQL import logic (affecting the ctsqlimp utility, the ctSqlImportTable() function, FairCom RTG sqllink and sqlize) for Unicode has been updated to take into consideration the string encoding set at the c-treeDB level by the ctdbSetFieldStringEncoding() function. When the SQL import logic identifies a CHAR or a VARCHAR field and the string encoding has been set, the logic uses it to set the charset in the system table. If not present, the charset is not set (which was the behavior before this modification) and so SQL interprets the content as Latin‑1.