How do I read cx_Oracle.LOB data in Python?

前端 未结 4 614
庸人自扰
庸人自扰 2020-12-31 04:06

I have this code:

    dsn = cx_Oracle.makedsn(hostname, port, sid)
    orcl = cx_Oracle.connect(username + \'/\' + password + \'@\' + dsn)
    curs = orcl.cu         


        
4条回答
  •  盖世英雄少女心
    2020-12-31 04:35

    There should be an extra comma in the for loop, see in below code, i have supplied an extra comma after x in for loop.

    dsn = cx_Oracle.makedsn(hostname, port, sid)
    orcl = cx_Oracle.connect(username + '/' + password + '@' + dsn)
    curs = orcl.cursor()
    sql = "select TEMPLATE from my_table where id ='6'"
    curs.execute(sql)
    rows = curs.fetchall()
    for x, in rows:
        print(x)
    

提交回复
热议问题