Re: Problem with libpsqlodbc

From: Gilles DAROLD <gilles(at)darold(dot)net>
To: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>
Cc: pgsql-odbc(at)postgresql(dot)org
Subject: Re: Problem with libpsqlodbc
Date: 2001-08-29 12:55:22
Message-ID: 3B8CE63A.9A7EB89B@darold.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-odbc

Hi,

Yes it is build on a Linux RH6.2 and I use procedure as follow:

create_proc => 'SELECT create_person(?)'
add_proc => 'SELECT set_person_name(?,?)'

and the function are:

CREATE FUNCTION create_person(int4)
RETURNS int4 AS '
INSERT INTO persons (id, name) VALUES (nextval(''persons_id_seq''), '' '');
SELECT currval(''persons_id_seq'') AS keyval;
'
LANGUAGE 'sql';

CREATE FUNCTION set_person_name(int4, varchar)
RETURNS int4 AS '
UPDATE persons SET name=text($2) WHERE $1=id;
SELECT currval(''persons_id_seq'') AS keyval;
'
LANGUAGE 'sql';

Regards,

Gilles DAROLD

Hiroshi Inoue wrote:

> Gilles DAROLD wrote:
> >
> > Hi all,
> >
> > I have sent some patches to the OpenLDAP dev team to have it work with
> > PostgreSQL and they should be applied asap, I also write a HOWTO.
> > This works but with a not usefull or silly workaround.
> >
> > If we want to have PG fully compatible with OpenLDAP we need to resolve
> > a problem regarding the libpsqlodbc library.
> >
>
> Did you build libpsqlidbc library on some unix platform ?
>
> > In OpenLDAP they call the function SQLBindParameter as follow:
> >
> > SQLBindParameter(sth,1,SQL_PARAM_OUTPUT,SQL_C_ULONG,SQL_INTEGER,0,0,&new_keyval,0,0);
> >
> > And then the statement is executed with SQLExecDirect as follow:
> >
> > rc=SQLExecDirect(sth,oc->create_proc,SQL_NTS);
> >
>
> Are you executing a procedure using an escape sequence
> {[?=]call procedure-name[([parameter][,[parameter]]...)]}
> ?
>
> regards,
> Hiroshi Inoue
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jacob Vennervald Madsen 2001-08-29 13:16:36 Default encoding in database
Previous Message Peter Eisentraut 2001-08-29 11:42:13 Re: Select from different database

Browse pgsql-odbc by date

  From Date Subject
Next Message Marc G. Fournier 2001-08-29 15:00:38 List archives moved and cleaned up ...
Previous Message Hiroshi Inoue 2001-08-29 09:10:34 Re: Error messages not always reported through the ODBCdriver -STATEMENT ERROR missing