Re: Run Stored procedure - function from VBA
От | Łukasz Jarych |
---|---|
Тема | Re: Run Stored procedure - function from VBA |
Дата | |
Msg-id | CAGv31oe70OFeENRj--2YUqWATXtiHGX7ie=o+WDX4tepzcTPNw@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Run Stored procedure - function from VBA (Rob Sargent <robjsargent@gmail.com>) |
Ответы |
Re: Run Stored procedure - function from VBA
|
Список | pgsql-general |
Thank you Rob,
question is it is the optimal way to run SP from VBA?
Or not?
Best,
Jacek
2018-06-19 1:34 GMT+02:00 Rob Sargent <robjsargent@gmail.com>:
On Jun 18, 2018, at 9:47 AM, Łukasz Jarych <jaryszek@gmail.com> wrote:Hi Guys,i have example function :CREATE OR REPLACE FUNCTION totalRecords ()RETURNS integer AS $total$declaretotal integer;BEGINSELECT 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,JacekYou need the parentheses after the function name: “select * from totalrecords();"
В списке pgsql-general по дате отправления: