From: Chris Lukenbill <chris@blendinteractive.com>
To: pgsql-sql@postgresql.org
Subject: Can't find which return type is incorrect.
Date: Fri, 11 Aug 2006 09:45:36 -0500
Message-ID: <fdb4b04c0608110745t6dea55aeod40cf8e19a283dc1@mail.gmail.com> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: chris@blendinteractive.com
Subject: Re: Can't find which return type is incorrect.
In-Reply-To: <fdb4b04c0608110745t6dea55aeod40cf8e19a283dc1@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox