You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use SqlsrvDriver and column types are not detected.
I found the problem is in SqlsrvResult.php function getResultColumns(). It calls sqlsrv_field_metadata() which returns numbers, they are not parsed correctly by function Helpers::detectType() that expects some kind of string describing the column.
I made a simple fix in SqlsrvResult.php adding translating array according to MS doc https://learn.microsoft.com/en-us/sql/connect/php/sqlsrv-field-metadata?view=sql-server-ver16&redirectedfrom=MSDN
Another problem is, that sqlsrvDriver is doing some type detection by itself (int, date), so in this setup, dibi fails and special driver option ReturnDatesAsStrings: 1 has to be in connection string.
Is this the correct aproach?
Is someone else having similar problem?
The text was updated successfully, but these errors were encountered:
I found another problem. Sqlsrv driver is returning small floats without leading zero, function normalize() takes care of that. But negative number is not normalized. Code as such has to be added:
I use SqlsrvDriver and column types are not detected.
I found the problem is in SqlsrvResult.php function getResultColumns(). It calls sqlsrv_field_metadata() which returns numbers, they are not parsed correctly by function Helpers::detectType() that expects some kind of string describing the column.
I made a simple fix in SqlsrvResult.php adding translating array according to MS doc https://learn.microsoft.com/en-us/sql/connect/php/sqlsrv-field-metadata?view=sql-server-ver16&redirectedfrom=MSDN
and using this array in the function getResultColumns() as this:
Another problem is, that sqlsrvDriver is doing some type detection by itself (int, date), so in this setup, dibi fails and special driver option
ReturnDatesAsStrings: 1
has to be in connection string.Is this the correct aproach?
Is someone else having similar problem?
The text was updated successfully, but these errors were encountered: