ODBC int2 parameters to pg function

From: Gary Doades <gpd(at)cwcom(dot)net>
To: pgsql-odbc(at)postgresql(dot)org
Subject: ODBC int2 parameters to pg function
Date: 2004-03-10 16:00:18
Message-ID: 08eu40du2j0hjmc1k36a3k5m73moqm34n9@4ax.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

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.

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Ing. Jeanneth Zuniga 2004-03-10 22:56:30 problemas de conexion de posgresql con oracle
Previous Message Luís Eduardo Jason Santos 2004-03-10 15:59:05 Raise Notice