Re: c program against databases

From: David Williams <djw_at_smooth1.demon.co.uk>
Date: 1997/03/14
Message-ID: <5TmZfJALCdKzEwzD_at_smooth1.demon.co.uk>#1/1


In article <33287792.3C6D_at_ventera.com>, "Lan H. Tran" <lantran_at_ventera.com> writes
>hello,
>i would like to write a unix-based c program that would perform SELECT
>and INSERT against a database. i am very familiar with esql/c.
>however, i would like to productize this program and allow it to work
>with a variety of databases (Informix, Oracle, Sybase, DB2) on a variety
>of operating systems (variations of unix and NT, maybe).
>
>is the best way to write embedded sql c code (and recompile using
>esql/c, pro*c, etc...)? how standard is this? is there a good toolkit
>to help me out? is there a good book or website to learn more? how do
>app dev packages like IEF do it?
>
  

   Someone where I work has written ESQL/C code which can also be    compiled against Oracle Pro/C using #define ORACLE / #INFORMIX    and #ifdef's. It was relatively easy.

   You could probably write a small libary to handle

  1. Connect to database.
  2. Disconnect from database.
  3. Run insert/update/delete against database - these can be stored in C strings and prepared - they return a status code.
  4. Run select against database

      Can be prepared relatively easily.

  3. Fetch values that are selected.

     Not tried (and the hardest bit) since you need to handle variable 
     numbers of return values.


  Conclusion: ESQL/C is the way to go for Oracle/Informix (and Ingres as   I have written Ingres ESQL/C. Sybase has it's own toolkit so it maybe   harder to write for.

>it seems like i would have to buy alot of precompilers. for example, 4
>databases running on 5 platforms would require 20 (4 x 5) esql/c like
>compilers. is this true?
>
>i would appreciate any guidance.
>
>Lan H. Tran
>Ventera Corporation
>lantran_at_ventera.com

-- 
David Williams
Received on Fri Mar 14 1997 - 00:00:00 CET

Original text of this message