class_docstr: Interact with Oracle SQL.
  
  :param oracle_conn_id: The :ref:`Oracle connection id <howto/connection:oracle>`
      used for Oracle credentials.
  :param thick_mode: Specify whether to use python-oracledb in thick mode. Defaults to False.
      If set to True, you must have the Oracle Client libraries installed.
      See `oracledb docs<https://python-oracledb.readthedocs.io/en/latest/user_guide/initialization.html>`
      for more info.
  :param thick_mode_lib_dir: Path to use to find the Oracle Client libraries when using thick mode.
      If not specified, defaults to the standard way of locating the Oracle Client library on the OS.
      See `oracledb docs
      <https://python-oracledb.readthedocs.io/en/latest/user_guide/initialization.html#setting-the-oracle-client-library-directory>`
      for more info.
  :param thick_mode_config_dir: Path to use to find the Oracle Client library
      configuration files when using thick mode.
      If not specified, defaults to the standard way of locating the Oracle Client
      library configuration files on the OS.
      See `oracledb docs
      <https://python-oracledb.readthedocs.io/en/latest/user_guide/initialization.html#optional-oracle-net-configuration-files>`
      for more info.
  :param fetch_decimals: Specify whether numbers should be fetched as ``decimal.Decimal`` values.
      See `defaults.fetch_decimals
      <https://python-oracledb.readthedocs.io/en/latest/api_manual/defaults.html#defaults.fetch_decimals>`
      for more info.
  :param fetch_lobs: Specify whether to fetch strings/bytes for CLOBs or BLOBs instead of locators.
      See `defaults.fetch_lobs
      <https://python-oracledb.readthedocs.io/en/latest/api_manual/defaults.html#defaults.fetch_decimals>`
      for more info.
class_docstr_tok: ["Interact","with","Oracle","SQL",".",":","param","oracle_conn_id",":","The",":","ref",":","`","Oracle","connection","id","<","howto\/connection",":","oracle",">","`","used","for","Oracle","credentials",".",":","param","thick_mode",":","Specify","whether","to","use","python-oracledb","in","thick","mode",".","Defaults","to","False",".","If","set","to","True",",","you","must","have","the","Oracle","Client","libraries","installed",".","See","`","oracledb","docs","<","https",":","\/\/python-oracledb.readthedocs.io\/en\/latest\/user_guide\/initialization.html",">","`","for","more","info",".",":","param","thick_mode_lib_dir",":","Path","to","use","to","find","the","Oracle","Client","libraries","when","using","thick","mode",".","If","not","specified",",","defaults","to","the","standard","way","of","locating","the","Oracle","Client","library","on","the","OS",".","See","`","oracledb","docs","<","https",":","\/\/python-oracledb.readthedocs.io\/en\/latest\/user_guide\/initialization.html","#","setting-the-oracle-client-library-directory",">","`","for","more","info",".",":","param","thick_mode_config_dir",":","Path","to","use","to","find","the","Oracle","Client","library","configuration","files","when","using","thick","mode",".","If","not","specified",",","defaults","to","the","standard","way","of","locating","the","Oracle","Client","library","configuration","files","on","the","OS",".","See","`","oracledb","docs","<","https",":","\/\/python-oracledb.readthedocs.io\/en\/latest\/user_guide\/initialization.html","#","optional-oracle-net-configuration-files",">","`","for","more","info",".",":","param","fetch_decimals",":","Specify","whether","numbers","should","be","fetched","as","``","decimal.Decimal","``","values",".","See","`","defaults.fetch_decimals","<","https",":","\/\/python-oracledb.readthedocs.io\/en\/latest\/api_manual\/defaults.html","#","defaults.fetch_decimals",">","`","for","more","info",".",":","param","fetch_lobs",":","Specify","whether","to","fetch","strings\/bytes","for","CLOBs","or","BLOBs","instead","of","locators",".","See","`","defaults.fetch_lobs","<","https",":","\/\/python-oracledb.readthedocs.io\/en\/latest\/api_manual\/defaults.html","#","defaults.fetch_decimals",">","`","for","more","info","."]
docstr: A performant bulk insert for Oracle DB.
  
  This uses prepared statements via `executemany()`. For best performance,
  pass in `rows` as an iterator.
  
  :param table: target Oracle table, use dot notation to target a
      specific database
  :param rows: the rows to insert into the table
  :param target_fields: the names of the columns to fill in the table, default None.
      If None, each rows should have some order as table columns name
  :param commit_every: the maximum number of rows to insert in one transaction
      Default 5000. Set greater than 0. Set 1 to insert each row in each transaction
docstr_tok: ["A","performant","bulk","insert","for","Oracle","DB",".","This","uses","prepared","statements","via","`","executemany","(",")","`",".","For","best","performance",",","pass","in","`","rows","`","as","an","iterator",".",":","param","table",":","target","Oracle","table",",","use","dot","notation","to","target","a","specific","database",":","param","rows",":","the","rows","to","insert","into","the","table",":","param","target_fields",":","the","names","of","the","columns","to","fill","in","the","table",",","default","None",".","If","None",",","each","rows","should","have","some","order","as","table","columns","name",":","param","commit_every",":","the","maximum","number","of","rows","to","insert","in","one","transaction","Default","5000",".","Set","greater","than","0",".","Set","1","to","insert","each","row","in","each","transaction"]
code: def bulk_insert_rows(
      self,
      table: str,
      rows: list[tuple],
      target_fields: list[str] | None = None,
      commit_every: int = 5000,
  ):
      """A performant bulk insert for Oracle DB.
  
      This uses prepared statements via `executemany()`. For best performance,
      pass in `rows` as an iterator.
  
      :param table: target Oracle table, use dot notation to target a
          specific database
      :param rows: the rows to insert into the table
      :param target_fields: the names of the columns to fill in the table, default None.
          If None, each rows should have some order as table columns name
      :param commit_every: the maximum number of rows to insert in one transaction
          Default 5000. Set greater than 0. Set 1 to insert each row in each transaction
      """
      if not rows:
          raise ValueError(
              "parameter rows could not be None or empty iterable"
          )
      conn = self.get_conn()
      if self.supports_autocommit:
          self.set_autocommit(conn, False)
      cursor = conn.cursor()  # type: ignore[attr-defined]
      values_base = target_fields or rows[0]
      prepared_stm = (
          "insert into {tablename} {columns} values ({values})".format(
              tablename=table,
              columns="({})".format(", ".join(target_fields))
              if target_fields
              else "",
              values=", ".join(
                  f":{i}" for i in range(1, len(values_base) + 1)
              ),
          )
      )
      row_count = 0
      # Chunk the rows
      row_chunk = []
      for row in rows:
          row_chunk.append(row)
          row_count += 1
          if row_count % commit_every == 0:
              cursor.prepare(prepared_stm)
              cursor.executemany(None, row_chunk)
              conn.commit()  # type: ignore[attr-defined]
              self.log.info("[%s] inserted %s rows", table, row_count)
              # Empty chunk
              row_chunk = []
      # Commit the leftover chunk
      cursor.prepare(prepared_stm)
      cursor.executemany(None, row_chunk)
      conn.commit()  # type: ignore[attr-defined]
      self.log.info("[%s] inserted %s rows", table, row_count)
      cursor.close()
      conn.close()
  
file_path: airflow/airflow/providers/oracle/hooks/oracle.py
imports: from __future__ import annotations
  import math
  import warnings
  from datetime import datetime
  import oracledb
  from airflow.exceptions import AirflowProviderDeprecationWarning
  from airflow.providers.common.sql.hooks.sql import DbApiHook
label_desc: Use image node_id 4 for calling the OracleHook obj's underlying member method code with example usage: obj.bulk_insert_rows(table, rows, target_fields, commit_every) without return types