{"action":"created","issue":{"url":"https://api.github.com/repos/zozlak/RODBCext/issues/4","repository_url":"https://api.github.com/repos/zozlak/RODBCext","labels_url":"https://api.github.com/repos/zozlak/RODBCext/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/zozlak/RODBCext/issues/4/comments","events_url":"https://api.github.com/repos/zozlak/RODBCext/issues/4/events","html_url":"https://github.com/zozlak/RODBCext/issues/4","id":165612405,"number":4,"title":"SQL Server reports column size of 0 for nvarchar","user":{"login":"r2evans","id":5815808,"avatar_url":"https://avatars.githubusercontent.com/u/5815808?v=3","gravatar_id":"","url":"https://api.github.com/users/r2evans","html_url":"https://github.com/r2evans","followers_url":"https://api.github.com/users/r2evans/followers","following_url":"https://api.github.com/users/r2evans/following{/other_user}","gists_url":"https://api.github.com/users/r2evans/gists{/gist_id}","starred_url":"https://api.github.com/users/r2evans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/r2evans/subscriptions","organizations_url":"https://api.github.com/users/r2evans/orgs","repos_url":"https://api.github.com/users/r2evans/repos","events_url":"https://api.github.com/users/r2evans/events{/privacy}","received_events_url":"https://api.github.com/users/r2evans/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":17,"created_at":"2016-07-14T17:12:39Z","updated_at":"2016-07-19T20:09:21Z","closed_at":null,"body":"I can't verify this bug with other databases, but I'm dealing with SQL Server 2014 via R-3.2.5 and RODBC-0.2.5 (haven't updated this one machine since you fixed my last issue, thanks!).\r\n\r\nWhen a schema is created using `nvarchar`, I get this (truncated/simplified):\r\n\r\n```r\r\n> sqlColumns(adsSQLGetConnection(), \"SegmentGroups\")[,4:7]                                             |\r\n    COLUMN_NAME DATA_TYPE        TYPE_NAME COLUMN_SIZE\r\n 1           Id       -11 uniqueidentifier          36\r\n 2      TrackId       -11 uniqueidentifier          36\r\n 3         Name        -9         nvarchar           0\r\n 4        Owner        -9         nvarchar           0\r\n 5 CalcPriority         4              int          10\r\n 6        Notes        -9         nvarchar           0\r\n```\r\n\r\nIn `CopyParameters`, you have this code:\r\n\r\n```r\r\n        if(strlen(cData) > column->ColSize){\r\n          warning(_(\"character data '%s' truncated to %d bytes in parameter %d\"),\r\n            cData, column->ColSize, col + 1);\r\n```\r\n\r\nI believe that's the culprit. The end result is that my use of `sqlExecute` is coming up with lots of \"truncated\" warnings, I'm inferring because of the column size of 0.\r\n\r\nIs there a different/better way to deal with this? If no easy bug fix is feasible/likely, can you suggest a workaround?"},"comment":{"url":"https://api.github.com/repos/zozlak/RODBCext/issues/comments/233750447","html_url":"https://github.com/zozlak/RODBCext/issues/4#issuecomment-233750447","issue_url":"https://api.github.com/repos/zozlak/RODBCext/issues/4","id":233750447,"user":{"login":"zozlak","id":6503177,"avatar_url":"https://avatars.githubusercontent.com/u/6503177?v=3","gravatar_id":"","url":"https://api.github.com/users/zozlak","html_url":"https://github.com/zozlak","followers_url":"https://api.github.com/users/zozlak/followers","following_url":"https://api.github.com/users/zozlak/following{/other_user}","gists_url":"https://api.github.com/users/zozlak/gists{/gist_id}","starred_url":"https://api.github.com/users/zozlak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zozlak/subscriptions","organizations_url":"https://api.github.com/users/zozlak/orgs","repos_url":"https://api.github.com/users/zozlak/repos","events_url":"https://api.github.com/users/zozlak/events{/privacy}","received_events_url":"https://api.github.com/users/zozlak/received_events","type":"User","site_admin":false},"created_at":"2016-07-19T20:09:21Z","updated_at":"2016-07-19T20:09:21Z","body":"You can try even with `libodbc.so.1`. When I am thinking about the problem with the SELECT query you have reported I am pretty sure it was caused by the wrong implementation of the data fetch in the RODBC package (as for fetching data from the db RODBCext is completely relying on RODBC) and this problem should not have any impact on running INSERT/UPDATE queries."}}
{"actor":{"display_login":"zozlak"}}