Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

How to Get Rid of Quotes in the SQL expression

$
0
0
I have some codes in my script like this.

Code:

queryList = selectedFids.replace(';', ',')
         
newName = arcpy.AddFieldDelimiters(lyr, "[OBJECTID]")
       
lyr.definitionQuery =  '{0} in ({1})' .format(newName, queryList)

In the second line for AddFieldDElimiters properties I have to use Quotes for [OBJECTID] to work.

In my SQL query I must only use [OBJECTID] without quotes, but quotes come to my query from newName.

I need to get rid of the quotes in the sql query. How can I do that?

Please help me.

Best regards

Babak

Viewing all articles
Browse latest Browse all 2485

Trending Articles