From: Jeff Eckermann <jeff_eckermann@yahoo.com>
To: Philippe Lang <philippe.lang@attiksystem.ch>
To: pgsql-odbc@postgresql.org
Subject: Re: Access, pass-through queries and isolation level
Date: Thu, 6 Nov 2003 07:34:47 -0800 (PST)
Message-ID: <20031106153448.42281.qmail@web20809.mail.yahoo.com> (raw)
In-Reply-To: <6C0CF58A187DA5479245E0830AF84F420AF72F@poweredge.attiksystem.ch>
--- Philippe Lang <philippe.lang@attiksystem.ch>
wrote:
> Hello,
>
> I'm not sure if this problem is related to ODBC or
> Access...
>
> Imagine we have the following function: (Note: I
> know about the serial type, this is juste for
> illustration purpose...)
>
> ----------------------------------
>
> CREATE OR REPLACE FUNCTION public.func_test_insert()
> RETURNS int8 AS
> '
> DECLARE
> next_id int8;
> BEGIN
>
> next_id = max(func_test_data.id)+1;
> insert into public."func_test_data"
> values(next_id);
>
> RETURN next_id;
> END;
> '
> LANGUAGE 'plpgsql' VOLATILE;
>
> ----------------------------------
>
>
> From the query tool of pgAdmin, or with a
> pass-through query in Access 2000, I can call:
>
> select * from public."func_test_insert"();
>
> ... without a problem. I get the inserted id back.
>
>
> Now if I want to change the isolation level before:
>
> set transaction isolation level serializable;
> select * from public."func_test_insert"();
>
> ... I cannot get the inserted id back in Access,
> from the pass-through query. Apprently, since the
> first query does not return any row, Access
> considers the whole query does not return anything.
Are you sending the two statements as separate queries
in your code? If so, try sending both as a single
query, i.e. one string, with a semicolon separating
the two. Access doesn't know you are sending two
statements in one, and Postgres will handle them just fine.
__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-odbc@postgresql.org
Cc: jeff_eckermann@yahoo.com, philippe.lang@attiksystem.ch
Subject: Re: Access, pass-through queries and isolation level
In-Reply-To: <20031106153448.42281.qmail@web20809.mail.yahoo.com>
References: <6C0CF58A187DA5479245E0830AF84F420AF72F@poweredge.attiksystem.ch> <20031106153448.42281.qmail@web20809.mail.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox