ODBC Samples
------------
1 ODBC Sample Files Purpose
2 How to Run ODBC Samples
3 How to compile an ODBC program in UNIX
4 How to run the ODBC sample programs in UNIX


1 ODBC Sample Files Purpose
---------------------------
    Sample: ex1.c
    Purpose: 
        This sample demostrates how to use ODBC functions to access 
        database.
        1. connect to database
        2. define a permanent table tb1
        3. insert tuples into table tb1
        4. define a permanent table tb2
        5. insert tuples into table tb2 using paramters 
        6. execute a select command on tb1
        7. fetch all tuples from table tb1
        8. execute a select command on tb2
        9. fetch all tuples from table tb2
        10. drop tables tb1 and tb2
        11. end transaction 
        12. terminate db


2 How to Run ODBC Samples
-------------------------
    Build: 
        1. Use the C Compiler of Microsoft or compatible complier.
        2. Remove 'odbc32.lib' and 'odbccp32.lib' from the Link
           Library Modules.
        3. Add 'dmapi40.lib' to the Link Library Modules.
        4. Add 'C:\DBMaker\4.3\Include' to the 'Include Files' Search Path.
        5. Set 'C:\DBMaker\4.3\LIB' into the 'Library Modules' Search Path.
        6. Build the ex1.exe file
    Execute:
        1. Choose and run the 'Execute ex1.exe' command. 


3 How to compile an ODBC program in UNIX
----------------------------------------
        1. Check what compiler is provided on your machine, for example
           'cc'.

        2. Set the include path to the 'inlcude' directory under the 
           home directory of the user 'dbmaker' and compile the C 
           program. For example:

  	      % cc -c -I/APP_HOME/include ex1.c

        3. Set the library path to the 'lib' directory under the home 
           directory of the user 'dbmaker'(/APP_HOME/lib). 

        4. Link libdmapic.a, to make an application that will run in the
           Client-Server environment. For example :

 	      % cc -o ex1 ex1.o -L/APP_HOME/lib -ldmapic -lm -ldl


4 How to run the ODBC sample programs in UNIX
---------------------------------------------
    Steps:
        1. Start the 'DBSAMPLE4' database in client-server mode.  

        2. Type 'make' command under the shell environment.

 	   % make

        3. Type 'ex1' command under the shell environment.

	   % ./ex1
