Forum Discussion
Unable To Apply Query - OLE DB or ODBC error: [Expression:Error] expected a RenameOperations value
- 4 years ago
I'd probably choose to null all fields if there aren't exactly 3.
Something like this:
renamedrecord = if Record.FieldCount(sortedrecord) <> 3 then [Storage_Key = null, Network_Key = null, Condition_Key = null] else Record.RenameFields(sortedrecord, <...existing code here...> )
AlexisOlson I think you're onto something there. There are some instances of thisrecord not having 3 fields.
How can I stop this from preventing me from applying my query to my model though?
- AlexisOlson4 years agoSuper User
Well, if you're missing fields, then it's hard to know how to rename the ones you do have and what to do for the remainder of the query where all three fields are referenced. How should this query work for such cases?
- al3584 years agoFrequent Visitor
Instances where there are not 3 fields are edge cases (years-old entries made under a legacy system, which are unlikely to be included in any analysis).
A cursory glance at the legacy entries suggests there is never fewer than 3 fields, and I'm trying to think of the simplist solution to allow the query to apply to the model, so perhaps always name the first 3 fields as per the current query, and return a null value for subsequent fields?
Would that work? Or can you think of a more elegant solution?
- AlexisOlson4 years agoSuper User
I'd probably choose to null all fields if there aren't exactly 3.
Something like this:
renamedrecord = if Record.FieldCount(sortedrecord) <> 3 then [Storage_Key = null, Network_Key = null, Condition_Key = null] else Record.RenameFields(sortedrecord, <...existing code here...> )