There it is, when I printed this value out to a txt file everything was there. 

Apparently there is some sort of character limit when displaying strings in 
debug mode in Visual Studio 2010, news to me...

Thanks everyone!

-----Original Message-----
From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] 
On Behalf Of Pavel Ivanov
Sent: Wednesday, December 21, 2011 2:33 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] sqlite3_column_text() returning partial results

Now, this is a very good test case and explanation what happens, except...

How did you check value of CString testing after iterating though the entire 
char array? Did you look at it in your debugger? Maybe your debugger is not 
capable of showing CString contents longer than 2048 symbols? The value of 
string testing you gave with Windows-style line ends gives me 2040 bytes, 
indentation of the next line is 8 bytes, so if total limit is 2048 bytes then 
you won't see any contents of the next line...

Can you output contents of CString testing using printf() and see if it shows 
the same 2040 bytes?


Pavel


On Wed, Dec 21, 2011 at 1:34 PM, Jacob A. Camp <jacob.c...@mastercam.com> wrote:
> So delving further into this has gotten me nothing else; this is the best I 
> could do to simplify this to understandable steps.
>
> (I'm new to this service so no idea if attachments are allows so sorry 
> about the length in advance)
>
> I have this code:
>
>                sqlite3_stmt* state = NULL;
>                CString sql = _T("SELECT RelationshipHierarchyXML FROM 
> TlAssembly WHERE id=?");
>                //Query the database
>                RawSQLTlID (sql, id, &state);
>                bytes = sqlite3_column_bytes(state, 0); //This line 
> returns 8955
>                //Try getting data as blob
>                const void * temp = sqlite3_column_blob(state, 0);
>                //Set the size for simplification
>                char chararray[9000];
>                //Copy value into the char array
>                memcpy( chararray , temp , bytes);
>                CString testing;
>                //Iterate through all elements
>                for (int x = 0; x < 8999; x++)
>                {
>                int temp = chararray[x];
>                char temp2 = chararray[x];
>
>                //if the char is null or not supportted don't append it 
> to CString
>                if (temp < 1 || temp > 255)
>                {
>                //This gets hit a few times with negative int values
>                temp = temp;
>                }
>                else
>                {
>                //Append the char to the XML string
>                testing.AppendChar(temp2);
>                }
>                }
>
>                return success;
>
> At this point the CString testing contains on a portion of the characters of 
> the XML field which makes it unusable.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mastercam.com
**********************************************************************
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to