<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How do I list the Schema name of an Element in an SDE database (Newbie Q) in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-do-i-list-the-schema-name-of-an-element-in-an/m-p/160975#M12311</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I think you should already have schema name in child.name string.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Your child name should be something like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

SHEMA.FEATURE_CLASS_NAME

&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So all you need to do is split child.name on dot and get first element of the list.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy

# Create a Describe object
#
desc = arcpy.Describe(r"Database Connections\SDCM_SIS in PRD as 044231 DC.sde")

# Print some Describe Object properties
#

for child in desc.children:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "\tSchema: %s, Table: %s, DataType: %s " % (child.name.split('.')[0], child.name.split('.')[1], child.dataType)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Arek&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 08:28:20 GMT</pubDate>
    <dc:creator>ArkadiuszMatoszka</dc:creator>
    <dc:date>2021-12-11T08:28:20Z</dc:date>
    <item>
      <title>How do I list the Schema name of an Element in an SDE database (Newbie Q)</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-list-the-schema-name-of-an-element-in-an/m-p/160974#M12310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi All&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am new to all this, so thanks for your patience:D.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I used the code below to list the Name and data type of an element in an SDE database.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I really need to do now is identify and write the Schema(element owner) for each element as well, as I have a number of Schemas in the Database.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy

# Create a Describe object
#
desc = arcpy.Describe(r"Database Connections\SDCM_SIS in PRD as 044231 DC.sde")

# Print some Describe Object properties
#

for child in desc.children:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "\t%s,%s" % (child.name,child.dataType)&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 14 Jul 2013 21:59:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-list-the-schema-name-of-an-element-in-an/m-p/160974#M12310</guid>
      <dc:creator>PeteSmyth</dc:creator>
      <dc:date>2013-07-14T21:59:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do I list the Schema name of an Element in an SDE database (Newbie Q)</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-list-the-schema-name-of-an-element-in-an/m-p/160975#M12311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I think you should already have schema name in child.name string.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Your child name should be something like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

SHEMA.FEATURE_CLASS_NAME

&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So all you need to do is split child.name on dot and get first element of the list.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy

# Create a Describe object
#
desc = arcpy.Describe(r"Database Connections\SDCM_SIS in PRD as 044231 DC.sde")

# Print some Describe Object properties
#

for child in desc.children:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "\tSchema: %s, Table: %s, DataType: %s " % (child.name.split('.')[0], child.name.split('.')[1], child.dataType)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Arek&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:28:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-list-the-schema-name-of-an-element-in-an/m-p/160975#M12311</guid>
      <dc:creator>ArkadiuszMatoszka</dc:creator>
      <dc:date>2021-12-11T08:28:20Z</dc:date>
    </item>
  </channel>
</rss>

