moelgaard

Merge_management and SDE

Discussion created by moelgaard on Nov 10, 2011
Latest reply on Nov 10, 2011 by moelgaard
Hi everyone

I´m having some trouble with arcpy.Merge_management and our SDE datebase (Oracle). I´m trying to merge a group of features read from the SDE back into the SDE like this:

import sys
import time
import arcpy
import arcgisscripting
import os
from arcpy import env

#Create enviroment for Python/ArcPY
env.workspace = "c:\\kmr\\PC2574.sde"
try:
    allFeature = []
    features = arcpy.ListFeatureClasses("SDE.*")
    for feature in features:
        print feature
        desc = arcpy.Describe(feature)
        type = desc.shapeType
        if type == "Polyline":
            fieldMappings.addTable(feature)
            allFeature.append(feature)
           
    mergeTable = "polyline_merge"
    print "Nr of features to merge:" + str(len(allFeature))
    arcpy.Merge_management(allFeature, mergeTable)
    print "Done merging"

The merging is succefull, but it ends up in a database/schema named KMRA (my username - an old testdatabase) - why is that? And do I avoid it?
I´ve even tried:
mergeTable = "SDE.polyline_merge"
mergeTable = "c:\\kmr\\PC2574.sde\\polyline_merge"
mergeTable = "c:\\kmr\\PC2574.sde\\sde.polyline_merge"

Any suggestions/comments is greatly appreciated
/Kaare

Outcomes