/* odbc.q: a simple ODBC interface $Id: odbc.q,v 1.4 2005/07/11 14:30:20 agraef Exp $ */ /* This file is part of the Q programming system. The Q programming system is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. The Q programming system is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* ODBC ("Open Database Connectivity") has become the de facto standard for portable and vendor independent database access. Most modern relational databases provide an ODBC interface so that they can be used with this module. The module provides the necessary operations to connect to an ODBC data source and retrieve or modify data using SQL statements. */ import clib; /* The odbc_error symbol is used to return an error message and SQL state when the SQL server reports an error while executing any of the following functions. */ public odbc_error MSG STATE; /* The following functions list the names and descriptions of the available data sources and drivers. The names can be passed in the DSN and DRIVER parameters of the connection string (see below). (It seems that at this time the odbc_drivers function is properly supported only on Windows, though.) */ public extern odbc_sources, odbc_drivers; /* ODBC handles. These handles provide access to an ODBC connection. They are created with the odbc_connect function and closed when garbage-collected, or with an explicit call to the odbc_disconnect function. */ public extern type ODBCHandle; /* Open and close an ODBC connection. CONN is the connection string used to describe the data source and various other parameters such as hostname, user id and password. The precise format depends on your system, so you should consult your local ODBC documentation for details, but generally the string is of the form