Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dGslJ-0003Jk-Jq for pgsql-sql@arkaria.postgresql.org; Fri, 02 Jun 2017 20:01:33 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dGslI-00071A-G9 for pgsql-sql@arkaria.postgresql.org; Fri, 02 Jun 2017 20:01:32 +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.84_2) (envelope-from ) id 1dGskI-0005GJ-Or for pgsql-sql@postgresql.org; Fri, 02 Jun 2017 20:00:31 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dGskF-00083m-Fk for pgsql-sql@postgresql.org; Fri, 02 Jun 2017 20:00:30 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id EE59A2075C; Fri, 2 Jun 2017 16:00:25 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute6.internal (MEProxy); Fri, 02 Jun 2017 16:00:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=02sxfED44eRHOO07Wj f2UlhvupywWx6cvH83iKawMHM=; b=A6J47Zsn98DHLC5MsGJv0oN6zVSM7QnJjF 9vyFvs1D4ft4EbT+xxNOzESj0gKrJ7S2djlixJ8i/POk/M7KY9ZSW6euwckY5bPh hMF5nqth8QUrejVNg9zHIlDSenH4pVvBIhOczFTYS1cZcqoSfSCRBZoK1fwUGzao 87mRVZhflxa39cBiW1x2g6OTg4876nkjz1Fudxr8r5rcrO5QP9KAO6EhxPQJeWQn 9MfZHa/+HrcwrweBnp1zaSQGtsMvbjCCBVgAwZhgY7TgIlWXXtMmYb+EPkSVsCnu zih/+zmJ9mpNMsly3+sDdRrYZWLkKIL7LS1bLb/0Q+oB1YjF+eEw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=02sxfED44eRHOO07Wjf2UlhvupywWx6cvH83iKawMHM=; b=Aqag5iTd BJppoQjbnNTHXFxqraPdC6YRtXQAJiE6QEjTy92U2yzRT0eOEekH6V1PQj2EVncx +VFxoQZV2+DylOWKftOZUqqbRaa9rE0TEISwg0H1pUscR/whiUHtHuNNDqkEPqKN RVcWK0KDESJctubIRlJ7PRSZ+YFdiLQO9ciwhevSDu65HFLHZuXKi9k0pqGFm0XK q0tp6cXqGcpX1sWwMRh6T/xlMlbghNAtdsVK6tdlYjzvGNwURaseJcT5ZkDVYMyB dGDPC9adCjD/eMMd165cNwkA24CbMZYlEUwlUHksRNUAt43BSwFCdEp2ht23MyXd Lj9/bI0C6NkRqQ== X-ME-Sender: X-Sasl-enc: C6qcbmxFUwBMKx/+EQLvYzCYZBMX4cyexsgLzIwjEYI7 1496433625 Received: from [192.168.1.2] (75-172-126-41.tukw.qwest.net [75.172.126.41]) by mail.messagingengine.com (Postfix) with ESMTPA id 3832924009; Fri, 2 Jun 2017 16:00:25 -0400 (EDT) Subject: Re: YNT: Re: Using bind variable within BEGIN END To: gulsumramazanoglu , "David G. Johnston" , anand086 Cc: "pgsql-sql@postgresql.org" References: From: Adrian Klaver Message-ID: Date: Fri, 2 Jun 2017 13:00:24 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org On 06/02/2017 11:38 AM, gulsumramazanoglu wrote: > ... which will pass arguments and get back a result set, i mean.. Using Python and psycopg2: \df billing_days List of functions Schema | Name | Result data type | Argument data types | Type --------+--------------+--------------------------+--------------------------------+-------- public | billing_days | TABLE(billing_date date) | start_date date, end_date date | normal select * from billing_days('05/01/2017', '05/30/2017'); billing_date -------------- 2017-05-01 2017-05-02 2017-05-03 2017-05-04 2017-05-05 2017-05-08 2017-05-09 2017-05-10 2017-05-11 2017-05-12 2017-05-15 2017-05-16 2017-05-17 2017-05-18 2017-05-19 2017-05-22 2017-05-23 2017-05-24 2017-05-25 2017-05-26 2017-05-29 2017-05-30 import psycopg2 con = psycopg2.connect('dbname=**** user=***_admin host=localhost') bill_cur = con.cursor() bill_cur.execute("SELECT * FROM billing_days(%s, %s)" , ('05/01/2017', '05/31/2017')) bill_rs = bill_cur.fetchall() for row in bill_rs: print(row[0]) 2017-05-01 2017-05-02 2017-05-03 2017-05-04 2017-05-05 2017-05-08 2017-05-09 2017-05-10 2017-05-11 2017-05-12 2017-05-15 2017-05-16 2017-05-17 2017-05-18 2017-05-19 2017-05-22 2017-05-23 2017-05-24 2017-05-25 2017-05-26 2017-05-29 2017-05-30 2017-05-31 > > > > Samsung cihazımdan gönderildi -- Adrian Klaver adrian.klaver@aklaver.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql