Re: C++ client libs

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Randy Jonasz <rjonasz(at)click2net(dot)com>
Cc: Adam Haberlach <adam(at)newsnipple(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: C++ client libs
Date: 2000-10-09 07:36:52
Message-ID: 200010090736.DAA05495@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> > > 2) Implement results as a returned object from pg_database
> > > result = db.exec();
> > > result >> field1 >> field2 >> field3;
> > > and
> > > field = result["field"];
> > > field = result[fieldnum];

Rogue Wave Software has an SQL C++ interface in dbtools.h++. It is
similar to what you describe. Here is a sample program:

#include <rw/db/db.h>

int main ()
{
1. RWDBDatabase enterpriseDB = RWDBManager :: database
("SYBASE", "SYBASESERVER", "ME", "PASSWORD", "DATA");

RWDBTable table1 = enterpriseDB.table("Actual_Sales");

2. RWDBReader table1Reader = table1.reader();

RWDBDatabase spreadsheet = RWDBManager :: database
("ODBC", "MS_EXCEL", "ME", "PASSWORD", "C:\mydir");

3. spreadsheet.createTable ("TMPSALES", table1.schema());
RWDBTable spreadsheetTable = spreadsheet.table ("TMPSALES");

4. RWDBInserter localInserter = spreadsheetTable.inserter();
while (table1Reader()) {
localInserter << table1Reader;
localInserter.execute();
}

...

5. /* Insert DDE code to plot your sales forecast, stored
in the second spreadsheet, versus actual sales now
stored in the TMPSALES spreadsheet. */
}

There are white-papers describing the interface. It may be helpful for
ideas. You can see more at:

http://www.roguewave.com/products/xplatform/dbtools/

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Christof Petig 2000-10-09 10:50:26 Re: Suggested change in include/utils/elog.h
Previous Message Billy G. Allie 2000-10-09 03:41:38 Patch to FAQ_SCO for PostgreSQL 7.1