oracle / python-cx_Oracle

Python interface to Oracle Database now superseded by python-oracledb
https://oracle.github.io/python-cx_Oracle
Other
890 stars 361 forks source link

Execute or Connect with multi_statements #620

Closed hvardhan20 closed 2 years ago

hvardhan20 commented 2 years ago
  1. What versions are you using? 8.3.0
  2. Include a runnable Python script that shows the problem.

    import cx_Oracle
    query = """
    CREATE USER new_user IDENTIFIED BY somepassword;
    GRANT CREATE SESSION TO new_user;
    GRANT SELECT ON dba_users TO new_user;
    """
    connection = cx_Oracle.connect(user=user, password=pass, dsn=dsn)
    with connection:
    with connection.cursor() as cursor:
        cursor.execute(query)

    ORA-00922: missing or invalid option