Difference: UsingAPPXODBCConnection (5 vs. 6)

Revision 62016-01-08 - JeanNeron

Line: 1 to 1
 
META TOPICPARENT name="APPXExternalDatabases"

Using the APPX/ODBC Connection

Changed:
<
<

>
>

 

Introduction:

This page is applicable to APPX version 4.1 and higher. For older versions, refer to this page

Line: 32 to 31
  3 - DISAM (includes CISAM) 4 - Sybase (not actively supported) 5 - Oracle
Changed:
<
<
6 - ODBC (for example, SQL Server, MySQL, etc.SQL Server requires a product registration)
>
>
6 - ODBC (for example, SQL Server, MySQL, Postgres, etc. SQL Server requires a product registration)
  7 - APPX/NET remote AppxIO file server 8 - DB/2

Line: 50 to 49
 The APPX/ODBC Connection interprets the above example as follows:
  • Connect to an ODBC System Data Source named "SQL 2008".
  • Map file names to table names by concatenating the 3-character APPX Database ID, an underscore, 3-character APPX application ID, an underscore, and the 8-character APPX file name (Thus the DMO PROSPECT file in Database DMO becomes DMO_DMO_PROSPECT). You can use the following variables in your Table Naming Scheme: $db - maps to 3-character APPX Database ID, $appl - maps to 3-character APPX application ID, $version - maps to 2-character APPX version, $file - maps to 8-character APPX file name, $uid - maps to 3-character APPX user id, $pid - maps to Unix process ID, $uname - maps to Unix user name, $ucase( <expression> ) - converts <expression> to upper-case, $lcase( <expression> ) - converts <expression> to lower-case.
Changed:
<
<
  • Proxy Database ID is no longer required and can be left blank.
>
>
  • Proxy Database ID is not required if you are connecting to SQL Server. It is used for all other ODBC connections. This is an internal DB where APPX keeps track of what rows are locked by other APPX sessions, since other RDBMS's or drivers do not support row level locking. Be aware that non APPX programs will still be able to access rows that are 'locked' by APPX.
 
  • Log Profile is a system dependant value that designates which Log Profile to use with this FMS group. Fill this in only if you are setting up an FMS group for logging. See APPX Audit Log for details.
  • Supress Null Numerics determines whether or not to disable the null numeric feature inherent in the database; check this if you want to be consistent with APPXIO behavior which does not have this capability (a zero entry cannot be distinguished from a null value in APPXIO).
  • Read Uncommitted determines whether or not to read a record with an update pending which has not yet been committed. If checked, Appx will read the uncommitted changes. This more closely emulates APPXIO behaviour. If unchecked, Appx will wait for the data to be committed or rolled back.
Line: 65 to 64
 The Realm can be used for systems where more than one authority (domain) can be used to authenticate a user.

You must use the 'Change Password' button to assign the password for the RDBMS to this Identity.

Changed:
<
<

>
>

Assigning the FMS Group

There are 2 places you can assign the FMS group, at the APPX Database Level and in the File Specifications for each individual file.

The APPX Database Level is System Administration -> Runtime Configuration -> Database Definitions:

FMS8.png

If you assign it at the Database level, it becomes the default FMS group for all files in the database, however, you must still go to each file you want stored in the RDBMS and set the FMS Type in File Specifications (System Administration ->File Management->Database Files):

FMS9.png

In this example, we are specifying the FMS group at the individual file level. If we had specified 'sql' as the FMS group at the Database level, then we would only need to set FMS type of 6 here.

NOTE: If you specify an FMS group at the Database level it is not necessary to define an FMS Group with that name for type 1 files. If APPX cannot find the FMS group for a type 1 (APPX/IO) file, it will simply use the normal defaults.

 

Field to Column Mapping :

Line: 75 to 88
 Some APPX data types (such as partial time/date fields) are not supported by all ODBC data sources. In this case, APPX stores those fields in a character column.
Changed:
<
<

Field Overrides

If you do not want to use the APPX assigned data types you can override them using Field Overrides. For example, if you are mapping an APPX Data Dictionary over an existing RDBMS table, you will have to use the existing data types.

Field Overrides are accessed from Data File Management, File Specifications:

FMS5.png

When you click the button, you will get a list of the fields in the selected file:

FMS6.png

Select the field you want to override and Press Enter:

FMS7.png

Here you can override the APPX assigned column name, the data type or whether nulls are allowed or not.

IMPORTANT: If you are changing an existing file, you should export the data first, make your changes, them import the data

>
>

---++ Field Overrides

If you do not want to use the APPX assigned data types you can override them using Field Overrides. For example, if you are mapping an APPX Data Dictionary over an existing RDBMS table, you will have to use the existing data types.

Field Overrides are accessed from Data File Management, File Specifications:

FMS5.png

When you click the button, you will get a list of the fields in the selected file:

FMS6.png

Select the field you want to override and Press Enter:

FMS7.png

Here you can override the APPX assigned column name, the data type or whether nulls are allowed or not.

IMPORTANT: If you are changing an existing file, you should export the data first, make your changes, them import the data

 

Converting to and from ODBC Data Sources :

Line: 90 to 103
 
  • Note that APPX caches the login credentials and other data. If you need to change your FMS settings, Identities, Field Specifications, etc, start a new session to test them.
  • Setting APPX_SQL_CMD={filename} and APPX_DBG_CODE=0xFFFFFFFF produces an SQL Log of all SQL traffic from APPX to the RDBMS backend. It records all commands APPX sends to the RDBMS, and all data the RDBMS sends back to APPX. Set APPX_SQL_CMD to a log file location into which APPX has write permissions. Go to Setting Environment Variables for information on how to set APPX_SQL_CMD and APPX_DBG_CODE.
  • Under Windows, you can also bring up the ODBC Administrator utility used originally to set up the data source. In the "Tracing" tab, click on "Start Tracing" to start and "Stop Tracing" to stop. A trace has to be started before your APPX session has ever tried to access the data file. I.E., if APPX tries to get to the data and fails, you must completely exit APPX, and go back in, to get a trace.
Changed:
<
<
  • The free WinSQL utility www.imranweb.com/freesoft.htm is a great tool for debugging connections to ODBC data sources. You can attach WinSQL to any ODBC data source and browse and run SQL commands on it. It is good at passing through error messages that our APPX/ODBC connection might filter out. Thus, it's a good debugging tool if you're unable to get APPX for Windows to talk successfully to an ODBC / SQL-Server backend to APPX.

    !WinSQL has an option to execute a text file containing SQL commands. So you can point it at an edited SQL_CMD log, and see how the SQL commands APPX sends to the Data Source behave under a 'thin' SQL client. Further, you can use it to massage table creation to manually set up the SQL table, if necessary (such as to modify APPX fieldnames that the ODBC Data Source might not like).

>
>
  • The free WinSQL utility www.imranweb.com/freesoft.htm is a great tool for debugging connections to ODBC data sources. You can attach WinSQL to any ODBC data source and browse and run SQL commands on it. It is good at passing through error messages that our APPX/ODBC connection might filter out. Thus, it's a good debugging tool if you're unable to get APPX for Windows to talk successfully to an ODBC / SQL-Server backend to APPX.

    WinSQL has an option to execute a text file containing SQL commands. So you can point it at an edited SQL_CMD log, and see how the SQL commands APPX sends to the Data Source behave under a 'thin' SQL client. Further, you can use it to massage table creation to manually set up the SQL table, if necessary (such as to modify APPX fieldnames that the ODBC Data Source might not like).

 

Comments:

Line: 98 to 111
 Read what other users have said about this page or add your own comments.
Changed:
<
<

<--/commentPlugin-->
>
>

<--/commentPlugin-->
 
META FILEATTACHMENT attachment="FMS1.png" attr="h" comment="" date="1452027257" name="FMS1.png" path="FMS1.png" size="37018" user="JeanNeron" version="1"
META FILEATTACHMENT attachment="FMS3.png" attr="h" comment="" date="1452028140" name="FMS3.png" path="FMS3.png" size="17121" user="JeanNeron" version="1"
META FILEATTACHMENT attachment="FMS4.png" attr="h" comment="" date="1452028393" name="FMS4.png" path="FMS4.png" size="13803" user="JeanNeron" version="1"
META FILEATTACHMENT attachment="FMS2.png" attr="h" comment="" date="1452031482" name="FMS2.png" path="FMS2.png" size="16924" user="JeanNeron" version="1"
Added:
>
>
META FILEATTACHMENT attachment="FMS8.png" attr="h" comment="" date="1452278432" name="FMS8.png" path="FMS8.png" size="63879" user="JeanNeron" version="1"
META FILEATTACHMENT attachment="FMS9.png" attr="h" comment="" date="1452278685" name="FMS9.png" path="FMS9.png" size="44048" user="JeanNeron" version="1"
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback