Lianja ODBC Driver on Windows
From Lianjapedia
Revision as of 07:11, 7 February 2013 by Yvonne.milne (Talk | contribs)
Contents
Before Using the Lianja ODBC Driver
Before using the Lianja ODBC Driver, complete the following steps:
- Download and install the driver. The driver is included in the Lianja SQL Server distribution and a client driver-only Lianja ODBC Driver distribution. The driver requires a local or remote Lianja SQL Server to operate.
- Select your Lianja database or create it in the Lianja App Builder Data Workspace or using SQL.
- Copy or Deploy your database to the Lianja SQL Server Database directory.
- Make sure the Lianja SQL Server service is running.
- Create a DSN for your data source in the Lianja ODBC Manager and test the connection.
Using ODBC Data Sources in the Lianja App Builder
Your Lianja ODBC DSN, and other third-party ODBC data sources, can be accessed from the Lianja App Builder in the following ways:
- Using the SQL Remote Data Connectivity Functions
- Using the USE...CONNSTR NoSQL Command
- By creating a Virtual Table in a local database
- In the ODBC Console
- By Importing the data into a new local database
Lianja ODBC Driver Additional Functionality
Full Lianja SQL documentation can be found here: SQL.
Calling Stored Procedures
Stored Procedures can be called using the CALL command. Stored procedures are .prg script files residing in a database's directory. For example, the script sp_demo.prg has been created in the southwind database in the Lianja App Builder:
It takes a parameter, selects data and returns the data as a resultset:
lparameters lcState select account_no, state from example; where state = lcState; into cursor curExample return setresultset("curExample")
After being deployed to the Lianja SQL Server database directory, it can be called when an ODBC connection to the southwind database is active:
nhand = sqlconnect("Lianja_Southwind") if nhand > 0 nret = sqlexec(nhand,"call sp_demo('MA')","mycursor") if nret > 0 select mycursor browse endif sqldisconnect(nhand) endif