Feedback
Did this article resolve your question/issue?

   

Article

Data exceeding 4000 characters or more not inserted using SQLBindParameter into SQl Server

Information

 
TitleData exceeding 4000 characters or more not inserted using SQLBindParameter into SQl Server
URL NameData-exceeding-4000-characters-or-more-not-inserted-using-SQLBindParameter-into-SQl-Server
Article Number000151996
EnvironmentProduct: Connect and Connect64 for ODBC SQL Server Wire Protocol driver
Version: All supported versions
OS: All Supported Platforms
Database: SQL Server
Application: All supported applications
Question/Problem Description
Data exceeding 4000 characters or more not inserted into SQL Server using parameterized query with Connect for ODBC SQL Server ODBC Driver.
Steps to Reproduce
Clarifying Information
Error Message
Defect Number
Enhancement Number
Cause
In SQLBindParameter the data was bind as zero byte length
Resolution
Make sure the application is binding the data with the proper buffer length.

Incorrect binding
=================
EXIT SQLBindParameter with return code 0 (SQL_SUCCESS) 
HSTMT 0x0000000000F88290 
UWORD 25 
SWORD 1 <SQL_PARAM_INPUT> 
SWORD -8 <SQL_C_WCHAR> 
SWORD -10 <SQL_WLONGVARCHAR> 
SQLULEN 0 
SWORD 0 
PTR 0x00000000FBF30000 
SQLLEN 0 
SQLLEN * 0x00000000DC7C04C0 (0) ---> this indicates a zero length data 

Correct Binding
===============
EXIT SQLBindParameter with return code 0 (SQL_SUCCESS) 
HSTMT 0x00000014220220 
UWORD 4 
SWORD 1 <SQL_PARAM_INPUT> 
SWORD 1 <SQL_C_CHAR> 
SWORD -1 <SQL_LONGVARCHAR> 
SQLULEN 0 
SWORD 0 
PTR 0x007fff4239f5b0 
SQLLEN 0 
SQLLEN * 0x007fff423a0a68 (-4323) ---> it returns the actual length of data being inserted 

Reffer the Microsoft ODBC Specs for SQLBindParameter Function at: 
https://msdn.microsoft.com/en-us/library/ms710963(v=vs.85).aspx
Workaround
Notes
Last Modified Date8/2/2016 9:15 PM
Files
Disclaimer The origins of the information on this site may be internal or external to Progress Software Corporation (“Progress”). Progress Software Corporation makes all reasonable efforts to verify this information. However, the information provided is for your information only. Progress Software Corporation makes no explicit or implied claims to the validity of this information.

Any sample code provided on this site is not supported under any Progress support program or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or delivery of the code be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample code, even if Progress has been advised of the possibility of such damages.