X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 1AADF9FB259 for ; Fri, 11 Aug 2006 11:46:02 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 04496-08 for ; Fri, 11 Aug 2006 14:45:39 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.191]) by postgresql.org (Postfix) with ESMTP id D00C49FB1F5 for ; Fri, 11 Aug 2006 11:45:38 -0300 (ADT) Received: by nf-out-0910.google.com with SMTP id n28so1058732nfc for ; Fri, 11 Aug 2006 07:45:37 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:mime-version:content-type:x-google-sender-auth; b=aSfbp/Wnx50fOrmf7XaC02R5AN42hxJOBN3Inlks+34HqYGCPUrVUM8Kyd2XOh9uT30yMS5KyjrF31rSobBnjh5WCLZTSCLHJNKYsg0+5a3p7NVrVy7ieQZNE//3sd0UZ7L0QjgWpvCR8cdfzrVRyP6BrQc99/tlpzIQeq4dwjA= Received: by 10.49.93.13 with SMTP id v13mr4081355nfl; Fri, 11 Aug 2006 07:45:36 -0700 (PDT) Received: by 10.48.243.15 with HTTP; Fri, 11 Aug 2006 07:45:36 -0700 (PDT) Message-ID: Date: Fri, 11 Aug 2006 09:45:36 -0500 From: "Chris Lukenbill" To: pgsql-sql@postgresql.org Subject: Can't find which return type is incorrect. MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_47072_29426166.1155307536915" X-Google-Sender-Auth: ee900aa189662b74 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.795 tagged_above=0 required=5 tests=HTML_00_10, HTML_MESSAGE, SPF_PASS X-Spam-Level: X-Archive-Number: 200608/82 X-Sequence-Number: 26040 ------=_Part_47072_29426166.1155307536915 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Alright. I have a very large amount of columns being returned by this stored procedure that I ported from MS SQL to Postgres. Now the problem I'm having is that when the select * from sp_whatever(1,0,3) as ( foo int, bar int, etc.) is executed the error "wrong record type supplied in RETURN NEXT CONTEXT". Now this immediately red flagged me to look at the types that I was returning and verify that those were the types that I was catching in the as statement. I went through to verify all of the variables and they are all correct as far as both name and the exact type. Therefore there are only a few things left that I'm thinking could be the problem. 1. Too many variables returned (there are 44 variables being returned). 2. Some of the variables that are smallint in the select statement also do a if isnull type of logic that will return zero if they are null. (is that zero not coming back as a smallint then?) 3. What I'm declaring as a variable type in postgresql isn't the variable type in PHP. The following are the different types of variables that I use: INT SMALLINT BIGINT (when I do a count(*)) VARCHAR(xx) TEXT TIMESTAMP NUMERIC(19,2) Now the two there that I'm skeptical about are the timestamp and the numeric. Thanks ahead of time for any ideas, Chris ------=_Part_47072_29426166.1155307536915 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Alright.  I have a very large amount of columns being returned by this stored procedure that I ported from MS SQL to Postgres.  Now the problem I'm having is that when the select * from sp_whatever(1,0,3) as ( foo int, bar int, etc.) is executed the error "wrong record type supplied in RETURN NEXT CONTEXT".  Now this immediately red flagged me to look at the types that I was returning and verify that those were the types that I was catching in the as statement.  I went through to verify all of the variables and they are all correct as far as both name and the exact type.  Therefore there are only a few things left that I'm thinking could be the problem.

1. Too many variables returned (there are 44 variables being returned).
2. Some of the variables that are smallint in the select statement also do a if isnull type of logic that will return zero if they are null.  (is that zero not coming back as a smallint then?)
3. What I'm declaring as a variable type in postgresql isn't the variable type in PHP.  The following are the different types of variables that I use:
INT
SMALLINT
BIGINT (when I do a count(*))
VARCHAR(xx)
TEXT
TIMESTAMP
NUMERIC(19,2)


Now the two there that I'm skeptical about are the timestamp and the numeric.

Thanks ahead of time for any ideas,
Chris

------=_Part_47072_29426166.1155307536915--