Re: [sqlite] Getting declared datatype of a column in C

2010-07-20 Thread i
-- 追求自由,崇尚简单~ -- Original -- From: "Jay A. Kreibich"; Date: 2010年7月7日(星期三) 下午4:41 To: "General Discussion of SQLite Database"; Subject: Re: [sqlite] Getting declared datat

Re: [sqlite] Getting declared datatype of a column in C

2010-07-08 Thread Jay A. Kreibich
On Thu, Jul 08, 2010 at 02:27:02PM +0100, Andrew Wood scratched on the wall: > Even if I fix the way a blob is inserted so that it causes it to be > correctly detected as a blob by sqlite3_column_type() theres still a > problem - because if a field comes back as SQLITE_NULL my application > s

Re: [sqlite] Getting declared datatype of a column in C

2010-07-08 Thread Andrew Wood
Just thought of something else. Even if I fix the way a blob is inserted so that it causes it to be correctly detected as a blob by sqlite3_column_type() theres still a problem - because if a field comes back as SQLITE_NULL my application still needs to know what type the field was supposed t

Re: [sqlite] Getting declared datatype of a column in C

2010-07-07 Thread Jay A. Kreibich
On Wed, Jul 07, 2010 at 02:35:58PM +0100, Andrew Wood scratched on the wall: > Ok, what if I come at the problem from the opposite side: > > The problem is, Ive got a BLOB field which contains a char array as an > escpaped string but when I call sqlite3_column_type(preparedstatement, > x); it c

Re: [sqlite] Getting declared datatype of a column in C

2010-07-07 Thread Andrew Wood
Ok, what if I come at the problem from the opposite side: The problem is, Ive got a BLOB field which contains a char array as an escpaped string but when I call sqlite3_column_type(preparedstatement, x); it comes back as SQLITE_TEXT not SQLITE_BLOB I want a way to detect that it should really

Re: [sqlite] Getting declared datatype of a column in C

2010-07-07 Thread Jay A. Kreibich
On Wed, Jul 07, 2010 at 12:32:53PM +0100, Andrew Wood scratched on the wall: > Is there not just a function which will take the index of a column and > return its declared type? Not in the general case. sqlite3_column_decltype() will do it for SELECT statements, but only if the result-set co

Re: [sqlite] Getting declared datatype of a column in C

2010-07-07 Thread Andrew Wood
Is there not just a function which will take the index of a column and return its declared type? On 07/07/10 04:41, Jay A. Kreibich wrote: > On Tue, Jul 06, 2010 at 11:27:09PM +0100, Andrew Wood scratched on the wall: > >> Ive been looking at the function >> >> sqlite3_column_decltype >> >> a

Re: [sqlite] Getting declared datatype of a column in C

2010-07-06 Thread Jay A. Kreibich
On Tue, Jul 06, 2010 at 11:27:09PM +0100, Andrew Wood scratched on the wall: > Ive been looking at the function > > sqlite3_column_decltype > > and am a little confused as to its use. > > How can I find out the declared type of a column. If you just want to know the declared type of a column

Re: [sqlite] Getting declared datatype of a column in C

2010-07-06 Thread Igor Tandetnik
Andrew Wood wrote: > Ive been looking at the function > > sqlite3_column_decltype > > and am a little confused as to its use. > > How can I find out the declared type of a column. > > As I understand this function, I would have to do a single col select first Not necessarily a single-column o

[sqlite] Getting declared datatype of a column in C

2010-07-06 Thread Andrew Wood
Ive been looking at the function sqlite3_column_decltype and am a little confused as to its use. How can I find out the declared type of a column. As I understand this function, I would have to do a single col select first, (select col1 from table) then pass that prepared statement to ? sqli