Hi colleagues, Can you help me with this? I know that here are the most of discussion about this problem, but i can not solve it. I red that i have to use SET NOCOUNT ON; but it does not work
this is my script , which works in sql, but when i run his in python i get "This result object does not return rows. It has been closed automatically "
This script is saved aj sql1.sql , i use it in this
this is my script , which works in sql, but when i run his in python i get "This result object does not return rows. It has been closed automatically "
This script is saved aj sql1.sql , i use it in this
from sqlalchemy import create_engine engine = create_engine() f = open("sql1.sql", 'r') df = pd.read_sql(f.read(),engine)This is not python but SQL , it is sql1.sql
--update num2 declare v_temp_date Date := '01.01.1900'; begin for c in ( select t.r1, t.date1, t.num1, t.num3 from table t order by t.r1, t.num1 ) loop if c.num1 = 1 or c.date1 >= v_temp_date then update table x set x.num2 = 0 where x.num3 = c.num3; --v_go := True; v_temp_date := c.date1 + 90; elsif c.date1 < v_temp_date then update table x set x.num2 = 1 where x.num3 = c.num3; end if; commit; end loop; end;
Output:ResourceClosedError: This result object does not return rows. It has been closed automatically.