WSODBC

How to use the ODBC functionality built into GuiXT WS.

You can use the GuiXT WS platform to access data and manipulate functions in Microsoft SQL Server and other ODBC-compliant databases through the wsodbc extension. Wsodbc is a set of libraries that you can use to make ODBC connections and perform SQL queries from within GuiXT WS scripts. Currently, this functionality is in use in the field by several of Synactive's customers, most notably Florida Crystals. The Wsodbc functionality is available for use with the following Synactive solutions:

Through GuiXT Server, the ODBC functionality can be used with Synactive's Offline and Mobile solutions in addition to the local and Server-based implementations already mentioned. This highlights one of the great strengths of WS - you can write a single script and implement it with multiple touchpoints. With WSODBC, you can use the exec() method of your database object to execute any SQL commands that are supported by Microsoft SQL Server. Some of the most common commands, which we will be demonstrating in our excamples, are the following.

Specify Databases
You can specify more than one database to connect to. However, you can only connect to a single database at a time - simultaneous connections are not currently possible.
Create Tables
You can use wsodbc to create new tables in SQL databases. In addition, you can add rows to either the newly created tables or existing tables in the database.
Retrieve Data
You can use SQL 'Select' statements to retrieve data from within SQL databases. The data will be returned as a relational array, so once returned, you can then perform operations upon it from with the WS script.
Update Databases
You can insert data into database tables with the wsodbc extension. In addition, you can specify individual table within databases. You can also add entries to database tables with wsodbc.
Delete Table Entries
You can use wsodbc to delete individual entries from a database table.
Drop Tables
You can use wsodbc to drop an entire table from a given database.

The WSODBC functionality is available in the following solutions:

The ODBC functionality is accomplished with an extension to the WS platform called wsodbc. In this section, we will explain how to use the GuiXT WS to work with SQL databases. The following topics will be covered: