Skip to content

Handle Type -155 #213

@lstorme

Description

@lstorme

Describe the bug

Need to handle MsSQL type -155

E RuntimeError: Unsupported data type for column - 0x7ffee88bb7c0, Type - -155, column ID - 7

self = <mssql_python.cursor.Cursor object at 0x7f31b52f7980>

    def fetchone(self) -> Union[None, Row]:
        """
        Fetch the next row of a query result set.

        Returns:
            Single Row object or None if no more data is available.
        """
        self._check_closed()  # Check if the cursor is closed

        # Fetch raw data
        row_data = []
>       ret = ddbc_bindings.DDBCSQLFetchOne(self.hstmt, row_data)
E       RuntimeError: Unsupported data type for column - 0x7ffee88bb7c0, Type - -155, column ID - 7

../../../../py312/lib/python3.12/site-packages/mssql_python/cursor.py:724: RuntimeError

To reproduce

Try to select from table containing datetimeoffset or datetime

Expected behavior

Return record

Further technical details

Python version: 3.12
SQL Server version: (e.g. SQL Server 2022)
Operating system: RedHat 8

Additional context
table:
[ID] [bigint] IDENTITY(1,1) NOT NULL,
[RecCreateDateTime] [datetime] default getutcdate(),
[FileID] varchar NOT NULL, -- merchant affected by the task
[task] varchar NOT NULL, -- type of the task BATCH, S3, ...
[dateTimeUTC] [datetimeoffset] NULL, -- date and time of the task
[guid] [uniqueidentifier],

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions