¿Alguna vez te has sentido extremadamente molesto por los valores del dominio de atributos que no están alfabetizados o en algún orden específico? Se podría argumentar que es tu culpa por no crear los valores del dominio en el orden correcto cuando lo hiciste, pero.....<\/P>
<\/P>
¡HAY una manera de actualizar los valores del dominio para que se muestren a los usuarios finales de la forma que desees! <\/P>
Supongamos que tienes un dominio titulado "District". Para ver cómo se ve en XML:<\/P>
Select DEFINITION FROM [dbo].[GDB_ITEMS]WHERE NAME = 'District'<\/PRE><\/P>Y haz clic en el valor en el campo definición en los resultados. <\/P><\/P><\/P><GPCodedValueDomain2 xmlns:xsi="<\/SPAN>http:\/\/www.w3.org\/2001\/XMLSchema-instance<\/A>" xmlns:xs="<\/SPAN>http:\/\/www.w3.org\/2001\/XMLSchema<\/A>" xmlns:typens="<\/SPAN>http:\/\/www.esri.com\/schemas\/ArcGIS\/10.0<\/A>" xsi:type="typens:GPCodedValueDomain2"><\/SPAN> <DomainName>District<\/DomainName> <FieldType>esriFieldTypeString<\/FieldType> <MergePolicy>esriMPTDefaultValue<\/MergePolicy> <SplitPolicy>esriSPTDefaultValue<\/SplitPolicy> <Description>Desc<\/Description> <Owner>DBO<\/Owner> <CodedValues xsi:type="typens:ArrayOfCodedValue"> <CodedValue xsi:type="typens:CodedValue"> <Name>North District<\/Name> <Code xsi:type="xs:string">ND<\/Code> <\/CodedValue> <CodedValue xsi:type="typens:CodedValue"> <Name>South District<\/Name> <Code xsi:type="xs:string">SD<\/Code> <\/CodedValue> <CodedValue xsi:type="typens:CodedValue"> <Name>Cades Cove District<\/Name> <Code xsi:type="xs:string">CC<\/Code> <\/CodedValue> <\/CodedValues><\/GPCodedValueDomain2><\/PRE>Lo que quiero ver son los valores y códigos ordenados alfabéticamente, lo cual no ocurre. Primero, un poco de magia con Excel. Usando la herramienta Domain to Table, he exportado el Dominio a una hoja de cálculo de Excel. Luego realicé mi ordenamiento.<\/P><\/P><\/P><\/P>Luego algunos cálculos de campo. Aquí estoy usando texto plano para el elemento XML y referencias de celda para el CÓDIGO y VALOR. <\/P><\/P>= "<CodedValue xsi:type=\"\"typens:CodedValue\"\"><Name>"&B2& ; "</Name>< ;Code xsi:type=\"\"xs:string\"\"> ; "& ; A2& ; "</Code> ; </CodedValue> ; "< /PRE >< P >< / P >< P > Nota cómo la fórmula está toda en una línea sin retornos de carro. ¡De lo contrario, cuando pegues el resultado, se agregarán comillas donde no las quieres! < / P >< P >< / P >< P >< IMG alt = "eeeee.JPG " class = "jive-image image-2 " height = "83 " src = "https /us.v-cdn.net/6038851/uploads/legacyfs/online/45908_eeeee.JPG " style = "height: 83px ; width: 887.241379310345px ; " width = "887 " \/ >< / P >< P >< / P >< P > Ahora actualiza la definición XML pegando los resultados de la fórmula de Excel para reemplazar los elementos XML (¡SÓLO!): < / P >< P >< / P >< PRE class = "lia-code-sample line-numbers language-none " > UPDATE [dbo].[GDB_ITEMS]SET DEFINITION = '< ; GPCodedValueDomain2 xmlns:xsi = " < / SPAN >< A class = "jive-link-external-small " href = "http://www.w3.org/2001/XMLSchema-instance " rel = "nofollow noopener noreferrer " target = "_blank " > http://www.w3.org/2001/XMLSchema-instance < / A >< SPAN > " xmlns:xs = " < / SPAN >< A class = "jive-link-external-small " href = "http://www.w3.org/2001/XMLSchema " rel = "nofollow noopener noreferrer " target = "_blank " > http://www.w3.org/2001/XMLSchema < / A >< SPAN > " xmlns:typens = " < / SPAN >< A class = "jive-link-external-small " href = "http://www.esri.com/schemas/ArcGIS/10.0 " rel = "nofollow noopener noreferrer " target = "_blank " > http://www.esri.com/schemas/ArcGIS/10.0 < / A >< SPAN > " xsi:type = "typens:GPCodedValueDomain2">< / SPAN > < ; DomainName > ; District & lt ; / DomainName & gt ; < ; FieldType & gt ; esriFieldTypeString & lt ; / FieldType & gt ; < ; MergePolicy & gt ; esriMPTDefaultValue & lt ; / MergePolicy & gt ; < ; SplitPolicy & gt ; esriSPTDefaultValue & lt ; / SplitPolicy & gt ; < ; Description & gt ; Desc & lt ; / Description & gt ; < ; Owner & gt ; DBO & lt ; / Owner & gt ; < ; CodedValues xsi:type=\"typens:ArrayOfCodedValue\">< ; CodedValue xsi:type=\"typens:CodedValue\">< ; Name & gt ; Cades Cove District & lt;/ Name & gt ;< ; Code xsi:type=\"xs:string\">;CC</ Code & gt;;& lt;/ CodedValue & gt;;<;CodedValue xsi:type=\"typens:CodedValue\">;& lt;;Name>;North District</ Name >& lt;;Code xsi:type=\"xs:string\">ND</ Code >& lt;;/ CodedValue >&<;CodedValue xsi:type=\"typens:CodedValue\">;< Name >South District</ Name >& lt;;Code xsi:type=\"xs:string\">SD</ Code >& lt;;/ CodedValue >& </ CodedValues >&</ GPCodedValueDomain2 >&'WHERE NAME = 'District'< / PRE >< P >< IMG alt =
Did the table get renamed? My EGDB does not have a table dbo.GDB_ITEMS.
I am at 10.9 and it's now in a table called "sde.GDB_ITEMS".
The reason I am searching for it is because I can't get permission to save a new value in ArcGIS Pro.
If I can edit it in SQL Server Studio and reorder the items at the same time, that is acceptable.
I wonder how ThomasColson’s technique would work for Oracle geodatabases, since the DEFINITION column is stored as a CLOB, not text (but available as text in a view). I guess we could just convert our modified XML to a CLOB using an SQL query, then use SQL to UPDATE the table value?
Los miembros registrados pueden publicar, seguir actualizaciones y más. ¿Nuevo aquí? Regístrate gratis.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.