Skip to content

DPY-4009 when calling direct_path_load for inserting data when unspecified column has default value #577

@hkauffman

Description

@hkauffman
  1. What versions are you using?
Oracle DB: 19.28.0.0.0
python: 3.12.9
python-oracledb: 3.4.2
  1. Is it an error or a hang or a crash?
Error
  1. What error(s) or behavior you are seeing?
oracledb.exceptions.DatabaseError: DPY-4009: 2 positional bind values are required but 1 were provided
  1. Does your application call init_oracle_client()?
No
  1. Include a runnable Python script that shows the problem.
#!/usr/bin/env python3

import oracledb

conn = oracledb.connect()

rows = [
    (1,),
    (2,),
    (3,),
]

conn.direct_path_load(
    schema_name="test_schema",
    table_name="test_issue",
    column_names=["id"],
    data=rows
)

The code works as expected with this table definition:

create table test_issue(
  id number,
  test_date date
)

The code throws the error with this table definition:

create table test_issue(
  id number,
  test_date date default sysdate
)

If I explicitly include a test_date value in the rows it works in both cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions