0
繼執行功能是PostgreSQL
顯示語法錯誤,同時通過代碼
CREATE OR REPLACE FUNCTION funcInsert(iacid int,islno int,idate date) RETURNS int AS
$$
declare id_val int;
BEGIN
INSERT INTO GTAB83 (acid,slno,orderdte) VALUES (iacid,islno,idate) RETURNING orderid into id_val;
return id_val;
END;
$$
LANGUAGE 'plpgsql';
和我的代碼創建的執行使用vb.net
上述功能我Function
是
Dim myCmd As PgSqlCommand = New PgSqlCommand("funcInsert", Myconnstr)
myCmd.CommandType = CommandType.StoredProcedure
myCmd.Parameters.Add("iacid", PgSqlType.Int).Value = cboCust.SelectedValue
myCmd.Parameters.Add("islno", PgSqlType.Int).Value = txtOrderNO.Text
myCmd.Parameters.Add("idate", PgSqlType.Int).Value = txtDate.Text
myCmd.ExecuteScalar()
trans.Commit()
誤差
'LANGUAGE plpgsql' - 不要引用語言名稱(不是主q的答案)。 –