pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gary Doades <gpd@cwcom.net>
To: pgsql-odbc@postgresql.org
Subject: ODBC int2 parameters to pg function
Date: Wed, 10 Mar 2004 16:00:18 +0000
Message-ID: <08eu40du2j0hjmc1k36a3k5m73moqm34n9@4ax.com> (raw)

I have discovered a problem with passing parameters to a pg function
using the ODBC driver.

I have delcared a pg function as:

function GENERATE_TIMESHEETS(timestamp,timestamp,smallint,smallint)
....

I have a .NET program that uses the following:
cmd.CommandText = "SELECT GENERATE_TIMESHEETS(?,?,?,?)";
cmd.Parameters.Add("DATE_FROM",OdbcType.DateTime,8);
cmd.Parameters.Add("DATE_TO",OdbcType.DateTime,8);
cmd.Parameters.Add("TIME_FROM",OdbcType.SmallInt,2);
cmd.Parameters.Add("TIME_TO",OdbcType.SmallInt,2);

I then assign the parameter values and execute the statement.

pg returns an error stating
GENERATE_TIMESHEETS(timestamp,timestamp,int4,int4) cannot be found

It appears that the ODBC driver is not typecasting the smallint (int2)
parameters correctly for the function call.

Can anyone shed any light on this?

Thanks
Gary.




view thread (7+ messages)  latest in thread

Message-ID: <08eu40du2j0hjmc1k36a3k5m73moqm34n9@4ax.com>
Permalink:  ../08eu40du2j0hjmc1k36a3k5m73moqm34n9@4ax.com/
Also on:    postgresql.org/message-id/08eu40du2j0hjmc1k36a3k5m73moqm34n9@4ax.com

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: gpd@cwcom.net
  Subject: Re: ODBC int2 parameters to pg function
  In-Reply-To: <08eu40du2j0hjmc1k36a3k5m73moqm34n9@4ax.com>
  References: <08eu40du2j0hjmc1k36a3k5m73moqm34n9@4ax.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