Path: news.cs.au.dk!noatun.mjolner.dk!mail-to-news From: Atle Newsgroups: comp.lang.beta Subject: I have (TEMPORALLY!!) given up ... Date: Thu, 23 Nov 2000 11:26:58 +0100 Organization: Posted to comp.lang.beta by a mailtonews script Lines: 61 Sender: lbr@mjolner.dk Approved: mailtonews@cs.au.dk Message-ID: <8virsg$6vg8q$1@gjallar.cs.au.dk> NNTP-Posting-Host: bifrost.mjolner.dk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: gjallar.cs.au.dk 974975696 7323930 130.225.4.254 (23 Nov 2000 10:34:56 GMT) X-Complaints-To: usenet@cs.au.dk NNTP-Posting-Date: Thu, 23 Nov 2000 10:34:56 +0000 (UTC) Mailing-List: contact usergroup-help@mjolner.dk; run by ezmlm X-No-Archive: yes X-Mailer: Mozilla 4.72 [en] (X11; U; Linux 2.2.14 i686) X-Accept-Language: en X-Original-Message-ID: <3A1CF0F2.63C2D825@skynet.be> X-Original-Sender: atle@skynet.be Xref: news.cs.au.dk comp.lang.beta:12650 There is something like 5 lines in the PostGreSQL manual mentioning ODBC, the same abount in a 'Database for Linux' book that I have. It basically explains that this is yet another Microsoft attempt at World Domination, and it is much better to use libpq.a So I did, and it worked first time around, no hazzle. If you create a database with the name 'acubase' - in there you create a table called 'symptoms' with an integer field 'ID' and a text field 'S', the row ID | S ---+--------- 1 | Trying (! row) will show up in the query SELECT * FROM SYMPTOMS after executing the program below ORIGIN '~beta/basiclib/external'; OBJFILE linux '/usr/lib/libpq.a' '/lib/libcrypt.so.1' -- Program : Descriptor -- (# Conn:@INTEGER; PQconnectdb: external (# conn:@INTEGER; s:[1]@CHAR; ENTER s EXIT conn #); PQexec: external (# Conn:@INTEGER; q:[1]@CHAR; ENTER (conn,q) #); DO 'dbname=acubase'->PQconnectDB->Conn; (conn,'INSERT INTO SYMPTOMS VALUES (1, \'Trying\')')->PQexec; #) So, for me personally, there is no reason to pursue the ODBC thing. I will try to make this nice, create a 'PQ' pattern as an interface to libpq.a (or I will give it any name that you may think is better ..). So, the advice I need now, is how to do this. My idea was to kep it as simple as possible, there are lots of functions in libpq, lots of ways to open the database, it can be opened over a socket of course, so the database can be here, and you can run postmaster -i at your place and access my database over the Net. My first idea was to duplicate all the libpq functions and leave it at that. But couldn't there be a simpler alternative? Like open, close, select, project and insert? Comments? Thanks, Atle