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$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 strsqlwhere strsql is "Select * from totalRecords" or this is not a good solution?Best,JacekYou need the parentheses after the function name: “select * from totalrecords();"
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$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 strsqlwhere strsql is "Select * from totalRecords" or this is not a good solution?Best,Jacek
Dim dbCon as new ADODB.Connection Dim rst as new ADODB.Recordset Dbcon.connectionstring=”Your connection string goes here!” Dbcon.open Rst.open strsql
pgsql-general by date:
Соглашаюсь с условиями обработки персональных данных