Re: ODBC, ADO, Return Value from SP problem

From: Shachar Shemesh <psql(at)shemesh(dot)biz>
To: Jeff Eckermann <jeff_eckermann(at)yahoo(dot)com>
Cc: Pavel Stehule <stehule(at)kix(dot)fsv(dot)cvut(dot)cz>, pgsql-general(at)postgresql(dot)org
Subject: Re: ODBC, ADO, Return Value from SP problem
Date: 2004-06-02 16:59:02
Message-ID: 40BE0756.5010005@shemesh.biz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jeff Eckermann wrote:

>--- Pavel Stehule <stehule(at)kix(dot)fsv(dot)cvut(dot)cz> wrote:
>
>
>>Hello
>>
>> I need use ADODB client via ODBC. I can call stored
>>proc
>>without problems. I am sure so proc is called (I am
>>loging params)
>>but retern value is always null.
>>
>>dim cn as new ADODB.Connection()
>>cn.Open("DSN=intra","nepi")
>>Dim cmd As New ADODB.Command
>>Set cmd.ActiveConnection = cn
>>cmd.CommandText = "testcallsp"
>>cmd.CommandType = adCmdStoredProc
>>cmd.Parameters.Referesh()
>>cmd.Parameters(1).Value = 22
>>cmd.Execute()
>>MsgBox cmd.Parameters(0).Value 'only null :-((
>>
>>
>
>A PostgreSQL function is not a stored procedure in the
>same sense as in Oracle or MS SQL Server, for example,
>so you cannot use the syntax you would use for those.
>You need to use normal SQL select syntax, i.e. "select
>testcallsp()", and the return value comes back as a
>recordset (which happens to have one column and one
>row).
>
>
>
I am currently working on an extension to the OLE DB provider that will
support this syntax. It already supports returning multiple rowsets. I'm
hoping to also support the above syntax (no ETA, though).

Mind you, however, that you will have to rewrite the stored procedure a
little for that to work. It will have to be a function returning setof
refcursor for that to work.

Shachar

--
Shachar Shemesh
Lingnu Open Source Consulting
http://www.lingnu.com/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2004-06-02 16:59:05 Re: Creating a session variable in Postgres
Previous Message Richard Huxton 2004-06-02 16:57:35 Re: ORDER BY with plpgsql parameter