Blob data from Oracle to text file using python

前端 未结 3 1044
悲哀的现实
悲哀的现实 2021-01-22 10:58

I have been trying to get the blob data from oracle into a text file using Python. I couldn\'t find the answer on any of the other links.

Below is my code :



        
3条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-22 11:10

    Implemented what @blhsing suggested and it worked out perfectly

        for row in cur:
            filename = path +  "notes_" + str(row[0]) + "_" + str(row[1]) + ".txt"      
            print(row[2].read())
            f = open(filename, "wb")
            f.write(row[2].read())
            f.close()        
    

提交回复
热议问题