Python Forum
Possible to run Python scripts from oracle?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Possible to run Python scripts from oracle?
#3
Unfortunately, it doesn't display anything different. It seems that an error will occur on the first "command?" line. Example with just print:
Error:
Error report - ORA-27369: job of type EXECUTABLE failed with exit code: 1 File "C:\test.py", line 2 print 'Hello, world!'
(Error code 1 is just the generic "everything else" error code)

With the script I was using:
import sys
import traceback
def main():
   f= open("test.txt","w+")
   for i in range(10):
         f.write("This is line %d\r\n" % (i+1))
   f.close()
if __name__ == '__main__':
    try:
        main()
    except Exception:
        s = ''.join(traceback.format_exc(-3)).replace('\n', ' ')  # or -2
        print(s, file=sys.stderr)
        sys.exit(1)
Gets this:
Error:
Error report - ORA-27369: job of type EXECUTABLE failed with exit code: 1 Traceback (most recent call last): File "C:\test.py", line 10, in <module>
Reply


Messages In This Thread
RE: Possible to run Python scripts from oracle? - by dglass - Sep-06-2018, 03:57 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Trying to us python.exe from our network to run scripts cubangt 3 875 Aug-17-2023, 07:53 PM
Last Post: deanhystad
  Encrypting Oracle Passwords / Python Library for That? bmccollum 1 2,597 Jun-11-2021, 07:59 PM
Last Post: Larz60+
  Running python scripts from github etc pacmyc 7 3,730 Mar-03-2021, 10:26 PM
Last Post: pacmyc
  Calling Oracle REST SQL from Python johnjacob 2 2,048 Nov-05-2020, 04:19 AM
Last Post: johnjacob
  Python to Oracle Conn Issue chvsnarayana 2 39,746 Sep-06-2020, 04:33 PM
Last Post: Larz60+
  Reading SQL scripts from excel file and run it using python saravanatn 2 2,585 Aug-23-2020, 04:49 PM
Last Post: saravanatn
  No Scripts File present after python installation ag2207 5 4,927 Jul-30-2020, 11:11 AM
Last Post: buran
  Conversion of Oracle PL/SQL(packages, functions, procedures) to python modules. DivyaKumar 2 6,517 Jul-09-2020, 04:46 PM
Last Post: srikanth7482
  Load table from Oracle to MYSQL using python himupant94 0 1,652 May-12-2020, 04:50 PM
Last Post: himupant94
  How to merge my two python scripts in one ? HK2432 0 2,162 Jan-31-2020, 10:16 PM
Last Post: HK2432

Forum Jump:

User Panel Messages

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