When using the '__startswith' modifier on Oracle DB, the data type of the automatically generated CAST function is only converted to 'VARCHAR' with no length, resulting in the following error.
ORA-00906: Left parenthesis missing
ex.)
async def get_counter(self, current_date):
result = await (
MY_TABLE
.filter(create_dtm__startswith=current_date)
.annotate(count=Count("*"))
.group_by("status")
.values("status", "count")
)
return result
actual query like that.
SELECT "RESULT" "status",COUNT(*) "count" FROM "MY_TABLE" WHERE CAST("DATETIME" AS VARCHAR) LIKE '20230829%' ESCAPE '\' GROUP BY "RESULT"
When using the '__startswith' modifier on Oracle DB, the data type of the automatically generated CAST function is only converted to 'VARCHAR' with no length, resulting in the following error.
ORA-00906: Left parenthesis missing
ex.)
actual query like that.
SELECT "RESULT" "status",COUNT(*) "count" FROM "MY_TABLE" WHERE CAST("DATETIME" AS VARCHAR) LIKE '20230829%' ESCAPE '\' GROUP BY "RESULT"