Hello!
I'm developing an add-in where I'm using ArcGIS Feature Service from Portal that has one layer and some tables related to it. Data is in Postgres database. I would like to know how to query sequence table. Does sequence table has to be added to service for that? Before starting to use feature service I queried sequences like in the code example below:
using (var tbl = f_layer.GetTable())
{
seqs = FaktikaUtils.GetAllSequences(tbl);
}
public static List<string> GetAllSequences(Table Tbl)
{
List<string> seq_lst = new List<string>();
using (Geodatabase gdb = Tbl.GetDatastore() as Geodatabase)
{
if (gdb.GetGeodatabaseType() == GeodatabaseType.RemoteDatabase))
{
var conn = gdb.GetConnector() as DatabaseConnectionProperties;
if (conn.DBMS == EnterpriseDatabaseType.PostgreSQL)
{
QueryDef qd = new QueryDef
{
Tables = "information_schema.sequences",
SubFields = "sequence_name, sequence_catalog, sequence_schema"
};
using (RowCursor cur = gdb.Evaluate(qd, false))
{
while (cur.MoveNext())
{
using (Row row = cur.Current)
{
seq_lst.Add($"{row["sequence_catalog"]}.{row["sequence_schema"]}.{row["sequence_name"]}");
}
}
}
}
}
}
return seq_lst;
}