I'm using a SOAP call to perform an SQL Query and I get this error:
QueryDefinition was unable to queue this task. This query definition is not active
My call :
<RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
<RetrieveRequest>
<ObjectType>QueryDefinition</ObjectType>
<Properties>ObjectID</Properties>
<Properties>Name</Properties>
<Filter xsi:type="ns1:SimpleFilterPart" xmlns:ns1="http://exacttarget.com/wsdl/partnerAPI">
<Property>CustomerKey</Property>
<SimpleOperator>equals</SimpleOperator>
<Value>Scoring-Query-key</Value>
</Filter>
</RetrieveRequest>
</RetrieveRequestMsg>
I found that this error was thrown because I did delete the same SQL query with the same name and customerKey so when I retrieve the ObjectID via the customerKey, there are 3 of them like marketing cloud would have a recycle bin.
"Results":[
{"$":{"xsi:type":"QueryDefinition"},"PartnerKey":[{"$":
{"xsi:nil":"true"}}],"ObjectID":["6fec1e6c-fa87-4016-b67c-b5777d21a17a"],"Name":["AllJobsID"]},
{"$":{"xsi:type":"QueryDefinition"},"PartnerKey":[{"$":
{"xsi:nil":"true"}}],"ObjectID":["0e4969bd-916b-43ad-a237-b5e4733950f1"],"Name":["AllJobsID"]},
{"$":{"xsi:type":"QueryDefinition"},"PartnerKey":[{"$":
{"xsi:nil":"true"}}],"ObjectID":["9b9890db-3934-407e-86f7-f032d166d56c"],"Name":["AllJobsID"]}]}]}]}}
Do you have any idea, how could I delete those ghosts ?