this.command.CommandText = "\"GetForeignKeysTable\"";
this.command.CommandType = CommandType.StoredProcedure;
this.command.Parameters.AddWithValue("tableName", resource);
FKDataTable.Load(this.command.ExecuteReader());
네 번째 줄에는 GetForeignKeysTable (tableName : = text)이 없습니다. PosrtgresSQL :매개 변수가 함수에 전달되지 않습니다.
CREATE OR REPLACE FUNCTION "GetForeignKeysTable"(tableName text)
RETURNS TABLE ("FKFieldName" integer, "PKTableName" text) AS $$
BEGIN
RETURN QUERY SELECT "Id", "FIO" FROM tableName;
END;
$$ LANGUAGE plpgsql;
매개 변수는 필드 또는 테이블 이름으로 사용할 수 없습니다. 그들은 where 절의 값을 표현하거나 삽입/업데이트에서 값을 표현하는 데 사용됩니다. – Steve