You are here: > ESRI Forums > arcsde (9.1 and older) users online discussion forum > Thread Replies

ArcSDE (9.1 and older) Users Online Discussion Forum

ArcSDE: General forum

Geodatabase Domains   Kevin Murphy Mar 18, 2004
Re: Geodatabase Domains   Larry Ahrens Mar 22, 2004
Re: Geodatabase Domains   Steve Lasiter Mar 26, 2004
Re: Geodatabase Domains   Justin Carasick Aug 22, 2005
Re: Geodatabase Domains   Daniela Mathys Sep 06, 2005
Re: Geodatabase Domains   Justin Carasick Sep 06, 2005
Re: Geodatabase Domains   Bruno Lima Oct 07, 2008
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Geodatabase Domains 
Author Kevin Murphy 
Date Mar 18, 2004 
Message After importing our UML model into a SQL Server geodatabase, I realized the domain values are stored in a binary field. First question - is this true? I'm looking at the table gdb_codeddomains in a field called 'CodedValues' and I believe this is where my domain values are being stored. I would appreciate it if someone could confirm this. If this is true, then my second question has to do with accessing these domains. Basically we have a bunch of non-spatial data tables in our geodatabase that we will be building web forms around. The users will use these web forms to populate the tables. But now I'm wondering how I can access the values in the domain tables. I would like to use the domain values to create drop-down or pick lists to ensure data integrity. I feel like I am missing something really obvious here because this is a relatively normal task yet it now seems rather difficult.

Thanks in advance for your help,

Kevin 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Geodatabase Domains 
Author Larry Ahrens 
Date Mar 22, 2004 
Message There are four GDB tables related to domains.
The main table is gdb_domains this contains metadata / pointers for the domain entries.
The ID is used to locate the domain values stored in one of three tables. The domaintype field points to the table where the value to stored.
The three domain types are coded , range and string (GBD_CODEDDOMAINS, GDB_RANGEDOMAINS and GDB_STRINGDOMAINS). It is easy to access the values in the gdb_rangedomains and gdb_stringdomains tables. However, the records stored as coded domains are much more difficult to get at this is because the values are stored in a long raw field. 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Geodatabase Domains 
Author Steve Lasiter 
Date Mar 26, 2004 
Message Anyone know of a tool to bulk import/export domain lists, or compare values with normal tables?

It would be nice to be able to bulk export the domain lists people are using at various GeoBase locations, so that we can standardize the current values. Going forward, we could then push out authorized lists from the CCB between SDS updates that could be bulk imported.

Look-up tables are standard database features. ESRI, please provide a tool to work with your proprietary binary format. Better yet, in version 9 scrap the binary format and use a simple table! 
  Bryan Hall 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Geodatabase Domains 
Author Justin Carasick 
Date Aug 22, 2005 
Message Take a look at the sample code below to read CODEDVALUES from RDBMS. I am using the .Net OracleReader below.

I think the struct is ...

Domain{
NumberOfPairs as Int
Separator(2) as Char
ValueList() as String 'Split using Separator
}


Justin Carasick 
 
Dim var() as Byte
Dim br as BinaryReader
Dim DomainPairs As Int32
Dim Separator() As Char
Dim DomainValueArray() As String

conn.Open()

oDR = oCmd.ExecuteReader
Do While oDR.Read
    var = oDR(0) 'CODEDVALUES COLUMN
    br = New IO.BinaryReader(New IO.MemoryStream var))

    DomainPairs = br.ReadInt32 'Number of Value Pairs
    
    Separator() = br.ReadChars(2) 'Separator
    
    DomainValueArray() = CStr(br.ReadChars br.BaseStream.Length - br.BaseStream.Position)).Split(Separator) 'String Array of Pairs

    Debug.Write("Number of Paired Values: " & DomainPairs & vbCrLf)


    Dim i As Int32
    For i = 0 To DomainPairs
        Debug.Write(DomainValueArray(i) & vbCrLf)
        Debug.Write(DomainValueArray(i + 1) & vbCrLf)
        i += 1
    Next
Loop

oDR.Close()
 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Geodatabase Domains 
Author Daniela Mathys 
Date Sep 06, 2005 
Message We have got the same problem with accessing the values in the domain tables. Also we would like to access the domains to create drop-down lists. The difference: we are working on a oracle database and the website is built with php. Where can we find more information?

Thank you for your help,
Daniela 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Geodatabase Domains 
Author Justin Carasick 
Date Sep 06, 2005 
Message Here is the full code I use. I am not familiar with php but you should be able to convert the code below. I am using Oracle. Simply put, you need to query out the CODEDVALUES column value into a byte array and parse it out.

Justin 
 
Dim conn As New OracleConnection("your connection string")
        Dim oDR As OracleClient.OracleDataReader
        Dim oCmd As New OracleClient.OracleCommand("Select CODEDVALUES FROM SDE.GDB_CODEDDOMAINS WHERE DOMAINID = 106", conn)
        Dim oDa As OracleDataAdapter
        Dim oDs As New DataSet


        conn.Open()

        oDR = oCmd.ExecuteReader
        Do While oDR.Read
            Dim var() As Byte = oDR(0) 'put the column into a byte array
            Dim br As New IO.BinaryReader(New IO.MemoryStream(var))

            Dim DomainPairs As Int32 = br.ReadInt32 'The first integer tells how many pairs there are.
            Dim Separator() As Char = br.ReadChars(2) 'The next 2 chars is the separator
            Dim DomainValueArray() As String = CStr(br.ReadChars(br.BaseStream.Length - br.BaseStream.Position)).Split(Separator) 'Split the remaining into an array using the separator

            Debug.Write("Number of Paired Values: " & DomainPairs & vbCrLf)

            Dim i, j As Int32
            For i = 0 To DomainPairs 'loop through the pairs -- here is where you want to load them to your combobox or use a bind method
                Debug.Write(DomainValueArray(i) & vbCrLf) 'This is your CODE
                Debug.Write(DomainValueArray(i + 1) & vbCrLf) 'This is your DESCRIPTION
                i += 1
            Next
        Loop
        oDR.Close()
 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Geodatabase Domains 
Author Bruno Lima 
Date Oct 07, 2008 
Message Hi Justin.

Your code is very appreciate.
Thank you in advanced!

I can return the domain description but the domain code is not returned.

Can you help me?

 
  System Analyst-Programmer
Microsoft Certified Professional
Microsoft Certified Technology Specialist
Microsoft Certified Professional Developer
Rio de Janeiro/Brazil