Re: c program against databases
Date: 1997/03/14
Message-ID: <858577961_at_slug.org>#1/1
. .dra.com!emerald.xara.net!xara.net!news-feed.inet.tele.dk!news.maxwell.syr.eÿ . du!dispatch.news.demon.net!demon!smooth1.demon.co.uk!smooth1.demon.co.uk!djw From: David Williams <djw_at_smooth1.demon.co.uk> .Newsgroups: comp.databases.informix,comp.databases.oracle Subject: Re: c program against databases
.Date: Fri, 14 Mar 1997 22:26:19 +0000 .Organization: not applicable .Distribution: world .Message-ID: <5TmZfJALCdKzEwzD_at_smooth1.demon.co.uk> .References: <33287792.3C6D_at_ventera.com> .NNTP-Posting-Host: smooth1.demon.co.uk .X-NNTP-Posting-Host: smooth1.demon.co.uk .MIME-Version: 1.0 .X-Newsreader: Turnpike Version 3.00 <9Hhi+s$5$1$z+XxjwCrFWIswYg> .Lines: 53 .Xref: uustar.starnet.net comp.databases.informix:43744
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
- Connect to database.
- Disconnect from database.
- Run insert/update/delete against database - these can be stored in C strings and prepared - they return a status code.
- 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 WilliamsReceived on Fri Mar 14 1997 - 00:00:00 CET