Run Stored procedure - function from VBA - Mailing list pgsql-general

From Łukasz Jarych
Subject Run Stored procedure - function from VBA
Date
Msg-id CAGv31odanrcg7zZ3K3jUPOp8kHydvvbO5-rQOxRTNUiwVOpZ-g@mail.gmail.com
Whole thread Raw
Responses Re: Run Stored procedure - function from VBA
Re: Run Stored procedure - function from VBA
List pgsql-general
Hi Guys,

i have example function :

CREATE OR REPLACE FUNCTION totalRecords ()
RETURNS integer AS $total$
declare
total integer;
BEGIN
   SELECT count(*) into total FROM COMPANY;
   RETURN total;
END;
$total$ LANGUAGE plpgsql;

and i want to run it from VBA using odbc connection. 

What is the best way to use it ?

something like this: 

Dim dbCon as new ADODB.Connection
Dim rst as new ADODB.Recordset

Dbcon.connectionstring=”Your connection string goes here!”
Dbcon.open

Rst.open strsql
where strsql is "Select * from totalRecords" or this is not a good solution?

Best,
Jacek

pgsql-general by date:

Previous
From: Sherrylyn Branchaw
Date:
Subject: What to do when dynamic shared memory control segment is corrupt
Next
From: Tom Lane
Date:
Subject: Re: What to do when dynamic shared memory control segment is corrupt