Skip site navigation (1) Skip section navigation (2)

Re: ODBC driver chances function-call in a wrong way

From: Hiroshi Inoue <inoue(at)tpf(dot)co(dot)jp>
To: Ida Schonfeld <Ida(dot)Schonfeld(at)oclc(dot)org>
Cc: pgsql-odbc(at)postgresql(dot)org
Subject: Re: ODBC driver chances function-call in a wrong way
Date: 2009-01-17 05:07:34
Message-ID: 49716796.1080909@tpf.co.jp (view raw or flat)
Thread:
Lists: pgsql-odbc
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


In response to

pgsql-odbc by date

Next:From: joserDate: 2009-01-19 19:11:17
Subject: Re: Psqlodbc install problem
Previous:From: jurijs NezencevsDate: 2009-01-16 23:02:02
Subject: Re: ODBCNET

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group