Select to view content in your preferred language

Query Layer and Attribute Table contain different values

394
6
05-21-2024 12:40 AM
Labels (3)
MatthewSmart451
New Contributor II

Hello, I am trying to work out why when I query a table why I get a different result than what is contained in the attribute table? Field I'm interested in is RCODE_NO, ID is unique, and the SQL query is a simple one:

SELECT PIN, ID, RCODE_NO FROM ArcSDE.GISDBA.City_TPS24New WHERE PIN=123998

MatthewSmart451_0-1716276302830.png

MatthewSmart451_2-1716276426459.png

MatthewSmart451_1-1716276323444.png

What I find extremely strange about this is I copied the table into a new Enterprise Geodatabase in Catalog and it seems to work as expected?

MatthewSmart451_7-1716276946660.png

MatthewSmart451_4-1716276740052.png

MatthewSmart451_5-1716276780430.png

 

Any help would be greatly helpful, SQL novice here 😅

Tags (2)
0 Kudos
6 Replies
Bud
by
Honored Contributor
  1. Can you remove the file geodatabase label from this post, since it’s not a file geodatabase? File geodatabases don’t support query layers.
  2. What version of SQL Server?
  3. What version of ArcGIS Enterprise?
  4. What version of Pro?
  5. Are you sure the field you’ve chosen as the unique ID field is truly unique and doesn’t have nulls?
  6. Can you clarify what the problem is? Is the RCODE_NO value wrong in the query layer?
  7. Can you show us a screenshot of the Fields View in ArcGIS Pro for both the underlying database table and the query layer?
0 Kudos
MatthewSmart451
New Contributor II

1. Done
2. Microsoft SQL Server 2017 14.0.3451.2 (Build 14393: )
3. Enterprise 10.8.1
4. ArcPro 3.2.2
5. Upon closer inspection, no the field is not unique and yes there are nulls.
6. The RCODE_NO value in the query layer should be "R60"
7. See below (cannot get query layer field views as the option is greyed out):

MatthewSmart451_0-1716531427382.png

MatthewSmart451_1-1716531445447.png

Is the data versioned?
Yes, traditionally versioned.

0 Kudos
Bud
by
Honored Contributor

My experience is that most query layer problems stem from the unique ID field. Hopefully, if you clean up that field, your issues will go away.

MatthewSmart451
New Contributor II

Will give that a crack, cheers!

0 Kudos
George_Thompson
Esri Notable Contributor

I would also ask if the data is versioned?

--- George T.
MatthewSmart451
New Contributor II

Yes, the feature datasets are both versioned (traditional).

0 Kudos