I'm building some SQL using constants in Kotlin st...
# intellij
m
I'm building some SQL using constants in Kotlin strings, e.g.
"DELETE FROM ${SCHEMA}.TABLENAME WHERE PK = ?"
, and then preparing statements and injecting values. IntelliJ can't resolve the table ("Unable to resolve table TABLENAME"), and I can't work out how to either (a) tell it not to try for this specific string, or (b) tell it where the table is.
m
So why do you write TABLENAME in the string if the table doesn't have that name?
m
It does, under the appropriate schema.
e.g. Schemas DEV and PROD, both have a table called TABLENAME.
The table name is just an example. Could be anything.
Aha! Found the problem -- I hadn't hit the refresh button on the Database panel after changing the schema.
👍 1
🤦‍♂️