[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

data truncated

Posted on 2000-03-20
7
Medium Priority
?
794 Views
Last Modified: 2013-11-20
I have an odbc application which retrieves and transfers data from and to big databases (3000 records).
The problem is that I always get the message "data truncated".
Is this because of the big size of the databases?
what could be the reason for this and how can I solve that problem?
0
Comment
Question by:twg
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 1

Accepted Solution

by:
Deckmeister earned 90 total points
ID: 2639013
No, this message "data truncated" is not because of the size of the databases. And in fact, 3000 records is not very big (there exist many databases with far over 10000 records).

The message means that you try to retrieve a big field of data in a less big variable.
0
 
LVL 1

Expert Comment

by:Deckmeister
ID: 2639028
To complete my answer:

If the complete error message is "ODBC — field would be too long; data truncated." (Error 3231), then you tried to perform a task on an ODBC data source that would have resulted in a field that is too long. The data has been truncated to the maximum allowable length.

0
 
LVL 1

Expert Comment

by:Deckmeister
ID: 2639035
Another possible origin of the error: when using MFC ODBC to call a Microsoft SQL Server stored procedure that returns a CHAR or VARCHAR output parameter, the buffer intended to hold the data returned will be Null and ODBC will return the error:

   Warning: ODBC Success With Info, Data truncated
   State:01004,Native:0,Origin:[Microsoft][ODBC SQL Server Driver]

If this is the error, simply go to http://support.microsoft.com/support/kb/articles/Q182/3/86.ASP to have the solution.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:twg
ID: 2640992
I read a little about "data truncated" in the MSDN
help of microsoft. It's written there that "if the byte length of the data is greater than the byte length of the buffer, the driver truncates data being fetched to the byte length of the buffer and returns SQL_SUCCESS_WITH_INFO with SQLSTATE 01004(Data truncated)".

My question is : is it possible to make the buffer bigger enough for my data so I won't get this message?
0
 

Expert Comment

by:Subramanya
ID: 2641722
SQL_SUCCESS_WITH_INFO  it also returns
some Structure info there You can get the buffer size required.Now you can
reinitialise buffer to required size
0
 

Author Comment

by:twg
ID: 2643307
Thanks subramanya.
How do I reinitialize the buffer's size?
0
 
LVL 1

Expert Comment

by:Deckmeister
ID: 2648001
Hi again,

Simply take a look at http://msdn.microsoft.com/library/psdk/dasdk/odch8pm6.htm, where your problem is listed.

See the section getting long data where it is explained to use SQLGetData instead of SQLFetch in order to retrieve long data.
With respect to a single column, SQLGetData behaves in the same manner as SQLFetch: It retrieves the data for the column, converts it to the type of the application variable, and returns it in that variable. It also returns the byte length of the data in the length/indicator buffer.
There is more explanation and an example of that at http://msdn.microsoft.com/library/psdk/dasdk/odch6jmp.htm

Regards
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Ready to get certified? Check out some courses that help you prepare for third-party exams.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question