Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor mistake in the example in README #641

Closed
karl-otto opened this issue Jul 7, 2021 · 2 comments
Closed

Minor mistake in the example in README #641

karl-otto opened this issue Jul 7, 2021 · 2 comments

Comments

@karl-otto
Copy link

karl-otto commented Jul 7, 2021

Hello,
I tried to follow your example and recognizes two mistakes around „Tables API“.

  1. Schema name

    The schema is set to db2admin (conn.tables('DB2ADMIN', '%')) and the result should contain the user's table.

    But the connection is done as user db2inst1 and the table is created without specifying a schema. Thus, the table is created in the schema of the user (in this case db2inst1).

    Suggested syntax:

    conn.tables('DB2INST1', '%')
  2. Placement of the example to show access to Tables API

    When one follows along the procedure an empty result is returned. Contrary to the shown output for db2admin.mytable. This is because the table is created in the step after.

    Thus, it would be helpful placing this statement later in the procedure (Suggestion: after inserting values).

  3. [Suggestion] Add a new function call for dropping mytable, so one can redo the example without an error (mytable already exists). Best location would be at the end, just before termination of the connection.

    # Drop table "mytable" using ibm_db
    drop = 'DROP TABLE mytable'
    stmt_delete = ibm_db.exec_immediate(ibm_db_conn, drop)
    # <empty>

Kind regards from Germany

@amukherjee28
Copy link
Member

Hi @karl-otto

Thanks for the suggestion and the observation.

Will take a look into the example and make necessary changes in order to make the user experience better.

amukherjee28 added a commit that referenced this issue Sep 29, 2021
@amukherjee28
Copy link
Member

Suggestion modified to readme file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants