Page 1 of 1

Error 'Parameter $1 Missing' when I try to create a stored procedure using a pgsqlcommand object

Posted: Wed 22 Mar 2006 23:55
by kcrenshaw
I get the error "Parameter $1 missing' when I try to create a stored procedure using the following code:

cmdStr = New StringBuilder
cmdStr.Append("CREATE OR REPLACE FUNCTION SP_DEL_TASK(TEXT) RETURNS INTEGER AS $$ ")
cmdStr.Append("DECLARE ")
cmdStr.Append("tid ALIAS FOR $1; ")
cmdStr.Append("BEGIN ")
cmdStr.Append("DELETE FROM tasks WHERE tasks.taskid = tid; ")
cmdStr.Append("RETURN 0; ")
cmdStr.Append("END; ")
cmdStr.Append("$$ LANGUAGE 'plpgsql'; ")
Dim str As String = cmdStr.ToString
cmd = New PgSqlCommand(cmdStr.ToString, conn)
cmd.ExecuteNonQuery()

I am using PostgreSQLDirect .NET Data Provider 2.20.

Thanks for your help,

Kevin

Posted: Thu 23 Mar 2006 09:17
by SecureGen
We have fixed the problem. The fix will be available in the next build of PostgreSQLDirect .NET. Watch for announcements in the forum. Thank you for the information.