Re: [sqlite] sqlite3_step getting core dumbed.

2012-02-10 Thread Tim Streater
On 10 Feb 2012 at 07:55, bhaskarReddy wrote: > PRAGMA table_info(yourtablename); will display colNumber, colName, colType, > > ex: 0|slotId|INTEGER|0||0 > 1|ponChannelId|INTEGER|0||0 > 2|onuType|INTEGER|0||0 > 3|onuSerialNumber|TEXT|0||0 > 4|onuId|INTEGER|0||0 >

Re: [sqlite] sqlite3_step getting core dumbed.

2012-02-09 Thread bhaskarReddy
PRAGMA table_info(yourtablename); will display colNumber, colName, colType, ex: 0|slotId|INTEGER|0||0 1|ponChannelId|INTEGER|0||0 2|onuType|INTEGER|0||0 3|onuSerialNumber|TEXT|0||0 4|onuId|INTEGER|0||0 5|plannedSwVersion|TEXT|0||0 6|adminStatus|INTEGER|0||0 In that how can we extract

Re: [sqlite] sqlite3_step getting core dumbed.

2012-02-09 Thread Kees Nuyt
On Thu, 9 Feb 2012 05:07:05 -0800 (PST), bhaskarReddy wrote: > >Is it possible to find the data type, even if the table doesn't have data. >That means, my requirement is, > >1. I want to find the number of columns in the table. ( I already done.) >2. I want to find the names

Re: [sqlite] sqlite3_step getting core dumbed.

2012-02-09 Thread bhaskarReddy
Is it possible to find the data type, even if the table doesn't have data. That means, my requirement is, 1. I want to find the number of columns in the table. ( I already done.) 2. I want to find the names of the columns. (I already done.) 3. I want to find the data types. Because, if it is

Re: [sqlite] sqlite3_step getting core dumbed.

2012-02-09 Thread Marcus Grimm
On 09.02.2012 13:12, bhaskarReddy wrote: Thank you. Its working. But why i am getting sqlite3_column_type returning 5. I can only guess: a) because you have no data in that table. b) probably you have no known type defined in table definition and sqlite does a conversion anyhow. c)

Re: [sqlite] sqlite3_step getting core dumbed.

2012-02-09 Thread bhaskarReddy
Thank you. Its working. But why i am getting sqlite3_column_type returning 5. Marcus Grimm wrote: > > try changing this: > > colNames = (char **)malloc(sizeof(char)); > > into something like > > colNames = (char **)malloc(sizeof(char * ) * noOfColumns); > > > On 09.02.2012 11:21,

Re: [sqlite] sqlite3_step getting core dumbed.

2012-02-09 Thread Marcus Grimm
try changing this: colNames = (char **)malloc(sizeof(char)); into something like colNames = (char **)malloc(sizeof(char * ) * noOfColumns); On 09.02.2012 11:21, bhaskarReddy wrote: HI Friends, I dont know why the sqlite3_step getting core dumped. #include #include

Re: [sqlite] sqlite3_step getting core dumbed.

2012-02-09 Thread bhaskarReddy
No, that is not problem. Taleeb Anwar wrote: > > /* A Query to find types of each column. */ > str = (char *)malloc(sizeof(char) * 255); > memset(str, 0, 255); > strcat(str, "SELECT "); > for(loopVar = 0; loopVar < noOfColumns; loopVar++) > { > strcat(str,

Re: [sqlite] sqlite3_step getting core dumbed.

2012-02-09 Thread Taleeb Anwar
/* A Query to find types of each column. */ str = (char *)malloc(sizeof(char) * 255); memset(str, 0, 255); strcat(str, "SELECT "); for(loopVar = 0; loopVar < noOfColumns; loopVar++) { strcat(str, colNames[loopVar]); if(loopVar < (noOfColumns -1))

[sqlite] sqlite3_step getting core dumbed.

2012-02-09 Thread bhaskarReddy
HI Friends, I dont know why the sqlite3_step getting core dumped. #include #include #include "sqlitedb1.h" #include #include #include #include #include int db_retrieve_row(char *db_name, char *table_name, int num_of_keys, char * col_names[],column_value_t *