I have dynamic SQL in my SAP HANA Cloud procedure. When I call the procedure in HANA database explorer, it works. But when I call the procedure from Python using SQLAlchemy, the dynamic SQL is not executed.
v_sql :=
'UPDATE "T_TABLE" PARTITION(' || v_part_id || ') ' ||
'SET STATUS = ''' || v_status_done || '''' ||
', STATUS_TST = ''' || v_statusUpdateTime || '''' ||
' WHERE STATUS = ''' || v_status_proc || ''';';
EXECUTE IMMEDIATE(:v_sql);
Call from Python:
self.engineCalc.raw_connection().cursor().callproc(self.PR_PROCESS_DATA, [0])
What is the problem and how can I make it work?
I checked – other parts of the procedure work, but not the dynamic SQL. If I change the dynamic SQL to normal SQL statement, it also works.
1