Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 7118A9FA333 for ; Wed, 18 Oct 2006 04:27:44 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 10683-02 for ; Wed, 18 Oct 2006 04:27:38 -0300 (ADT) X-Greylist: delayed 00:19:43.053428 by SQLgrey- Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 2FB849FB3A2 for ; Wed, 18 Oct 2006 04:27:36 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from ls405.htnet.hr (ls405.t-com.hr [195.29.150.135]) by svr4.postgresql.org (Postfix) with ESMTP id 9DFA25AF032 for ; Wed, 18 Oct 2006 07:07:37 +0000 (GMT) Received: from ls422.t-com.hr (ls422.t-com.hr [195.29.150.237]) by ls405.htnet.hr (Postfix) with ESMTP id 093CB1455B4 for ; Wed, 18 Oct 2006 09:07:19 +0200 (CEST) Received: from ls422.t-com.hr (localhost.localdomain [127.0.0.1]) by ls422.t-com.hr (Qmlai) with ESMTP id E805AC90057 for ; Wed, 18 Oct 2006 09:07:18 +0200 (CEST) X-Envelope-Sender-Info: DWFb47blvxLfoJ/gU6+lnefaZV+FaZNKvczjzH5DqRR7j8aE8OM2stcccs1ut/St X-Envelope-Sender: marko.bozikovic@tellus.hr Received: from [192.168.1.120] (89-172-26-200.adsl.net.t-com.hr [89.172.26.200])by ls422.t-com.hr (Qmlai) with ESMTP id 951F41308051for ; Wed, 18 Oct 2006 09:07:18 +0200 (CEST) Message-ID: <4535D278.5030009@tellus.hr> Date: Wed, 18 Oct 2006 09:06:32 +0200 From: Marko Bozikovic User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 To: pgsql-interfaces@postgresql.org Subject: Postgres OLE DB provider - query parameters Content-Type: text/plain; charset=UTF-8 X-imss-version: 2.043 X-imss-result: Passed X-imss-scores: Clean:61.38800 C:2 M:3 S:5 R:5 X-imss-settings: Baseline:1 C:1 M:1 S:1 R:1 (0.0000 0.0000) Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.136 tagged_above=0 required=5 tests=FORGED_RCVD_HELO, UNPARSEABLE_RELAY X-Spam-Level: X-Archive-Number: 200610/19 X-Sequence-Number: 6302 Hi all, I'm new to PostgreSQL OLE DB (and PostgreSQL in general :) and I have a problem with using OLE DB in my C++ code... I'm porting some code from MS SQL to PostgreSQL... Here's an example of M= S SQL query class (insert_department procedure has two parameters: input string= name and output int4 id): [ db_command(L"EXECUTE insert_department ?, ? OUTPUT") ] class QInsertDepartment { public: [ db_param(1, DBPARAMIO_INPUT) ] CComBSTR m_strName; [ db_param(2, DBPARAMIO_OUTPUT, status=3Dm_dwIDStatus) ] LONG m_lID; DBSTATUS m_dwIDStatus; }; I know how to execute a PostgreSQL stored procedure, so I had to change t= he class for PostgreSQL a bit: [ db_command(L"SELECT insert_department(?)") ] class QInsertDepartment { public: [ db_param(1, DBPARAMIO_INPUT) ] CComBSTR m_strName; [ db_column(1, status=3Dm_dwIDStatus) ] LONG m_lID; DBSTATUS m_dwIDStatus; }; Calling code looks something like this: QInsertDepartment insertDepartment; m_session.StartTransaction(); insertDepartment.m_strName =3D strName.c_str(); HRESULT hr =3D insertDepartment.Open(m_session); if (FAILED(hr)) { ... } ... insertDepartment.Open() returns DB_E_PARAMNOTOPTIONAL. Here's the relevan= t part of the log file (execution of Open): IDBCreateCommandImpl::CreateCommand IObjectWithSiteImpl::SetSite CPgCommand::SetCommandText "SELECT insert_department(?)" ICommandTextImpl::SetCommandText CPgCommand::SetParameterInfo CErrorLookupService::ClearErrorIAccessorImpl::CreateAccessor CPgCommand::Execute CErrorLookupService::ClearErrorCPgCommand::FillParams CErrorLookupService::ClearErrorICommandTextImpl::GetCommandText IObjectWithSiteImpl::GetSite IAccessorImpl::GetBindingsCPgCommand::Execute error: FillinValues failed CErrorLookupService::ReportCustomError HRES 80040e10: FillinValues failed My guess is that there is a problem with parsing input parameter(s), sinc= e executing procedures without IN parmeters (just OUT) works ok. Can anyone help me? Thank you, --=20 Marko Bo=C5=BEikovi=C4=87 Tellus d.o.o. Tel. +385 1 3691 975 Fax +385 1 3691 976 E-Mail: marko.bozikovic@tellus.hr Ogrizovi=C4=87eva 40a 10000 Zagreb Hrvatska