Hi.
Adding comments is something worth doing as it can make it a lot easier to debug - something I will blog about soon
The problem is how you have structured your comments.
classstructureid in
(
select
classstructureid
-- description,
-- class_rowstamp,
-- max(starttime) as estimated_last_edit_date
from
You are relying on the carriage returns to stop the comments.
Toad can make that interpretation.
Maximo won't interpret the carriage returns in the same way.
Maximo actually interprets it like this:
select
classstructureid
-- description,
-- class_rowstamp,
-- max(starttime) as estimated_last_edit_date
from
.
when it is read like this you can see that the --description actually comments out the rest of the statement.
If you want to add comments then use the /* comment */
so it could look like one of these:
select
classstructureid
/* description,
*/
/* class_rowstamp,
*/
/* max(starttime) as estimated_last_edit_date
*/
from
so the final SQL statement would be interpreted like this:
select
classstructureid /* description,
*/ /* class_rowstamp,
*/ /* max(starttime) as estimated_last_edit_date
*/ from
this essentially replicate the comment on every line look that you had.
A neater way would be to do this:
select
classstructureid
/* description,
class_rowstamp,
max(starttime) as estimated_last_edit_date
*/
from
so the final SQL statement would be interpreted like this:
select
classstructureid /* description, class_rowstamp, max(starttime) as estimated_last_edit_date
*/ from
best regards,
mark
------------------------------
Mark Robbins
Support Lead/Technical Design Authority / IBM Champion 2017 & 2018 & 2019 & 2020 & 2021
Vetasi Limited
https://www.linkedin.com/pulse/maximo-support-advice-from-non-ibm-engineer-article-mark-robbins/------------------------------
Original Message:
Sent: Sat June 12, 2021 04:47 PM
From: User1971
Subject: SQL comments in WHERE clause: "Invalid condition"
I have a related post here, for anyone who's interested:
Generate WHERE clause from resultset ids?
https://stackoverflow.com/questions/67952593/generate-where-clause-from-resultset-ids
#AssetandFacilitiesManagement
#Maximo