You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I tried to follow your example and recognizes two mistakes around „Tables API“.
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', '%')
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).
[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
The text was updated successfully, but these errors were encountered:
Hello,
I tried to follow your example and recognizes two mistakes around „Tables API“.
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 casedb2inst1
).Suggested syntax:
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).
[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.Kind regards from Germany
The text was updated successfully, but these errors were encountered: