doc.txt

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

SQLI/SQLD (c) 2004/2005/2006 Hans Oesterholt-Dijkema, License: LGPL.

For more information, see:

   http://www.elemental-programming.org/Bigloo%20SQLI.html

You can also look in the manual section of the Help Desk for "SQLI - SQL Interface module".

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

CONTENTS
--------

* PLANET RELEASE LOG
* INCLUDED DRIVERS
* TODO
* INSTALLATION LINUX
* SPECIAL CONSIDERATIONS FOR WINDOWS
* MY LINUX INSTALLATION LOG
* WITH PLANET

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

PLANET RELEASE LOG
------------------

2006-24-01 SQLID Version 1.01, planet package 1.2. With precompiled dynamic libraries for 
           PLT Scheme 301_000. And changed test programs, which now all require planet instead
           of require directly.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

INCLUDED DRIVERS
----------------

Drivers for the following databases are included:

  - Oracle >=8  (via libsqlora8).
  - DB2         (via db2cli).
  - mysql       (via mysqlclient).
  - sqlite      (sqlite 3).
  - postgresql  (via libpq).

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

TODO
----

* Add support for database CURSORS.
* Maybe add support for more types.
* Add support for large objects.

* Add more drivers; e.g. for:

   * Sybase

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

INSTALLATION LINUX
------------------

with setup-plt the sqlid package is installed. drivers are being compiled.
libraries and include files for the drivers need to be in standard places, 
e.g. /usr/lib or /usr/local/lib.

  DB2 NOTES:
  ----------

  The db2-test.scm test program requires two environment variables:
    
     USER=<the user account to use when connecting to DB2>
     PASSWD=<the password to use with the given user account>

  DB2 ON UNIX
  -----------
  Please Note that when using the DB2 Driver on UNIX, You'll need
  to set the environment variable DB2INSTANCE. Otherwise you'll certainly get
  the message:
  
    c_db2_open: Cannot allocate environment handle using SQLAllocHandle

  E.g. I've installed DB2 on Linux using an instance "db2". I've set my 
  DB2INSTANCE to db2:
  
    export DB2INSTANCE=db2

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

SPECIAL CONSIDERATIONS FOR WINDOWS
----------------------------------

The Windows version of sqlid is distributed with pre-compiled drivers.
With these drivers, also client libraries are distributed against which
the pre-compiled drivers have been linked. The following client libraries
are provided:

   - Oracle >=8 : sqlora8.dll  (but not oci.dll, which must be installed with Oracle).
   - DB2        : -            (needed: db2cli.dll, db2api.dll which must be installed with DB2).
   - mysql      : libmysql.dll (from mysql 5.0.18).
   - sqlite     : sqlite3.dll  (sqlite 3.0.8)
   - postgresql : libpq.dll    (postgresql 8.0)

Note: For the commercial databases, no client libraries are provided.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

MY LINUX INSTALLATION LOG
-------------------------

I've got the following installation on my Linux BOX:

- sqlite3 installed in $HOME/local    --> $HOME/local/include; $HOME/local/lib are needed
- postgesql installed in $HOME/local  --> $HOME/local/include; $HOME/local/lib are needed
- mysql installed in $HOME/local      --> $HOME/local/include/mysql; $HOME/local/lib/mysql are needed
- DB2 installed in /opt/IBM/db2/V8.1  --> /opt/IBM/db2/V8.1/lib; /opt/IBM/db2/V8.1/include are needed
- ORACLE *not installed*

Additionally I'm having libpthread installed in the standard places, i.e. /usr/lib/libpthread*

What I'm doing to get sqlid setup right:

ln -sf /usr/lib/*pthread* $HOME/local/lib
ln -sf /usr/include/*pthread* $HOME/local/include

mkdir -p $HOME/local/mysql/lib
mkdir -p $HOME/local/mysql/include
ln -sf /usr/lib/*pthread* $HOME/local/mysql/lib
ln -sf /usr/include/*pthread* $HOME/local/mysql/include
ln -sf $HOME/local/lib/mysql/* $HOME/local/mysql/lib
ln -sf $HOME/local/include/mysql/* $HOME/local/mysql/include

mkdir -p $HOME/local/db2/lib
mkdir -p $HOME/local/db2/include
ln -sf /usr/lib/*pthread* $HOME/local/db2/lib
ln -sf /usr/include/*pthread* $HOME/local/db2/include
ln -sf /opt/IBM/db2/V8.1/lib/* $HOME/local/db2/lib
ln -sf /opt/IBM/db2/V8.1/include/* $HOME/local/db2/include

export MYSQL_EXTENSION_LIB_PATH=$HOME/local/mysql
export DB2_EXTENSION_LIB_PATH=$HOME/local/db2
export PLT_EXTENSION_LIB_PATHS=$HOME/local

export LD_LIBRARY_PATH=$HOME/local/lib:$HOME/local/mysql/lib:/opt/IBM/db2/V8.1/lib

setup-plt sqlid-1.00.plt

or 

planet --install oesterholt sqlid.plt 1 0


********************************************************************************************
[hans@asuras sqlid]$ setup-plt sqlid-1.00.plt
setup-plt: Setup version is 300
setup-plt: PLT home directory is /home/hans/local
setup-plt: Collection paths are
setup-plt:   /home/hans/.plt-scheme/300/collects
setup-plt:   /home/hans/local/collects
setup-plt: Unpacking sqlid from sqlid-1.00.plt
setup-plt:   making directory sqlid in /home/hans/local/./collects/
setup-plt:   unpacking c-sqld-mysql.scm in /home/hans/local/./collects/sqlid/
setup-plt:   unpacking c-sqld-oracle.scm in /home/hans/local/./collects/sqlid/
setup-plt:   unpacking sqld-psql-internal.scm in /home/hans/local/./collects/sqlid/
setup-plt:   unpacking sqlid-libpath.scm in /home/hans/local/./collects/sqlid/
setup-plt:   unpacking sqlid.h in /home/hans/local/./collects/sqlid/
setup-plt:   unpacking c-sqld-db2.scm in /home/hans/local/./collects/sqlid/
setup-plt:   unpacking c-sqld-psql.c in /home/hans/local/./collects/sqlid/
setup-plt:   unpacking sqld-sqlite.scm in /home/hans/local/./collects/sqlid/
setup-plt:   unpacking sqld-sqlite-internal.scm in /home/hans/local/./collects/sqlid/
setup-plt:   unpacking doc.txt in /home/hans/local/./collects/sqlid/
setup-plt:   unpacking sqld-oracle.scm in /home/hans/local/./collects/sqlid/
setup-plt:   making directory html in /home/hans/local/./collects/sqlid/
setup-plt:   unpacking sqlid.css in /home/hans/local/./collects/sqlid/html/
setup-plt:   unpacking index.html in /home/hans/local/./collects/sqlid/html/
setup-plt:   unpacking sqld-psql.scm in /home/hans/local/./collects/sqlid/
setup-plt:   unpacking info.ss in /home/hans/local/./collects/sqlid/
setup-plt:   unpacking sqli.scm in /home/hans/local/./collects/sqlid/
setup-plt:   unpacking c-sqld-mysql.c in /home/hans/local/./collects/sqlid/
setup-plt:   unpacking c-sqld-sqlite.scm in /home/hans/local/./collects/sqlid/
setup-plt:   unpacking sqld-db2-internal.scm in /home/hans/local/./collects/sqlid/
setup-plt:   unpacking sqld-mysql.scm in /home/hans/local/./collects/sqlid/
setup-plt:   unpacking c-sqld-db2.c in /home/hans/local/./collects/sqlid/
setup-plt:   unpacking sqld-db2.scm in /home/hans/local/./collects/sqlid/
setup-plt:   unpacking c-threads.h in /home/hans/local/./collects/sqlid/
setup-plt:   unpacking c-sqld-oracle.c in /home/hans/local/./collects/sqlid/
setup-plt:   unpacking c-threads.c in /home/hans/local/./collects/sqlid/
setup-plt:   unpacking sqld-mysql-internal.scm in /home/hans/local/./collects/sqlid/
setup-plt:   making directory samples in /home/hans/local/./collects/sqlid/
setup-plt:   unpacking sqlite-test.scm in /home/hans/local/./collects/sqlid/samples/
setup-plt:   unpacking mysql-test.scm in /home/hans/local/./collects/sqlid/samples/
setup-plt:   unpacking oracle-test.scm in /home/hans/local/./collects/sqlid/samples/
setup-plt:   unpacking psql-test.scm in /home/hans/local/./collects/sqlid/samples/
setup-plt:   unpacking db2-test.scm in /home/hans/local/./collects/sqlid/samples/
setup-plt:   unpacking pre-installer.ss in /home/hans/local/./collects/sqlid/
setup-plt:   unpacking c-sqld-sqlite.c in /home/hans/local/./collects/sqlid/
setup-plt:   unpacking sqld-oracle-internal.scm in /home/hans/local/./collects/sqlid/
setup-plt:   unpacking c-sqld-psql.scm in /home/hans/local/./collects/sqlid/
setup-plt: Pre-Installing sqlid
  plthome  = /home/hans/local
  package-dir = /home/hans/local/collects/sqlid
SQLITE3 DRIVER
  SQLITE3_EXTENSION_LIB_PATH has not been set, will *not* be used for PLT_EXTENSION_LIB_PATHS
  Resetting PLT_EXTENSION_LIB_PATHS=/home/hans/local
  PLT_EXTENSION_LIB_PATHS=/home/hans/local
SEARCH PATH=(/home/hans/local /usr /usr/local /usr/local/gnu /sw /arch/gnu/packages/readline-4.2), sys-path=/home/hans/local
make: making compiled/native/i386-linux/c-sqld-sqlite.o because compiled/native/i386-linux/c-sqld-sqlite.o does not exist
compile-extension: (/usr/bin/gcc -c -O2 -fPIC -I/home/hans/local/include -I/home/hans/local/include c-sqld-sqlite.c -o compiled/native/i386-linux/c-sqld-sqlite.o)
make: making compiled/native/i386-linux/c-sqld-sqlite.so because compiled/native/i386-linux/c-sqld-sqlite.so does not exist
link-extension: (/usr/bin/ld -shared -L/home/hans/local/lib compiled/native/i386-linux/c-sqld-sqlite.o -lsqlite3 -lpthread /home/hans/local/lib/mzdyn.o -o compiled/native/i386-linux/c-sqld-sqlite.so)
make: made compiled/native/i386-linux/c-sqld-sqlite.o
make: made compiled/native/i386-linux/c-sqld-sqlite.so
POSTGRESQL DRIVER
  PSQL_EXTENSION_LIB_PATH has not been set, will *not* be used for PLT_EXTENSION_LIB_PATHS
  Resetting PLT_EXTENSION_LIB_PATHS=/home/hans/local
  PLT_EXTENSION_LIB_PATHS=/home/hans/local
SEARCH PATH=(/home/hans/local /usr /usr/local /usr/local/gnu /sw /arch/gnu/packages/readline-4.2), sys-path=/home/hans/local
make: making compiled/native/i386-linux/c-sqld-psql.o because compiled/native/i386-linux/c-sqld-psql.o does not exist
compile-extension: (/usr/bin/gcc -c -O2 -fPIC -I/home/hans/local/include -I/home/hans/local/include c-sqld-psql.c -o compiled/native/i386-linux/c-sqld-psql.o)
make: making compiled/native/i386-linux/c-sqld-psql.so because compiled/native/i386-linux/c-sqld-psql.so does not exist
link-extension: (/usr/bin/ld -shared -L/home/hans/local/lib compiled/native/i386-linux/c-sqld-psql.o -lpq -lpthread /home/hans/local/lib/mzdyn.o -o compiled/native/i386-linux/c-sqld-psql.so)
make: made compiled/native/i386-linux/c-sqld-psql.o
make: made compiled/native/i386-linux/c-sqld-psql.so
MYSQL DRIVER
  Setting PLT_EXTENSION_LIB_PATHS=/home/hans/local/mysql
  PLT_EXTENSION_LIB_PATHS=/home/hans/local/mysql
SEARCH PATH=(/home/hans/local/mysql /usr /usr/local /usr/local/gnu /sw /arch/gnu/packages/readline-4.2), sys-path=/home/hans/local/mysql
make: making compiled/native/i386-linux/c-sqld-mysql.o because compiled/native/i386-linux/c-sqld-mysql.o does not exist
compile-extension: (/usr/bin/gcc -c -O2 -fPIC -I/home/hans/local/mysql/include -I/home/hans/local/include c-sqld-mysql.c -o compiled/native/i386-linux/c-sqld-mysql.o)
make: making compiled/native/i386-linux/c-sqld-mysql.so because compiled/native/i386-linux/c-sqld-mysql.so does not exist
link-extension: (/usr/bin/ld -shared -L/home/hans/local/mysql/lib compiled/native/i386-linux/c-sqld-mysql.o -lmysqlclient -lpthread /home/hans/local/lib/mzdyn.o -o compiled/native/i386-linux/c-sqld-mysql.so)
make: made compiled/native/i386-linux/c-sqld-mysql.o
make: made compiled/native/i386-linux/c-sqld-mysql.so
ORACLE DRIVER
  ORACLE_EXTENSION_LIB_PATH has not been set, will *not* be used for PLT_EXTENSION_LIB_PATHS
  Resetting PLT_EXTENSION_LIB_PATHS=/home/hans/local
  PLT_EXTENSION_LIB_PATHS=/home/hans/local
SEARCH PATH=(/home/hans/local /usr /usr/local /usr/local/gnu /sw /arch/gnu/packages/readline-4.2), sys-path=#f
  ORACLE DRIVER NOT INSTALLED
  Setting environment variable ORACLE_EXTENSION_LIB_PATH might help.
  It will be used as PLT_EXTENSION_LIB_PATHS variable
DB2 DRIVER
  Setting PLT_EXTENSION_LIB_PATHS=/home/hans/local/db2
  PLT_EXTENSION_LIB_PATHS=/home/hans/local/db2
SEARCH PATH=(/home/hans/local/db2 /usr /usr/local /usr/local/gnu /sw /arch/gnu/packages/readline-4.2), sys-path=/home/hans/local/db2
make: making compiled/native/i386-linux/c-sqld-db2.o because compiled/native/i386-linux/c-sqld-db2.o does not exist
compile-extension: (/usr/bin/gcc -c -O2 -fPIC -I/home/hans/local/db2/include -I/home/hans/local/include c-sqld-db2.c -o compiled/native/i386-linux/c-sqld-db2.o)
make: making compiled/native/i386-linux/c-sqld-db2.so because compiled/native/i386-linux/c-sqld-db2.so does not exist
link-extension: (/usr/bin/ld -shared -L/home/hans/local/db2/lib compiled/native/i386-linux/c-sqld-db2.o -ldb2 -lpthread /home/hans/local/lib/mzdyn.o -o compiled/native/i386-linux/c-sqld-db2.so)
make: made compiled/native/i386-linux/c-sqld-db2.o
make: made compiled/native/i386-linux/c-sqld-db2.so
setup-plt: Compiling .zos used by sqlid
setup-plt:   in /home/hans/local/collects/sqlid/
setup-plt: Done setting up
[hans@asuras sqlid]$

[hans@asuras sqlid]$ export DB2INSTANCE=db2
[hans@asuras sqlid]$ rlwrap mzscheme
Welcome to MzScheme version 300, Copyright (c) 2004-2005 PLT Scheme Inc.
>  (require (lib "sqld-db2.scm" "sqlid"))
> (require (lib "sqli.scm" "sqlid"))
> (define d (sqld-db2-new  "alias=test user=db2 passwd=test"))
> (define s (sqli-connect d))
> (define r (sqli-query s "select * from test"))
> (sqli-error-message s)
""
> (sqli-fetchall s)
(("row'1" "1" "1" "2006-01-04 22:00:38.000000") ("row'2" "2" "1" "2006-01-04 22:00:38.000000") ("row'3" "3" "1" "2006-01-04 22:00:38.000000") ("row'4" "4" "1" "2006-01-04 22:00:38.000000") ("row'5" "5" "1" "2006-01-04 22:00:38.000000") ("row'6" "6" "1" "2006-01-04 22:00:38.000000") ("row'7" "7" "1" "2006-01-04 22:00:38.000000") ("row'8" "8" "1" "2006-01-04 22:00:38.000000") ("row'9" "9" "1" "2006-01-04 22:00:38.000000") ("row'10" "10" "1" "2006-01-04 22:00:38.000000") ("false" "0" "0" "") ("row'1" "1" "1" "2006-01-04 22:00:44.000000") ("row'2" "2" "1" "2006-01-04 22:00:45.000000") ("row'3" "3" "1" "2006-01-04 22:00:45.000000") ("row'4" "4" "1" "2006-01-04 22:00:45.000000") ("row'5" "5" "1" "2006-01-04 22:00:45.000000") ("row'6" "6" "1" "2006-01-04 22:00:45.000000") ("row'7" "7" "1" "2006-01-04 22:00:45.000000") ("row'8" "8" "1" "2006-01-04 22:00:45.000000") ("row'9" "9" "1" "2006-01-04 22:00:45.000000") ("row'10" "10" "1" "2006-01-04 22:00:45.000000") ("false" "0" "0" "") ("row'1" "1" "1" "2006-01-04 22:01:40.000000") ("row'2" "2" "1" "2006-01-04 22:01:40.000000") ("row'3" "3" "1" "2006-01-04 22:01:40.000000") ("row'4" "4" "1" "2006-01-04 22:01:40.000000") ("row'5" "5" "1" "2006-01-04 22:01:40.000000") ("row'6" "6" "1" "2006-01-04 22:01:40.000000") ("row'7" "7" "1" "2006-01-04 22:01:40.000000") ("row'8" "8" "1" "2006-01-04 22:01:40.000000") ("row'9" "9" "1" "2006-01-04 22:01:40.000000") ("row'10" "10" "1" "2006-01-04 22:01:40.000000") ("false" "0" "0" "") ("row'1" "1" "1" "2006-01-04 22:01:43.000000") ("row'2" "2" "1" "2006-01-04 22:01:43.000000") ("row'3" "3" "1" "2006-01-04 22:01:43.000000") ("row'4" "4" "1" "2006-01-04 22:01:43.000000") ("row'5" "5" "1" "2006-01-04 22:01:43.000000") ("row'6" "6" "1" "2006-01-04 22:01:43.000000") ("row'7" "7" "1" "2006-01-04 22:01:43.000000") ("row'8" "8" "1" "2006-01-04 22:01:43.000000") ("row'9" "9" "1" "2006-01-04 22:01:43.000000") ("row'10" "10" "1" "2006-01-04 22:01:43.000000") ("false" "0" "0" "") ("row'1" "1" "1" "2006-01-04 22:01:47.000000") ("row'2" "2" "1" "2006-01-04 22:01:47.000000") ("row'3" "3" "1" "2006-01-04 22:01:47.000000") ("row'4" "4" "1" "2006-01-04 22:01:47.000000") ("row'5" "5" "1" "2006-01-04 22:01:47.000000") ("row'6" "6" "1" "2006-01-04 22:01:47.000000") ("row'7" "7" "1" "2006-01-04 22:01:47.000000") ("row'8" "8" "1" "2006-01-04 22:01:47.000000") ("row'9" "9" "1" "2006-01-04 22:01:47.000000") ("row'10" "10" "1" "2006-01-04 22:01:47.000000") ("false" "0" "0" ""))
> (sqli-disconnect s)
> (exit)
[hans@asuras sqlid]$

Welcome to MzScheme version 300, Copyright (c) 2004-2005 PLT Scheme Inc.
> (require (lib "sqld-mysql.scm" "sqlid"))
> (require (lib "sqli.scm" "sqlid"))
> (define d (sqld-mysql-new "db=test user=test passwd=test"))
> (define s (sqli-connect d))
> (sqli-error-message s)
""
> (define r (sqli-query s "select * from test"))
> (sqli-error-message s)
""
> (sqli-fetchall s)
(("row'1" "1" "1" "2006-01-04 21:52:51") ("row'2" "2" "1" "2006-01-04 21:52:51") ("row'3" "3" "1" "2006-01-04 21:52:51") ("row'4" "4" "1" "2006-01-04 21:52:51") ("row'5" "5" "1" "2006-01-04 21:52:51") ("row'6" "6" "1" "2006-01-04 21:52:51") ("row'7" "7" "1" "2006-01-04 21:52:51") ("row'8" "8" "1" "2006-01-04 21:52:51") ("row'9" "9" "1" "2006-01-04 21:52:51") ("row'10" "10" "1" "2006-01-04 21:52:51") ("false" "0" "0" "2006-01-04 21:52:51") ("row'1" "1" "1" "2006-01-04 21:52:54") ("row'2" "2" "1" "2006-01-04 21:52:54") ("row'3" "3" "1" "2006-01-04 21:52:54") ("row'4" "4" "1" "2006-01-04 21:52:54") ("row'5" "5" "1" "2006-01-04 21:52:54") ("row'6" "6" "1" "2006-01-04 21:52:54") ("row'7" "7" "1" "2006-01-04 21:52:54") ("row'8" "8" "1" "2006-01-04 21:52:54") ("row'9" "9" "1" "2006-01-04 21:52:54") ("row'10" "10" "1" "2006-01-04 21:52:54") ("false" "0" "0" "2006-01-04 21:52:54") ("row'1" "1" "1" "2006-01-04 21:52:57") ("row'2" "2" "1" "2006-01-04 21:52:57") ("row'3" "3" "1" "2006-01-04 21:52:57") ("row'4" "4" "1" "2006-01-04 21:52:57") ("row'5" "5" "1" "2006-01-04 21:52:57") ("row'6" "6" "1" "2006-01-04 21:52:57") ("row'7" "7" "1" "2006-01-04 21:52:57") ("row'8" "8" "1" "2006-01-04 21:52:57") ("row'9" "9" "1" "2006-01-04 21:52:57") ("row'10" "10" "1" "2006-01-04 21:52:57") ("false" "0" "0" "2006-01-04 21:52:57"))
> (sqli-disconnect s)
> (exit)
[hans@asuras sqlid]$

********************************************************************************************


WITH PLANET
********************************************************************************************

ln -sf /usr/lib/*pthread* $HOME/local/lib
ln -sf /usr/include/*pthread* $HOME/local/include

mkdir -p $HOME/local/mysql/lib
mkdir -p $HOME/local/mysql/include
ln -sf /usr/lib/*pthread* $HOME/local/mysql/lib
ln -sf /usr/include/*pthread* $HOME/local/mysql/include
ln -sf $HOME/local/lib/mysql/* $HOME/local/mysql/lib
ln -sf $HOME/local/include/mysql/* $HOME/local/mysql/include

mkdir -p $HOME/local/db2/lib
mkdir -p $HOME/local/db2/include
ln -sf /usr/lib/*pthread* $HOME/local/db2/lib
ln -sf /usr/include/*pthread* $HOME/local/db2/include
ln -sf /opt/IBM/db2/V8.1/lib/* $HOME/local/db2/lib
ln -sf /opt/IBM/db2/V8.1/include/* $HOME/local/db2/include

export MYSQL_EXTENSION_LIB_PATH=$HOME/local/mysql
export DB2_EXTENSION_LIB_PATH=$HOME/local/db2
export PLT_EXTENSION_LIB_PATHS=$HOME/local

export LD_LIBRARY_PATH=$HOME/local/lib:$HOME/local/mysql/lib:/opt/IBM/db2/V8.1/lib

planet --file sqlid.plt oesterholt 1 0

cat $HOME/.pltscheme/planet/300/300/INSTALL-LOG
(...)
============= Installing sqlid.plt on Wed, 4 Jan 2006 23:41:49 =============
setup-plt: Setup version is 300
setup-plt: PLT home directory is /home/hans/local
setup-plt: Collection paths are
setup-plt:   /home/hans/.plt-scheme/300/collects
setup-plt:   /home/hans/local/collects
setup-plt: Unpacking archive from /home/hans/src/sqlid/sqlid.plt
setup-plt:   unpacking c-sqld-mysql.scm in /home/hans/.plt-scheme/planet/300/300/cache/oesterholt/sqlid.plt/1/0/./
setup-plt:   unpacking c-sqld-oracle.scm in /home/hans/.plt-scheme/planet/300/300/cache/oesterholt/sqlid.plt/1/0/./
setup-plt:   unpacking sqld-psql-internal.scm in /home/hans/.plt-scheme/planet/300/300/cache/oesterholt/sqlid.plt/1/0/./setup-plt:   unpacking sqlid-libpath.scm in /home/hans/.plt-scheme/planet/300/300/cache/oesterholt/sqlid.plt/1/0/./
setup-plt:   unpacking sqlid.h in /home/hans/.plt-scheme/planet/300/300/cache/oesterholt/sqlid.plt/1/0/./
setup-plt:   unpacking c-sqld-db2.scm in /home/hans/.plt-scheme/planet/300/300/cache/oesterholt/sqlid.plt/1/0/./
setup-plt:   unpacking c-sqld-psql.c in /home/hans/.plt-scheme/planet/300/300/cache/oesterholt/sqlid.plt/1/0/./
setup-plt:   unpacking sqld-sqlite.scm in /home/hans/.plt-scheme/planet/300/300/cache/oesterholt/sqlid.plt/1/0/./
setup-plt:   unpacking sqld-sqlite-internal.scm in /home/hans/.plt-scheme/planet/300/300/cache/oesterholt/sqlid.plt/1/0/./
setup-plt:   unpacking doc.txt in /home/hans/.plt-scheme/planet/300/300/cache/oesterholt/sqlid.plt/1/0/./
setup-plt:   unpacking sqld-oracle.scm in /home/hans/.plt-scheme/planet/300/300/cache/oesterholt/sqlid.plt/1/0/./
setup-plt:   making directory html in /home/hans/.plt-scheme/planet/300/300/cache/oesterholt/sqlid.plt/1/0/./
setup-plt:   unpacking sqlid.css in /home/hans/.plt-scheme/planet/300/300/cache/oesterholt/sqlid.plt/1/0/./html/
setup-plt:   unpacking index.html in /home/hans/.plt-scheme/planet/300/300/cache/oesterholt/sqlid.plt/1/0/./html/
setup-plt:   unpacking sqld-psql.scm in /home/hans/.plt-scheme/planet/300/300/cache/oesterholt/sqlid.plt/1/0/./
setup-plt:   unpacking info.ss in /home/hans/.plt-scheme/planet/300/300/cache/oesterholt/sqlid.plt/1/0/./
setup-plt:   unpacking sqli.scm in /home/hans/.plt-scheme/planet/300/300/cache/oesterholt/sqlid.plt/1/0/./
setup-plt:   unpacking c-sqld-mysql.c in /home/hans/.plt-scheme/planet/300/300/cache/oesterholt/sqlid.plt/1/0/./
setup-plt:   unpacking c-sqld-sqlite.scm in /home/hans/.plt-scheme/planet/300/300/cache/oesterholt/sqlid.plt/1/0/./
setup-plt:   unpacking sqld-db2-internal.scm in /home/hans/.plt-scheme/planet/300/300/cache/oesterholt/sqlid.plt/1/0/./
setup-plt:   unpacking sqld-mysql.scm in /home/hans/.plt-scheme/planet/300/300/cache/oesterholt/sqlid.plt/1/0/./
setup-plt:   unpacking c-sqld-db2.c in /home/hans/.plt-scheme/planet/300/300/cache/oesterholt/sqlid.plt/1/0/./
setup-plt:   unpacking sqld-db2.scm in /home/hans/.plt-scheme/planet/300/300/cache/oesterholt/sqlid.plt/1/0/./
setup-plt:   unpacking c-threads.h in /home/hans/.plt-scheme/planet/300/300/cache/oesterholt/sqlid.plt/1/0/./
setup-plt:   unpacking c-sqld-oracle.c in /home/hans/.plt-scheme/planet/300/300/cache/oesterholt/sqlid.plt/1/0/./
setup-plt:   unpacking c-threads.c in /home/hans/.plt-scheme/planet/300/300/cache/oesterholt/sqlid.plt/1/0/./
setup-plt:   unpacking sqld-mysql-internal.scm in /home/hans/.plt-scheme/planet/300/300/cache/oesterholt/sqlid.plt/1/0/./
setup-plt:   making directory samples in /home/hans/.plt-scheme/planet/300/300/cache/oesterholt/sqlid.plt/1/0/./
setup-plt:   unpacking sqlite-test.scm in /home/hans/.plt-scheme/planet/300/300/cache/oesterholt/sqlid.plt/1/0/./samples/
setup-plt:   unpacking mysql-test.scm in /home/hans/.plt-scheme/planet/300/300/cache/oesterholt/sqlid.plt/1/0/./samples/setup-plt:   unpacking oracle-test.scm in /home/hans/.plt-scheme/planet/300/300/cache/oesterholt/sqlid.plt/1/0/./samples/
setup-plt:   unpacking psql-test.scm in /home/hans/.plt-scheme/planet/300/300/cache/oesterholt/sqlid.plt/1/0/./samples/
setup-plt:   unpacking db2-test.scm in /home/hans/.plt-scheme/planet/300/300/cache/oesterholt/sqlid.plt/1/0/./samples/
setup-plt:   unpacking pre-installer.ss in /home/hans/.plt-scheme/planet/300/300/cache/oesterholt/sqlid.plt/1/0/./
setup-plt:   unpacking c-sqld-sqlite.c in /home/hans/.plt-scheme/planet/300/300/cache/oesterholt/sqlid.plt/1/0/./
setup-plt:   unpacking sqld-oracle-internal.scm in /home/hans/.plt-scheme/planet/300/300/cache/oesterholt/sqlid.plt/1/0/./
setup-plt:   unpacking c-sqld-psql.scm in /home/hans/.plt-scheme/planet/300/300/cache/oesterholt/sqlid.plt/1/0/./
setup-plt: Pre-Installing sqlid
  plthome  = /home/hans/local
  package-dir = /home/hans/.plt-scheme/planet/300/300/cache/oesterholt/sqlid.plt/1/0
SQLITE3 DRIVER
  SQLITE3_EXTENSION_LIB_PATH has not been set, will *not* be used for PLT_EXTENSION_LIB_PATHS
  Resetting PLT_EXTENSION_LIB_PATHS=/home/hans/local
  PLT_EXTENSION_LIB_PATHS=/home/hans/local
SEARCH PATH=(/home/hans/local /usr /usr/local /usr/local/gnu /sw /arch/gnu/packages/readline-4.2), sys-path=/home/hans/local
make: making compiled/native/i386-linux/c-sqld-sqlite.o because compiled/native/i386-linux/c-sqld-sqlite.o does not exist
compile-extension: (/usr/bin/gcc -c -O2 -fPIC -I/home/hans/local/include -I/home/hans/local/include c-sqld-sqlite.c -o compiled/native/i386-linux/c-sqld-sqlite.o)
make: making compiled/native/i386-linux/c-sqld-sqlite.so because compiled/native/i386-linux/c-sqld-sqlite.so does not exist
link-extension: (/usr/bin/ld -shared -L/home/hans/local/lib compiled/native/i386-linux/c-sqld-sqlite.o -lsqlite3 -lpthread /home/hans/local/lib/mzdyn.o -o compiled/native/i386-linux/c-sqld-sqlite.so)
make: made compiled/native/i386-linux/c-sqld-sqlite.o
make: made compiled/native/i386-linux/c-sqld-sqlite.so
POSTGRESQL DRIVER
  PSQL_EXTENSION_LIB_PATH has not been set, will *not* be used for PLT_EXTENSION_LIB_PATHS
  Resetting PLT_EXTENSION_LIB_PATHS=/home/hans/local
  PLT_EXTENSION_LIB_PATHS=/home/hans/local
SEARCH PATH=(/home/hans/local /usr /usr/local /usr/local/gnu /sw /arch/gnu/packages/readline-4.2), sys-path=/home/hans/local
make: making compiled/native/i386-linux/c-sqld-psql.o because compiled/native/i386-linux/c-sqld-psql.o does not exist
compile-extension: (/usr/bin/gcc -c -O2 -fPIC -I/home/hans/local/include -I/home/hans/local/include c-sqld-psql.c -o compiled/native/i386-linux/c-sqld-psql.o)
make: making compiled/native/i386-linux/c-sqld-psql.so because compiled/native/i386-linux/c-sqld-psql.so does not exist
link-extension: (/usr/bin/ld -shared -L/home/hans/local/lib compiled/native/i386-linux/c-sqld-psql.o -lpq -lpthread /home/hans/local/lib/mzdyn.o -o compiled/native/i386-linux/c-sqld-psql.so)
make: made compiled/native/i386-linux/c-sqld-psql.o
make: made compiled/native/i386-linux/c-sqld-psql.so
MYSQL DRIVER
  Setting PLT_EXTENSION_LIB_PATHS=/home/hans/local/mysql
  PLT_EXTENSION_LIB_PATHS=/home/hans/local/mysql
SEARCH PATH=(/home/hans/local/mysql /usr /usr/local /usr/local/gnu /sw /arch/gnu/packages/readline-4.2), sys-path=/home/hans/local/mysql
make: making compiled/native/i386-linux/c-sqld-mysql.o because compiled/native/i386-linux/c-sqld-mysql.o does not exist
compile-extension: (/usr/bin/gcc -c -O2 -fPIC -I/home/hans/local/mysql/include -I/home/hans/local/include c-sqld-mysql.c -o compiled/native/i386-linux/c-sqld-mysql.o)
make: making compiled/native/i386-linux/c-sqld-mysql.so because compiled/native/i386-linux/c-sqld-mysql.so does not exist
link-extension: (/usr/bin/ld -shared -L/home/hans/local/mysql/lib compiled/native/i386-linux/c-sqld-mysql.o -lmysqlclient -lpthread /home/hans/local/lib/mzdyn.o -o compiled/native/i386-linux/c-sqld-mysql.so)
make: made compiled/native/i386-linux/c-sqld-mysql.o
make: made compiled/native/i386-linux/c-sqld-mysql.so
ORACLE DRIVER
  ORACLE_EXTENSION_LIB_PATH has not been set, will *not* be used for PLT_EXTENSION_LIB_PATHS
  Resetting PLT_EXTENSION_LIB_PATHS=/home/hans/local
  PLT_EXTENSION_LIB_PATHS=/home/hans/local
SEARCH PATH=(/home/hans/local /usr /usr/local /usr/local/gnu /sw /arch/gnu/packages/readline-4.2), sys-path=#f
  ORACLE DRIVER NOT INSTALLED
  Setting environment variable ORACLE_EXTENSION_LIB_PATH might help.
  It will be used as PLT_EXTENSION_LIB_PATHS variable
DB2 DRIVER
  Setting PLT_EXTENSION_LIB_PATHS=/home/hans/local/db2
  PLT_EXTENSION_LIB_PATHS=/home/hans/local/db2
SEARCH PATH=(/home/hans/local/db2 /usr /usr/local /usr/local/gnu /sw /arch/gnu/packages/readline-4.2), sys-path=/home/hans/local/db2
make: making compiled/native/i386-linux/c-sqld-db2.o because compiled/native/i386-linux/c-sqld-db2.o does not exist
compile-extension: (/usr/bin/gcc -c -O2 -fPIC -I/home/hans/local/db2/include -I/home/hans/local/include c-sqld-db2.c -o compiled/native/i386-linux/c-sqld-db2.o)
make: making compiled/native/i386-linux/c-sqld-db2.so because compiled/native/i386-linux/c-sqld-db2.so does not exist
link-extension: (/usr/bin/ld -shared -L/home/hans/local/db2/lib compiled/native/i386-linux/c-sqld-db2.o -ldb2 -lpthread /home/hans/local/lib/mzdyn.o -o compiled/native/i386-linux/c-sqld-db2.so)
make: made compiled/native/i386-linux/c-sqld-db2.o
make: made compiled/native/i386-linux/c-sqld-db2.so
setup-plt: Compiling .zos used by sqlid
setup-plt:   in /home/hans/.plt-scheme/planet/300/300/cache/oesterholt/sqlid.plt/1/0/
setup-plt: Updating /home/hans/.plt-scheme/planet/300/300/cache.ss
setup-plt: Done setting up
[hans@asuras sqlid]$

[hans@asuras sqlid]$ mzscheme
Welcome to MzScheme version 300, Copyright (c) 2004-2005 PLT Scheme Inc.
> (require (planet "sqld-sqlite.scm" ("oesterholt" "sqlid.plt" 1 0)))
> (require (planet "sqli.scm" ("oesterholt" "sqlid.plt" 1 0)))
> (define d (sqld-sqlite-new "test.db"))
> (define s (sqli-connect d))
> (define r (sqli-query s "create table test (a varchar, b integer)"))
> (sqli-error-message s)
""
> (define r (sqli-query s "insert into test values ('abc',123)"))
> (define r (sqli-query s "insert into test values ('abcd',233)"))
> (sqli-begin s)
#f
> (sqli-query s "insert into test values ('eee',111)")
#f
> (sqli-query s "insert into test values ('efe',232)")
#f
> (sqli-commit s)
#f
> (define r (sqli-query s "select * from test"))
> (sqli-fetchall s)
(("abc" "123") ("abcd" "233") ("eee" "111") ("efe" "232"))
> (sqli-disconnect s)
> (exit)
[hans@asuras sqlid]$

********************************************************************************************


---
$Id: doc.txt,v 1.4 2006/01/05 00:19:24 HansOesterholt Exp $