Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id C371B6323FB for ; Sat, 17 Jan 2009 01:08:00 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 45207-08 for ; Sat, 17 Jan 2009 01:07:57 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34]) by mail.postgresql.org (Postfix) with SMTP id C7CD9632250 for ; Sat, 17 Jan 2009 01:07:55 -0400 (AST) Received: (qmail 23453 invoked by uid 512); 17 Jan 2009 05:07:36 -0000 X-Authentication: inoue was authenticated by sd.tpf.co.jp at 17 Jan 2009 05:07:36 -0000 Received: from unknown (HELO ?192.168.11.3?) (219.61.40.6) by sd.tpf.co.jp with SMTP; 17 Jan 2009 05:07:36 -0000 Message-ID: <49716796.1080909@tpf.co.jp> Date: Sat, 17 Jan 2009 14:07:34 +0900 From: Hiroshi Inoue User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) MIME-Version: 1.0 To: Ida Schonfeld CC: pgsql-odbc@postgresql.org Subject: Re: ODBC driver chances function-call in a wrong way References: <089C615FFB98CE48BBA6E8EB9AD4A0C9044B18CD@mail.pica.nl> In-Reply-To: <089C615FFB98CE48BBA6E8EB9AD4A0C9044B18CD@mail.pica.nl> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=2.125 tagged_above=0 required=5 tests=DNS_FROM_RFC_BOGUSMX=2.125 X-Spam-Level: ** X-Archive-Number: 200901/16 X-Sequence-Number: 9755 Ida Schonfeld wrote: > Hello, > > > > I have the following problem: > > > > > > I have a PG function in my database which looks like this: > > > > CREATE OR REPLACE FUNCTION help_sel0(IN a int,IN b char(2),OUT > master_fileset INT, OUT master_type CHAR(2), OUT highest_number INT) > RETURNS RECORD AS > > $function$ > > DECLARE > > r RECORD; > > BEGIN > > SELECT INTO r > master_fileset,master_type,highest_number > > FROM gen_master > > WHERE master_fileset= a > > AND master_type= b; > > master_fileset:=r.master_fileset; > > master_type:=r.master_type; > > highest_number:=r.highest_number; > > END; > > $function$ > > LANGUAGE plpgsql; > > > > When I now want to send with my ODBC-programm the following prepared > statement to the server > > {SELECT * FROM gen_master_sel0(?,?);} (with the parameters 10 and ‘S2’) The above call is wrong. You should prepare the ODBC style procedure call {call gen_master_sel0(?,?)} or you can simply prepare the pg-specific procedure call SELECT * FROM gen_master_sel0(?,?) . regards, Hiroshi Inoue