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 D7499DA928 for ; Fri, 21 Oct 2005 11:20:11 -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 88362-06 for ; Fri, 21 Oct 2005 14:20:04 +0000 (GMT) Received: from resolution.com (unknown [65.18.201.170]) by svr1.postgresql.org (Postfix) with ESMTP id D2A2ADA8A3 for ; Fri, 21 Oct 2005 11:20:06 -0300 (ADT) Received: (from resolutio@localhost) by resolution.com (8.12.10/8.11.2) id j9LEJrXk028208 for pgsql-sql@postgresql.org; Fri, 21 Oct 2005 10:19:53 -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: <1129904391.4358f90781664@www.resolution.com> Date: Fri, 21 Oct 2005 10:19:51 -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.317 required=5 tests=[AWL=0.089, FORGED_RCVD_HELO=0.05, NO_REAL_NAME=0.178] X-Spam-Level: X-Archive-Number: 200510/274 X-Sequence-Number: 23127 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