X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 388898BA0D9 for ; Thu, 17 Feb 2005 20:35:07 +0000 (GMT) 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 34721-09 for ; Thu, 17 Feb 2005 20:35:00 +0000 (GMT) Received: from nationalbackgrounddata.net (mail.nationalbackgrounddata.net [209.208.46.123]) by svr1.postgresql.org (Postfix) with SMTP id 92D588B9FDA for ; Thu, 17 Feb 2005 20:35:00 +0000 (GMT) Received: (qmail 23769 invoked from network); 17 Feb 2005 20:39:10 -0000 Received: from pc-00053 (HELO [192.168.1.53]) (192.168.1.53) by mail.nationalbackgrounddata.net (192.168.1.33) with ESMTP; 17 Feb 2005 20:39:08 -0000 Message-ID: <4214FDD6.3070609@nationalbackgrounddata.com> Date: Thu, 17 Feb 2005 15:25:58 -0500 From: Chari Clark User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-admin@postgresql.org, pgsql-novice@postgresql.org Subject: PostgreSQL Errors... Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200502/180 X-Sequence-Number: 16348 I created the following statement: CREATE TYPE get_item_info_type AS (full_name varchar(300),dob varchar(300)); CREATE OR REPLACE FUNCTION sp_items(int8) RETURNS get_item_info_type AS ' DECLARE in_id items.item_no%TYPE; BEGIN select coalesce(full_name, '') as fullname, coalesce(dob, '') as dob from items where item_no = in_id ; RETURN; END; ' LANGUAGE 'plpgsql'; This statement compiles fine, but when calling the funtion from a SELECT statement for a specific item, I get the following error message: select * FROM sp_items('85000000000001'); ERROR: return type mismatch in function returning tuple at or near ";" CONTEXT: compile of PL/pgSQL function "sp_aliases" near line 14 In order to return fullname and dob, I'm not sure if the data type for sp_items needs to match the get_item_info_type or what. I think this is my last hurdle, so any help would be over-greatly appreciated. Thanks, -- Chari Clark Database Administrator National Background Data, LLC A First Advantage Company (NASDAQ: FADV) 352.629.9913 cclark@nationalbackgrounddata.com www.nationalbackgrounddata.com