X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 7EAEAD1B8B5 for ; Thu, 6 Nov 2003 15:35:16 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 99155-01 for ; Thu, 6 Nov 2003 11:34:48 -0400 (AST) Received: from web20809.mail.yahoo.com (web20809.mail.yahoo.com [216.136.226.198]) by svr1.postgresql.org (Postfix) with SMTP id 19A89D1B540 for ; Thu, 6 Nov 2003 11:34:44 -0400 (AST) Message-ID: <20031106153448.42281.qmail@web20809.mail.yahoo.com> Received: from [208.13.35.65] by web20809.mail.yahoo.com via HTTP; Thu, 06 Nov 2003 07:34:47 PST Date: Thu, 6 Nov 2003 07:34:47 -0800 (PST) From: Jeff Eckermann Subject: Re: Access, pass-through queries and isolation level To: Philippe Lang , pgsql-odbc@postgresql.org In-Reply-To: <6C0CF58A187DA5479245E0830AF84F420AF72F@poweredge.attiksystem.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/34 X-Sequence-Number: 3436 --- Philippe Lang 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