Update sqlbindcol-function.md#3887
Merged
MightyPen merged 1 commit intoMicrosoftDocs:livefrom Jan 3, 2020
Merged
Conversation
Please change
#define PHONE_LEN 20
to
#define PHONE_LEN 60
The reason is that in the Northwind.dbo.customers table, the Phone column is defined as nvarchar(24)
==============================================================================
Please change SQL_C_CHAR to SQL_C_WCHAR
retcode = SQLBindCol(hstmt, 1, SQL_C_CHAR, &sCustID, 100, &cbCustID);
retcode = SQLBindCol(hstmt, 2, SQL_C_CHAR, szName, NAME_LEN, &cbName);
retcode = SQLBindCol(hstmt, 3, SQL_C_CHAR, szPhone, PHONE_LEN, &cbPhone);
to
retcode = SQLBindCol(hstmt, 1, SQL_C_WCHAR, &sCustID, 100, &cbCustID);
retcode = SQLBindCol(hstmt, 2, SQL_C_WCHAR, szName, NAME_LEN, &cbName);
retcode = SQLBindCol(hstmt, 3, SQL_C_WCHAR, szPhone, PHONE_LEN, &cbPhone);
==============================================================================
Also change
wprintf(L"%d: %S %S %S\n", i + 1, sCustID, szName, szPhone);
to
printf("%d: %ls %ls %ls\n", i + 1, sCustID, szName, szPhone);
Contributor
|
@DanielAdeniji : Thanks for your contribution! The author(s) have been notified to review your proposed change. |
MightyPen
approved these changes
Jan 2, 2020
Contributor
MightyPen
left a comment
There was a problem hiding this comment.
@DanielAdeniji Hello Daniel, Thank you very much for taking the time and effort to update and correct this aging source code.
I Approve this public PR #3887.
Contributor
|
#sign-off |
This was referenced Jan 2, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please change
#define PHONE_LEN 20
to
#define PHONE_LEN 60
The reason is that in the Northwind.dbo.customers table, the Phone column is defined as nvarchar(24).
Without that change we are getting error that reads
stringData.rightTruncation.01.20200101.1117PM.txt
"String data, right truncation"