Skip to content

cursor execute raise no_data_found without any exceptions #321

@Gepar

Description

@Gepar

Python 3.12.2
python-oracledb 2.1.1
Oracle 19.3.0.0.0
When cursor execute pl/sql block that raise no_data_found nothing happened.

import oracledb
conn = oracledb.connect("user", "password", "server")
cursor = conn.cursor()
-- no exception!
cursor.execute("begin raise no_data_found; end;")
-- exception
cursor.execute("begin raise CURSOR_ALREADY_OPEN; end;")
-- exception
cursor.execute("begin raise_application_error(-20000, 'user exception'); end;")

Maybe that's because sqlcode of no_data_found > 0.
P.S. cx_oracle 8.3.0 will raise exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
cx_Oracle.DatabaseError: ORA-01403: no data found
ORA-06512: at line 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions