[sqlite] How to correctly a add string to a Mem?

2015-07-13 Thread Sairam Gaddam
I want to make some changes to the result set and I need to add an extra column. On Mon, Jul 13, 2015 at 12:33 PM, Clemens Ladisch wrote: > Sairam Gaddam wrote: > > I have tried a method to create a Mem and add a string to it, which is as > > below > > > >

[sqlite] How to correctly a add string to a Mem?

2015-07-13 Thread Clemens Ladisch
Sairam Gaddam wrote: > I want to make some changes to the result set The SQLite API does not allow making changes to the data in a sqlite3_stmt. > and I need to add an extra column. This can be done in SQL: SELECT Column1, ColumnA, 'some value' FROM ...; Regards, Clemens

[sqlite] How to correctly a add string to a Mem?

2015-07-13 Thread Sairam Gaddam
I have tried a method to create a Mem and add a string to it, which is as below sqlite3VdbeMemInit(&(p->custom_aMem[0]), p->db, MEM_Null); memAboutToChange(p,&(p->custom_aMem[0])); sqlite3VdbeMemSetStr(&(p->custom_aMem[0]), zColumn ,

[sqlite] How to correctly a add string to a Mem?

2015-07-13 Thread Clemens Ladisch
Sairam Gaddam wrote: > I have tried a method to create a Mem and add a string to it, which is as > below > > sqlite3VdbeMemSetStr(&(p->custom_aMem[0]), zColumn , > strlen(zColumn)*sizeof(char), SQLITE_UTF8, SQLITE_STATIC); This is an internal function that applications are not supposed to know