[Python] Reading SQL query using Polars and cx_Oracle gives error

Discussão em 'Python' iniciado por Stack, Maio 21, 2025.

  1. Stack

    Stack Membro Participativo

    I'm trying to read a SQL-query using the python library Polars. Firstly, I establish a connection using the cx_Oracle library as follows:

    import polars as ps
    import cx_Oracle as oracle

    user = XXX
    host = XXX
    port = XXX
    service_name = XXX
    password = XXX
    dsnStr = oracle.makedsn(host, port, service_name)
    gds_con = oracle.connect(user, password, dsnStr)

    query = XXX


    Then, I want to make use of Polars:

    result = ps.read_database(query, gds_con)


    But the latter results in the following error:

    'cx_Oracle.Connection' object has no attribute 'split'


    How can this issue be resolved?

    Continue reading...

Compartilhe esta Página