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 INTEGER. Regards, Bhaskar. Kees Nuyt wrote: > > On Thu, 9 Feb 2012 05:07:05 -0800 (PST), bhaskarReddy <uni...@gmail.com> > 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 of the columns. (I already done.) >>3. I want to find the data types. Because, if it is an integer i'll use >>s***_bind_int(), else if it is test i'll use s***_bind_text(). >> >>Now if the table is empty, i want to find the data types and according to >>that i want to fill the row. >> >>So is there any way to find the data types even if the table is empty. >>(i.e., Table is there, columns and their names are there but no data in that >>table.) > > http://www.sqlite.org/c3ref/table_column_metadata.html > or > http://www.sqlite.org/c3ref/column_decltype.html > or execute the > PRAGMA table_info(yourtablename); > statement and process the resultset. > >>Regards, >>Bhaskar. > > -- > Regards, > > Kees Nuyt > > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > -- View this message in context: http://old.nabble.com/sqlite3_step-getting-core-dumbed.-tp33292180p33298627.html Sent from the SQLite mailing list archive at Nabble.com. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users