Hello, On 2016-03-16 07:03, Sairam Gaddam wrote:
> Here the mem consists of entire row to be inserted. Format of this data is described here: http://sqlite.org/fileformat2.html#serialtype > When I read the mem > *pData, I found from the member pData->flags that it contains a BLOB. But > when I tried to print BLOB in pData->z, I didnt get correct results. How to > print a BLOB? This BLOB is not column's value converted into BLOB storage type --- this is all data of a whole record (all columns) inserted into a table according to the above specification. > I tried to print the contents in it by performing a deep copy of that mem > and converting it to real value using sqlite3VdbeRealValue(). But no > satisfactory result. When you are converting inserted BLOB into REAL then it is treated as TEXT and converted to REAL as if ``atof'' --- the first byte of ``pData->z'' is a header length (rather small number), which causes finish of conversion and returns 0.0. If you want to receive value of some column you must read above mentioned specification. If you are inserting REAL (notice that same REALs may be saved as INTEGERs!) you must found its offset in ``pData->z'' and extract data from this offset. If you want to take a control over particular data inserted into a table then the best method is to use triggers. -- best regards Cezary H. Noweta