A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/oracle/python-oracledb/issues/128 below:

Using "batcherrors=True" raises a ORA-03137 exception · Issue #128 · oracle/python-oracledb · GitHub

  1. What versions are you using?

oracle database: 19c
platform.platform: Windows-10-10.0.19044-SP0
sys.maxsize > 2**32: True
platform.python_version: 3.10.9
oracledb.version: 1.2.1

  1. Is it an error or a hang or a crash?

I'm not sure, I'd say it is an error and a hang. For details see 3.

  1. What error(s) or behavior you are seeing?

cur.executemany() raises the following error if batcherrors=True. But with batcherrors=False or even catching the exception and doing nothing with it, the query completes and data is inserted.
I also have found another issue, where cur.executemany() simply hangs forever with batcherrors=False but is also showing the same errormessage when turning batcherrors back on. Unfortunately I have not been able to completely reproduce this error in a smaller factor, which resulted in this example (5.), but I still believe they are related. The only difference between this example and the other one (which is not shown here because it is simply to big) is that with batcherrors=False this example (5.) completes, while the other one hangs.

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
..\mobile-env\lib\site-packages\oracledb\cursor.py:439: in executemany
    self._impl.executemany(self, num_execs, bool(batcherrors),
src\oracledb\impl/thin/cursor.pyx:158: in oracledb.thin_impl.ThinCursorImpl.executemany
    ???
src\oracledb\impl/thin/protocol.pyx:383: in oracledb.thin_impl.Protocol._process_single_message
    ???
src\oracledb\impl/thin/protocol.pyx:384: in oracledb.thin_impl.Protocol._process_single_message
    ???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   ???
E   oracledb.exceptions.DatabaseError: ORA-03137: TTC-Paket in falschem Format abgelehnt: [kpoal8Check-3] [32768] [0] [0x000000000] [527656] [] [] []

src\oracledb\impl/thin/protocol.pyx:377: DatabaseError
  1. Does your application call init_oracle_client()?

No. (Thin mode)

  1. Include a runnable Python script that shows the problem.
import oracledb

# replace with your connection
conn = oracledb.connect(<TO_BE_FILLED>)

features = ["Sirene"]
typeObj = conn.gettype("FEATURES_TYPE")
if features:
    featureObj = typeObj.newobject(features)
else:
    featureObj = None

cur = conn.cursor()
# declaring object types as stated in discussion #127 
cur.setinputsizes(features=typeObj, timestamp=oracledb.DB_TYPE_TIMESTAMP)
sql_params = [{"features": featureObj, "timestamp": datetime.datetime.today()}]
cur.executemany("BEGIN\nadd_car_test(:features,:timestamp);\nEND;", sql_params, batcherrors=True)

SQL table:

CREATE TABLE "CARS_TEST" (
  "ID" NUMBER GENERATED ALWAYS AS IDENTITY, 
  "FEATURES" "FEATURES_TYPE",
  "TIMESTAMP" timestamp
) NESTED TABLE "FEATURES" STORE AS "FEATURES_TEST_TAB";

SQL procedure:

create or replace PROCEDURE add_car_test (
        features_p IN features_type,
        timestamp_p in timestamp
)
IS
BEGIN
    insert into CARS_TEST(FEATURES, "TIMESTAMP") VALUES(features_p, timestamp_p);
END add_car_test;

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4