| From: | Łukasz Jarych <jaryszek(at)gmail(dot)com> |
|---|---|
| To: | "pgsql-general(at)postgresql(dot)org >> PG-General Mailing List" <pgsql-general(at)postgresql(dot)org> |
| Subject: | Run Stored procedure - function from VBA |
| Date: | 2018-06-18 15:47:45 |
| Message-ID: | CAGv31odanrcg7zZ3K3jUPOp8kHydvvbO5-rQOxRTNUiwVOpZ-g@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2018-06-18 16:30:13 | Re: What to do when dynamic shared memory control segment is corrupt |
| Previous Message | Sherrylyn Branchaw | 2018-06-18 15:34:11 | What to do when dynamic shared memory control segment is corrupt |