dear sir
a ="BOUND-B-GEN"
env.workspace = r"E:\Gampaha\51027202\CM51027202.gdb\CM51027202"
newName = arcpy.AddFieldDelimiters(env.workspace, "PCL_LN_DL")
I want to format following style
"PCL_LN_DL" = 'BOUND-B-GEN'
I tried to format following way
where = newName + '=' + '{0}{1}{2}'.format ('\'',str(a),'\'')
But it gives me wrong result, how to add single quote around BOUND-B-GEN
pl help me.
Thanks
Padmasiri
Solved! Go to Solution.
# want: "PCL_LN_DL" = 'BOUND-B-GEN'
# tried:
a ="BOUND-B-GEN"
where = newName + '=' + '{0}{1}{2}'.format ('\'',str(a),'\'')
Try this:
a ="BOUND-B-GEN"
newName = "PCL_LN_DL"
where = '"{}" = \'{}\''.format(newName, a)
# or
where = "\"{}\" = '{}'".format(newName, a)
# or
where = "\"{0}\" = '{1}'".format(newName, a)
# want: "PCL_LN_DL" = 'BOUND-B-GEN'
# tried:
a ="BOUND-B-GEN"
where = newName + '=' + '{0}{1}{2}'.format ('\'',str(a),'\'')
Try this:
a ="BOUND-B-GEN"
newName = "PCL_LN_DL"
where = '"{}" = \'{}\''.format(newName, a)
# or
where = "\"{}\" = '{}'".format(newName, a)
# or
where = "\"{0}\" = '{1}'".format(newName, a)