|
POST
|
Here are some results that I pulled from Arcgis Server Log: === else RAISE EXCEPTION SQLSTATE '90001' USING MESSAGE = 'DUP'; return null; SEVERE Dec 12, 2025, 14:36:02 An error occurred. /test_1.MapServer SEVERE Dec 12, 2025, 14:36:02 Error: Underlying DBMS error [ERROR: 504 INSERT CONTEXT: PL/pgSQL function test() line 17 at RAISE (schema1.test_1)::SQLSTATE=P0001] [test_1]. Test01/test_1.MapServer ===else RAISE EXCEPTION SQLSTATE '90001' USING MESSAGE = 'DUP'; return 0; Error: Underlying DBMS error [ERROR: cannot return non-composite value from function returning composite type CONTEXT: PL/pgSQL function test() line 19 at RETURN (schema1.test_1)::SQLSTATE=42804] [test_1]. ===else RAISE EXCEPTION SQLSTATE '90001' USING MESSAGE = 'DUP'; Error: Underlying DBMS error [ERROR: control reached end of trigger procedure without RETURN CONTEXT: PL/pgSQL function test() (schema1.test_1)::SQLSTATE=2F005] [test_1]. ===Without raise dan Without return No error message
... View more
21 hours ago
|
0
|
1
|
27
|
|
POST
|
@JeffSilberberg Yes.. shouldn't be "scema". I just want to show that the table reside in a schema. Thanks Anyway, I did try the code you give me. Still the same behaviour on the Field Map, just like what I have described above. The problem is not with the trigger, but how the Field Map reacts to the trigger.
... View more
Wednesday
|
0
|
2
|
44
|
|
POST
|
Hi @JeffSilberberg The code you provide gives out the same result. Anyway, now I find out behaviour in Field Map this : 1. I enter duplicate value. press SUBMIT 2. Error comes up "Unable to submit. Service error code 500. bla bla" 3. Then without exiting, I edit the value again. Now type in a non-duplicate value. press SUBMIT again 4. Error comes up "Unable to submit. Service error code 500. bla bla" 5. Then I press SUBMIT again straight away. Success. 6. I check the database. The record is there with objectID x+3 What I want is, when I press SUBMIT for the second time (step #3), the record will be inserted without error. The trigger itself is not a problem when executed using database query run from PGADMIN. Thanks FYI, Anyway, these 3 codes give out the same result in postgres: 1.IF (SELECT EXISTS(SELECT FROM scema1.chamber where id = new.id)) = 'false' THEN 2.IF (SELECT EXISTS(SELECT 1 FROM scema1.chamber where id = new.id)) = 'false' THEN 3.IF NOT EXISTS (SELECT 1 FROM schema1.chamber WHERE id = NEW.id) THEN
... View more
Wednesday
|
0
|
4
|
49
|
|
POST
|
Hi @RobertKrisher The database is run locally, not in the cloud. I am planning to move the Arcgis Server out of AWS next year. So this will make both of them rum locally. FYI, I found that the attribute rule (Constraint) in gdb_items. This is the query : select definition from sde.gdb_items where physicalname = 'DB.SCHEMA.TABLE_NAME'. So, does this mean that the Constraint run on the Server Side ? How do you differentiate between attribute rules that run on the Client Side vs Server Side ? Additional: I found 2 good readings : Atributes Rules Tips and Best Practices and Pros Cons Attribute Rules vs Trigger
... View more
Tuesday
|
0
|
1
|
28
|
|
POST
|
The main reason I am worrying too much is that the Portal is hosted on cloud (AWS). FYI, any traffics that enter / leave to / from Portal will generate expenditure for us. I am talking about a really heavy traffic. So, I need to spread the balance between the servers, DB and Portal. I am hoping that the Attribute Validation, if it is runs in the Portal server, is implemented on the DB via Trigger.
... View more
Monday
|
0
|
0
|
85
|
|
POST
|
I might add one more thing : Cons of Arcade Attribute Calculation Rule is: if it uses $datastore in the script and the data is accessed via Feature Service hosted on Cloud (like AWS or AGP), it will generate cost on the cloud usage. "if (id == null || id == "") { return true; }var fs = FeatureSetByName( $datastore, "db1.sch1.FC1", ["Oid", "objectid"], false );
... View more
a week ago
|
0
|
0
|
26
|
|
POST
|
@RobertKrisher "The attribute rule is stored in the geodatabase and is exposed through a validation service to clients" 1. Where can I see the attribute rule in the geodatabase ? 2. What is the validation service looks like ? Is it a some sort of wer services ? I need to see the object.
... View more
a week ago
|
0
|
0
|
165
|
|
POST
|
@RobertKrisher any technical insight regarding why one is better than another one ? I am thinking that database trigger works on Database Tier, whereas the Attribute Validation works on Server Tier. So the the database tier will work better because it is more efficient. But I dont know how this Attribute Validation works in Map Feature Service ? The Attribute Validation never gets published as service but how can it work when one access the data via Map Feature Service ? Where is it stored ? On the other hand, database trigger can be seen as database object in the database. I need more explanation. Thanks
... View more
a week ago
|
0
|
1
|
181
|
|
POST
|
I am just wondering if Attribute Validation is better with Database Trigger or Arcade. Suppose I want to do Attribute Validation about the value of one coloumn that depends on the value of another coloumn OR maybe I want to limit the data entry of a coloumn OR maybe I want to populate a date coloumn automatically. In a scenario in which the data (stored in SDE) have to be accessed by many people via Map / Feature Service, which one is more suitable in term of fastness and reliability ? What are the considerations in choosing a particular method ? Thank you
... View more
a week ago
|
0
|
11
|
270
|
|
POST
|
I have Attribute Validation created in Arcgis Pro. This validation is used to check a coloumn uniqueness. The Feature Class is then published to be consumed by Field Map apps via Feature Service. This is the code : var id = $feature.code_oid; if (id == null || id == "") { return true; } var fs = FeatureSetByName( $datastore, "db1.schema1.FC1", ["code_oid", "objectid"], false ); var oid_self = $feature.objectid; var others = Filter(fs, "code_oid = @ID AND objectid <> @oid_self"); if (Count(others) > 0) { return { "errorMessage": "code_oid already existed." }; } return true; The validation works eventhough it is accessed via Field Map. I am wondering : 1. How can this Attribute Validation be accessed via Field Map ? Where is it actually stored ? 2. "var others = Filter(fs, "code_oid = @ID AND objectid <> @oid_self");" a. can this part be changed to other logic ? More like code refactoring. I am thinking of using a Postgres-like function like "EXISTS" to avoid scanning all rows. b. Can the fields involved in the Filter here (code_oid and objectid) be indexed ? How to index them if they are stored in Datastore? 3. "var fs = FeatureSetByName($datastore,"db1.schema1.FC1",["code_oid", "objectid"],false);" a. Does this mean that the data are stored in the Datastore ? If yes, it will mean that its space will increase as the amount of data increasing. Where to check the physical location of Datastore ? b. Does $datastore acts as pointer to database or it acts as storage of the table itself (ie: the data are copied from database into Arcgis Server) ? Thanks
... View more
2 weeks ago
|
0
|
1
|
172
|
|
POST
|
Hi @CodyPatterson , The only restriction is that it has to be unique. This ID is based on another layer underneath it (the ID of the layer underneath is already unique) and the data have to be entered manually. I have to run this mechanism of entering it manually because I have to do so : the layer underneath is a polyline, whereas the one that I am working is a point layer. One of the points inside a polyline must have the ID of that polyline. The trigger above somehow actually works in Field Map not in a way it is intended. If I enter an ID that is already existed and filled in all other text boxes (there are around 12 questionaires), press SUBMIT, and then that error (that error in the pic above) comes up. After the error, I just *can not simply change* the ID to another unique value and then press SUBMIT again. The same error comes up. But, if I do the entry from the beginning (with all 12 text boxes emptied out), and put in a unique ID, it will work without error. This is pains as I have to fill in all the text boxes again. I have overcome this problem of re-entering-data-from-beginning by employing Attribute Validation, set in Arcgis Pro, below. But this method is rather process heavy because all data are copied into Datastore. If only a few records this method will work fine. (PS: I am curious, where does this validation is stored ? i presume in Arcgis Server ) ::: if (id == null || id == "") { return true; } var fs = FeatureSetByName( $datastore, "db_city.scema1.data1", ["oid_code ", "objectid"], false ); var oid_self = $feature.objectid; var others = Filter(fs, "oid_code = @id AND objectid <> @oid_self"); if (Count(others) > 0) { return { "errorMessage": "id already existed" }; }
... View more
2 weeks ago
|
0
|
0
|
163
|
|
POST
|
I am writing a trigger in Postgresql database so that one particular coloumn can maintain its uniqueness. The idea is to check the data before they are entered. The data are entered via Field Map. So, I write a Function below : CREATE OR REPLACE FUNCTION xxx_check_unique() RETURNS TRIGGER AS $$ BEGIN IF (SELECT EXISTS(SELECT FROM scema1.chamber where id = new.id)) = 'false' THEN RETURN new; //entry the new record else RAISE EXCEPTION SQLSTATE '90001' USING MESSAGE = 'DUP'; return null; //do not entry due to duplication end if; END; CREATE OR REPLACE TRIGGER xx_check_unique BEFORE update of id ON scema1.chamber FOR EACH ROW EXECUTE PROCEDURE xxx_check_unique(); CREATE OR REPLACE TRIGGER xx_check_unique BEFORE insert ON scema1.chamber FOR EACH ROW EXECUTE PROCEDURE xxx_check_unique(); That trigger works using Field Map if I enter an ID that's never been entered before. If the ID entered has existed in the record, then an error comes up : Then, if I want to entry another data, *i have to repeat the process from the very beginning, with all empty coloumns*. I f I just change the ID into another unique ID, the same error message comes up just like the picture above. So, how can I employ such a trigger. FYI, this trigger works in Desktop without error. Thanks
... View more
2 weeks ago
|
0
|
8
|
227
|
|
POST
|
@berniejconnors I made progress, although useless too. LoL I upgrade QGIS to 3.40. Slightly better, but still can not be saved 100%. The geometry (shape) just wont get saved but the record entered the database ! The setup is pretty much the same. I use the WFS Properties 1.1 to be able to apply editing (when saved, there is no error). The other WFS Properties (1.0, 2.0) throw out errors upon saving. See pic below (ignore the "Ignore Axis orientation.." It does not matter if it is checked or not): The attribute settings are as follows : 1. Objectid field 2. the length(shape) attribute settings. I put $length as the default value: 3. Other attribute coloumn such as "Kol1. I put 'I' as the default" The setting of attributes from Arcgis Pro before Map Service is published: 1. The field st_length is set to editable 2. the Share As Web layer properties setting: Dedicated and Enable Transaction. See pic below : Here is the evidence : After a successful connection and adding the layer, I start some editing. Then save the edits. I check the attribute in QGIS. Objectid, shape and Kol1 have values (sorry the Kol1 here is NULL as I forgot to fill in a value). See pic below: As we can see from the above pic, the st_length(shape) gets its length number. That means QGIS can somehow detect the coordinate / projection that is being used in the Map Service. Then I hit SAVE. No errors. This is where the problem starts: the new data get saved but I can not find their geometry, all length are NULL. The Objectid coloumn is changed too, for example, during editing in QGIS it is #405, but then when saved it becomes #808. Does not really matter because arcgis has internal mechanism of inserting OBJECTID. The Kol1 is saved accordingly, as expected. The geometry coloumn just does not get saved. See pic below for the end result: It seems the problem lies in the geometry coloumn. The Arcgis somehow does not get its values from the WFS service.
... View more
3 weeks ago
|
0
|
0
|
128
|
|
POST
|
I have been trying to edit WFS service published from arcgis server. My setup: - Arcgis Enterprise 11.0 - Arcgis Pro 3.0 - Postgresql - QGIS 3.28 I have succesfully published the service. I can read it from QGIS but was unable to save the edit. Here are some screenshots : I have tried some combinations like without success : WFS Option using Version 1.0, 1.1, 2.0, Maximum ; There errors are : about geometry and about unable to insert. The general error looks like the picture below. Another error about geometry with a particular setting :
... View more
3 weeks ago
|
1
|
2
|
207
|
|
POST
|
does anyone have idea ? I am still waiting with high hope. Lol
... View more
09-08-2025
08:49 PM
|
0
|
0
|
294
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 11-25-2024 12:33 AM | |
| 1 | 3 weeks ago | |
| 1 | 11-12-2024 08:22 PM | |
| 1 | 10-13-2024 11:55 PM | |
| 1 | 02-25-2022 05:49 AM |
| Online Status |
Offline
|
| Date Last Visited |
yesterday
|