denisenkom / go-mssqldb

Microsoft SQL server driver written in go language
BSD 3-Clause "New" or "Revised" License
1.82k stars 495 forks source link

pointer uint in tvp #703

Open saeedgeek opened 2 years ago

saeedgeek commented 2 years ago

hi i got problm with null pointer in uint type when i using your tvp library the problem is that when i pass nil uint pointer as a parameter of tvp in to store procedure i got this error

The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Table-valued parameter 0 (""), row 1, column 1: Data type 0x26 has an invalid data length or metadata length.

also my tvp struct is

type MerchantIbanTVP struct { Id uint MerchantID uint IbanIndex uint64 IBAN string SharePercentage *float64 }

also i using both gorm and sql.dataBase library for calling my sp

how can i fix this problem

NikitaDef commented 2 years ago

hi i got problm with null pointer in uint type when i using your tvp library the problem is that when i pass nil uint pointer as a parameter of tvp in to store procedure i got this error

The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Table-valued parameter 0 (""), row 1, column 1: Data type 0x26 has an invalid data length or metadata length.

also my tvp struct is

type MerchantIbanTVP struct { Id uint MerchantID uint IbanIndex uint64 IBAN string SharePercentage *float64 }

also i using both gorm and sql.dataBase library for calling my sp

how can i fix this problem

Hi, please checkout #713 MR, I added types into list