I have a sql script called myscript.sql that looks like this:
-- Comment that I have in my sql script.
MERGE INTO my_table i using
(select several_columns
from my_other_table f
where condition
) f on (my join conditions)
WHEN MATCHED THEN
UPDATE SET whatever;
COMMIT;
I have tried to call it from python the same way I do from a SQL Developer worksheet, which is:
cursor().execute(r'''@"path_to_my_script\myscript.sql"''')
But it does not work, the following error is raised:
DatabaseError: ORA-00900: invalid SQL statement
How could I execute the script?