Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mQm9K-0004fu-41 for pgsql-odbc@arkaria.postgresql.org; Thu, 16 Sep 2021 07:49:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mQm9I-0002R0-VR for pgsql-odbc@arkaria.postgresql.org; Thu, 16 Sep 2021 07:49:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mQm9I-0002Qr-Nn for pgsql-odbc@lists.postgresql.org; Thu, 16 Sep 2021 07:49:36 +0000 Received: from exsmtp.ofis.net ([185.15.41.103]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1mQm9C-00017a-Bl for pgsql-odbc@postgresql.org; Thu, 16 Sep 2021 07:49:36 +0000 Received: from exmbx03.ofis.int (10.10.25.113) by exmbx03.ofis.int (10.10.25.113) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Thu, 16 Sep 2021 10:49:35 +0300 Received: from exmbx03.ofis.int ([fe80::6484:de53:b299:919c]) by exmbx03.ofis.int ([fe80::6484:de53:b299:919c%18]) with mapi id 15.00.1497.023; Thu, 16 Sep 2021 10:49:35 +0300 From: Kamil ADEM To: "pgsql-odbc@postgresql.org" Subject: Problem on calling procedures with ADODB Thread-Topic: Problem on calling procedures with ADODB Thread-Index: Adeqz1dIZYYeyv50S6+bNewgT9+VHQ== Date: Thu, 16 Sep 2021 07:49:34 +0000 Message-ID: <994c12dd0d6348d389246fda802fff07@exmbx03.ofis.int> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [213.153.245.158] Content-Type: multipart/alternative; boundary="_000_994c12dd0d6348d389246fda802fff07exmbx03ofisint_" MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --_000_994c12dd0d6348d389246fda802fff07exmbx03ofisint_ Content-Type: text/plain; charset="iso-8859-9" Content-Transfer-Encoding: quoted-printable Hello, We porting a Windows MFC application from MSSQLServer to PostgreSQL and try= ing to use psqlODBC driver with Microsoft ADODB. We are currently performing the migration steps of our C sources and got st= uck on an issue and thought to ask for your help. We use Microsoft ADODB on Windows to access the database and cannot change = this interface in short time. To access Postgres we changed the connection = string accordingly. (e.g. "Driver=3D {PostgreSQL ANSI};") On calling Postgres procedures we have the following code sample: _CommandPtr pCommand; pCommand->CommandType =3D adCmdStoredProc; pCommand->CommandText =3D _bstr_t("sp_TEST"); pCommand->Parameters->Refresh(); pCommand->Execute(NULL, NULL, adCmdStoredProc | adExecuteNoRecords); The Execute() method generates the command: "SELECT * FROM sp_TEST(...)" in= stead of "CALL sp_TEST(...)". This is appropriate for Postgres functions, b= ut there must be a way to call procedures also. Do you know such a reported issue? Do you know a way to change this behavi= our? Should we use a different driver? Should we get rid of procedures and = convert our MSSQL stored procedures to Postgres functions? We would be grateful if you can guide us to the right solution. Thanks in advance. Best regards, Kamil Adem Aqvila Software Yaz=FDl=FDm A.=DE. --_000_994c12dd0d6348d389246fda802fff07exmbx03ofisint_ Content-Type: text/html; charset="iso-8859-9" Content-Transfer-Encoding: quoted-printable

Hello,

&nbs= p;

We portin= g a Windows MFC application from MSSQLServer to PostgreSQL and trying to us= e psqlODBC driver with Microsoft ADODB.

We are cu= rrently performing the migration steps of our C sources and got stuck on an= issue and thought to ask for your help.

&nbs= p;

We use Mi= crosoft ADODB on Windows to access the database and cannot change this inte= rface in short time. To access Postgres we changed the connection string accordingly. (e.g. “Driver=3D {PostgreSQL ANSI};”= )

On callin= g Postgres procedures we have the following code sample:<= /p>

_CommandPtr pCommand;

pCommand->CommandType =3D adCmdStoredProc;

pCommand->CommandText =3D _bstr_t(“sp_TESTR= 21;);

pCommand->Parameters->Refresh();

pCommand->Execute(NULL, NULL, adCmdStoredProc | adEx= ecuteNoRecords);

The Execu= te() method generates the command: “SELECT * FROM sp_TEST(…)= 221; instead of “CALL sp_TEST(…)”. This is appropriate fo= r Postgres functions, but there must be a way to call procedures also.

Do you kn= ow such a reported issue?  Do you know a= way to change this behaviour? Should we use a different driver? Should we = get rid of procedures and convert our MSSQL stored procedures to Postgres functions?

 

We = would be grateful if you can guide us to the right solution.

Tha= nks in advance.

 

Best regards,

 

Kamil Adem

Aqvila Software Yaz=FDl=FDm A.=DE.

 

 

 =

--_000_994c12dd0d6348d389246fda802fff07exmbx03ofisint_--