Python Forum
How can I run sql file in python?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can I run sql file in python?
#1
Hello,
I have a sql file with ~ 50 lines of update\delete\set commands
everything is config to work according to the router ID
set @ID = (select rou_id from Company1.router where
rou_serial_no like '%SN123456%'); ## put here the Rou Serial number!

delete FROM israel_v7.history_router
where rou_id=@ID and com_id=@OldCompany;
.
.
.
Update Company1.router set Company1.router.ROU_STATE = @State where Company1.router.ROU_ID = @ID;
can I write a python code where I enter the serial_number --> save it as @ID then run the all sql file according to the Serial I have entered?

Thanks,
Reply


Messages In This Thread
How can I run sql file in python? - by korenron - Aug-15-2022, 01:39 PM
RE: How can I run sql file in python? - by korenron - Aug-18-2022, 06:09 AM
RE: How can I run sql file in python? - by korenron - Aug-18-2022, 08:42 AM
RE: How can I run sql file in python? - by korenron - Aug-18-2022, 10:37 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020