Skip to content

Convert INTSXP Dates to REALSXP Dates#953

Closed
RasmusSkytte wants to merge 4 commits intor-dbi:mainfrom
RasmusSkytte:main
Closed

Convert INTSXP Dates to REALSXP Dates#953
RasmusSkytte wants to merge 4 commits intor-dbi:mainfrom
RasmusSkytte:main

Conversation

@RasmusSkytte
Copy link
Contributor

fixes #952

Dates can internally be represented as integers (INTSXP) or floating point (REALSXP).

If INTSXP Dates are being copied to SQL Server the error "Restricted data type attribute violation" is thrown (at least in some configurations).

This PR converts the Integer Dates to numeric Dates via sqlData()

Dates can sometimes be internally represented as integers (INTSXP) or floating point (REALSXP).

Dates created via `seq.Date()` or `as.Date(...L)` uses the INTSXP representation which introduces errors when interfacing with some SQL backends (e.g. SQL Server)
@simonpcouch
Copy link
Collaborator

Closing in favor of #954!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dates with integer representation cannot be copied to SQL Server

3 participants