X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 465CDDA949 for ; Thu, 20 Oct 2005 19:02:32 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 35990-01 for ; Thu, 20 Oct 2005 22:02:25 +0000 (GMT) Received: from resolution.com (unknown [65.18.201.170]) by svr1.postgresql.org (Postfix) with ESMTP id F41D0DA943 for ; Thu, 20 Oct 2005 19:02:24 -0300 (ADT) Received: (from resolutio@localhost) by resolution.com (8.12.10/8.11.2) id j9KM22O4028299 for pgsql-sql@postgresql.org; Thu, 20 Oct 2005 18:02:02 -0400 From: gurkan@resolution.com X-Authentication-Warning: resolution.com: resolutio set sender to gurkan@resolution.com using -f To: pgsql-sql@postgresql.org Subject: SQL Functions Message-ID: <1129845720.435813d85303b@www.resolution.com> Date: Thu, 20 Oct 2005 18:02:00 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: IMP/PHP IMAP webmail program 2.2.8 X-Originating-IP: 216.63.139.105 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.308 required=5 tests=[AWL=0.130, NO_REAL_NAME=0.178] X-Spam-Level: X-Archive-Number: 200510/271 X-Sequence-Number: 23124 I have been trying to find a way to return more than one but different types of variables. How do I return more than one but mix types of variables. Any help is appriaciated. Thanks; CREATE FUNCTION allMoney_con(integer,integer,date,date) RETURNS ???? AS ' SELECT DISTINCT(inv_accts.id), inv_accts.description, inv_accts.amtReceived, consultant.lastname, consultant.firstname, consultant.unumber, officeDef.name, companyDef.abbreviation, inv_accts.dateReceived, employee.firstname, employee.lastname, inv_accts.type, contractDef.phase_id FROM dbuser as consultant, employee, inv_accts, officeDef, employee_offices, companyDef, acctDef, inv_contracts, contractDef, invention WHERE consultant.id = employee.user_id AND consultant.id = employee_offices.user_id AND officeDef.id = employee_offices.office_id AND invention.company_id = companyDef.id AND inv_accts.inv_id = inv_contracts.inv_id AND invention.id = inv_contracts.inv_id AND inv_contracts.con_id = consultant.id AND consultant.id = $1 AND invention.id = $2 --AND inv_accts.dateReceived BETWEEN $3 AND $4 AND inv_accts.acct_id = acctDef.id AND acctDef.contract_id = inv_contracts.contract_id AND inv_accts.type NOT LIKE ''DISCOVER%'' AND ( (acctDef.description LIKE ''%PAYMENT%'' --AND acctDef.description NOT LIKE ''3\\%%'' AND strpos(acctDef.description, ''3%'') = 0 AND acctDef.description NOT LIKE ''%DROP SELL%'' ) OR inv_accts.type LIKE ''%BOUNCED CHECK%'' OR inv_accts.description LIKE ''%BC%'' OR inv_accts.type = ''REFUND'' ) AND contractDef.id = inv_contracts.contract_id AND contractDef.id = acctDef.contract_id ORDER BY officeDef.name ASC, consultant.lastname ASC, inv_accts.dateReceived ASC; ' LANGUAGE SQL; ------------------------------------------------- This mail sent through IMP: www.resolution.com