Re: Transactions, PostgreSQL and MS Access front end. - Mailing list pgsql-general

From Karen Hill
Subject Re: Transactions, PostgreSQL and MS Access front end.
Date
Msg-id 1145849053.849601.272230@g10g2000cwb.googlegroups.com
Whole thread Raw
In response to Re: Transactions, PostgreSQL and MS Access front end.  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-general
Bruce Momjian wrote:
> Karen Hill wrote:
> > >From Access I'd like to run pass the following from MS Access to
> > PostgreSQL 8.1 using VBA:
> >
> > BEGIN;
> > UPDATE accounts SET balance = balance + 100.00 WHERE acctnum = 12345;
> > UPDATE accounts SET balance = balance - 100.00 WHERE acctnum = 7534;
> > COMMIT;
> >
> > It won't let me.  Any ideas solutions?
>
> What error does it show?
>

Error on character 7.

I suspect it only allows one SQL statement to go through and thinks
everything after the BEGIN; is an error.  I thought of creating a
function in pl/pgsql  that would allow me to do this.  Something like
this in postgresql: NOTE:pseudocode
function(sql_statement_1, sql_statement_2){
BEGIN;
sql_statement_1;
sql_statement_2;
COMMIT;
}

And then I'd run that function from access: NOTE:pseudocode

DoCmd.RunSQL "function('UPDATE accounts..WHERE acctnum = 12345',
'UPDATE accounts...WHERE acctnum = 7534')"


pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Transactions, PostgreSQL and MS Access front end.
Next
From: "karthick muthu"
Date:
Subject: to know