[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sqlite-users
Subject:    [sqlite] problem while executing a query
From:       stilak1 () binghamton ! edu
Date:       2004-12-28 17:32:50
Message-ID: Pine.GSO.4.58.0412281230390.25220 () bingsun2 ! cc ! binghamton ! edu
[Download RAW message or body]


Hello All,

Recently, I have installed sqlite3 and trying to get a very simple
database application working with it. My application is in C++. I am
trying to use sqllite3_exec and sqlite3_get_table etc to insert records
into my database. I have already created a table and database pointer is
already pointing to the opened database. Now I have following query to
execute:

my query string is:

insert into sdb
(id,resclass,type,manufacturer,method,ownership,precision,minrange,maxrange,capacity)
values (43,'HARDWARE','MONITOR','GE','NA','XYZ',0,0,4,2)

Same string on commandline works just fine. I think it might be related to
string variables and escape charasters. So I tried using the following:

sqlite3_exec(db,query, NULL, 0, &zErrMsg);
I was getting unrecognized token: ""

I also tried doing this: this
 char* tpquery;
  tpquery = sqlite3_mprintf("%q",query);

Now I get SQL error  near "HARDWARE": syntax error

Can someone please give me some hint.

Regards,
--Sameer.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic