-
Notifications
You must be signed in to change notification settings - Fork 14k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated oracleai_demo.ipynb (#22635)
The outer try/except block handles connection errors, and the inner try/except block handles SQL execution errors, providing detailed error messages for both. try: conn = oracledb.connect(user=username, password=password, dsn=dsn) print("Connection successful!") cursor = conn.cursor() try: cursor.execute( """ begin -- Drop user begin execute immediate 'drop user testuser cascade'; exception when others then dbms_output.put_line('Error dropping user: ' || SQLERRM); end; --------- Co-authored-by: Chester Curme <chester.curme@gmail.com>
- Loading branch information
Showing
1 changed file
with
38 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters