PostgreSQL Function: Invalid Datatype: double
Posted: Thu 17 Mar 2011 18:26
I've got a PostgreSQL plpgsql function that I'm having trouble calling with LINQ to SQL. The actual function is more complex than the attached, but I've reproduced the same problem with the simple test here.
Latest version of LinqConnect downloaded yesterday.
What am I doing wrong?
Stack Trace:
plpgsql function:
Generated by EntityDeveloper:
My client code:
Latest version of LinqConnect downloaded yesterday.
What am I doing wrong?
Stack Trace:
Code: Select all
System.InvalidOperationException: Invalid datatype: double
at Devart.Data.PostgreSql.Linq.Provider.a.a(String A_0, Boolean A_1)
at Devart.Data.PostgreSql.Linq.Provider.b.a.a(String A_0)
at Devart.Data.Linq.Provider.Query.v.a(MethodCallExpression A_0, MetaFunction A_1)
at Devart.Data.Linq.Provider.Query.v.a(MethodCallExpression A_0)
at Devart.Data.Linq.Provider.Query.v.b(MethodCallExpression A_0)
at Devart.Data.Linq.Provider.Query.v.j(Expression A_0)
at Devart.Data.Linq.Provider.Query.v.i(Expression A_0)
at Devart.Data.Linq.Provider.DataProvider.BuildQuery(Expression query)
at Devart.Data.Linq.Provider.DataProvider.Devart.Data.Linq.Provider.IProvider.Execute(Expression query)
at Devart.Data.Linq.DataContext.ExecuteMethodCall(Object instance, MethodInfo methodInfo, Object[] parameters)
at Db.DbDataContext.MainTestFunction(Nullable`1 DParam) in d:\devl\restoration-postgresql\source\utility\sqlservertopostgresql\sqlservertopostgresql\datacon
text.designer.cs:line 249
at SQLServerToPostgreSQL.MainWindow.CtlTransfer_Click(Object sender, RoutedEventArgs e) in D:\DevL\Restoration-PostgreSQL\Source\Utility\SQLServerToPostgreSQL\SQLServerToPostgreSQL\MainWindow.xaml.cs:line 48
plpgsql function:
Code: Select all
CREATE OR REPLACE FUNCTION main.test_function(d_param double precision)
RETURNS void AS
$BODY$
DECLARE
BEGIN
RAISE LOG 'dParam=%', d_param;
RETURN;
END;
$BODY$
LANGUAGE plpgsql VOLATILE
COST 100;
Code: Select all
///
/// There are no comments for MainTestFunction in the schema.
///
[Function(Name=@"main.test_function")]
public System.Int32 MainTestFunction([Parameter(Name="d_param", DbType="double precision")] System.Nullable DParam)
{
IExecuteResult _MainTestFunctionResult = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), DParam);
return ((System.Int32)(_MainTestFunctionResult.ReturnValue));
}
My client code:
Code: Select all
try {
Db.DbDataContext dc = new Db.DbDataContext();
dc.MainTestFunction( 1.0 );
}
catch( Exception ex ) {
Log.LogItem( ex );
}