Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fV3eB-0007hC-Qu for pgsql-general@arkaria.postgresql.org; Mon, 18 Jun 2018 23:33:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fV3e7-0001Ep-8V for pgsql-general@arkaria.postgresql.org; Mon, 18 Jun 2018 23:33:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fV3e6-0001Ef-Tk for pgsql-general@lists.postgresql.org; Mon, 18 Jun 2018 23:33:15 +0000 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fV3dz-0000Yz-SH for pgsql-general@postgresql.org; Mon, 18 Jun 2018 23:33:14 +0000 Received: by mail-pf0-x242.google.com with SMTP id h12-v6so8944039pfk.11 for ; Mon, 18 Jun 2018 16:33:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=2LFCEKqF5zlg/1BHxbfAZoc+5Yjn9bLpk0SsGcXRUr4=; b=XsQx2eIfa3eZk3xWLDyVDxxe2j5wlGUx9t0immopbPe7QwBSbo6zkhUeQZbtYMK1Pf NUW8ph3tRAqh7oiR2AqMhQ5JC0MaxYgyHj77art7C2dMQKYwfQkwLtrjFF5sfyRxg0Jf YFBktk+V6FjMzjzIpZFb9RmMu6dTvMq02tKG9G24jmFkEqU2/7JuaFKCrMHmGF6HnuN2 eyNYQCM4mNjMyQkn+hRv9pPZLwZlpu32nWkcBoApjgVHheIxKFqlYLVpUdHZSs/SLL5R cthcqZEdszvA22iSBGV2u0rc77kIeTEzg8JVacyUoVnzn+vBeoH0o7BXmkWYvSnxizrf 9VOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=2LFCEKqF5zlg/1BHxbfAZoc+5Yjn9bLpk0SsGcXRUr4=; b=NimlzCSugMRMDdoxNxA3cIdgcRXx3qvI3mfhBxB+5NKXS06Xf7IgNzYSZvOCRxI+X7 NG7RmAAradsD6yCcU5+mq7oocMBukqZtXXtqmt4JG1OkKH8dcBg6bhmk/xbLuaP5rrI2 SzE6U/lhjetv9/2ZfG9P2PN0SViLuWcf5qtFvRLFU6keGLgYlaeMQjPp5MHi5SObFQMG v3e/s9XLJwRMz0TYHcT7daBSlmqheZ6Rn1SAUyQ+5EBxaplqJ8HqivITQ0EkCmKFu+qX Ca4SGT8vGNAy7n3b+ftl42jOH5vyyvfrICBwxmvy7ctkFp3bCSnZcpolCAP52qhj6o8A UkxA== X-Gm-Message-State: APt69E1Ijxf0WcQ+Ao42iHgNpoVvqcgto/Fyd8DdbwiXVpbX9eitqldS CCY+yqqRX1n3iIrz7Hm+JFg= X-Google-Smtp-Source: ADUXVKJg9KiUfOS+DhdaN/WJqp5ozwpcfvtY5EZ/y4TBj0PEUzLta1LK1eHT6yWzJTxgsG7ILIXfUw== X-Received: by 2002:a62:9e0b:: with SMTP id s11-v6mr15572024pfd.198.1529364785000; Mon, 18 Jun 2018 16:33:05 -0700 (PDT) Received: from kitselas.hci.utah.edu ([155.100.47.2]) by smtp.gmail.com with ESMTPSA id r26-v6sm39055293pfj.180.2018.06.18.16.33.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Jun 2018 16:33:04 -0700 (PDT) From: Rob Sargent Message-Id: <445C3ADF-ECBA-4D70-9FE2-5ED62343DAF4@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_634B66ED-BC21-4F15-9E2C-0E5BEBF2A47A" Mime-Version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\)) Subject: Re: Run Stored procedure - function from VBA Date: Mon, 18 Jun 2018 17:33:03 -0600 In-Reply-To: Cc: "pgsql-general@postgresql.org" To: =?utf-8?Q?=C5=81ukasz_Jarych?= References: X-Mailer: Apple Mail (2.3445.6.18) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Apple-Mail=_634B66ED-BC21-4F15-9E2C-0E5BEBF2A47A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jun 18, 2018, at 9:47 AM, =C5=81ukasz Jarych = wrote: >=20 > 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; --Apple-Mail=_634B66ED-BC21-4F15-9E2C-0E5BEBF2A47A Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On Jun 18, 2018, at 9:47 AM, =C5=81ukasz Jarych <jaryszek@gmail.com> = wrote:

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;

= --Apple-Mail=_634B66ED-BC21-4F15-9E2C-0E5BEBF2A47A--