Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Highlighted
Developer
Posts: 436
Registered: ‎06-22-2010
My Device: na
My Carrier: blackberry developer
Accepted Solution

SQL logic error or missing database

What is wrong with this statement 

INSERT INTO tableName(CID,TITLE)VALUES(1,test)

 I am getting "SQL logic error or missing database" error

Developer
Posts: 16,992
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: SQL logic error or missing database

you can test sql queries using sqllitemanager, a plugin for firefox.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Contributor
Posts: 13
Registered: ‎08-04-2013
My Device: Dev Alpha B
My Carrier: Blackberry

Re: SQL logic error or missing database

INSERT INTO TABLE_NAME (CID,TITLE) VALUES(1,'TITLE')
Contributor
Posts: 24
Registered: ‎01-06-2014
My Device: 9220
My Carrier: 9220

Re: SQL logic error or missing database

Chech the Table Structure .

Developer
Posts: 436
Registered: ‎06-22-2010
My Device: na
My Carrier: blackberry developer

Re: SQL logic error or missing database

i was able to solve it using bind

Developer
Posts: 32
Registered: ‎03-11-2014
My Device: 8520
My Carrier: 8520

Re: SQL logic error or missing database

The values should be between apostroph like this: INSERT INTO tableName(CID,TITLE)  VALUES( '1' , 'test');

At the end of this statement you shoud have a semicolon(but i am sure in you re databe you put it Smiley Happy )

 

Developer
Posts: 16,992
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: SQL logic error or missing database

bindValue takes care of the '
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 436
Registered: ‎06-22-2010
My Device: na
My Carrier: blackberry developer

Re: SQL logic error or missing database

for dynamic updation

Contributor
Posts: 13
Registered: ‎08-04-2013
My Device: Dev Alpha B
My Carrier: Blackberry

Re: SQL logic error or missing database

for dynamic updation you can use the following code
update TABLE_NAME set TITLE='XYZ' where CID=123;
Developer
Posts: 436
Registered: ‎06-22-2010
My Device: na
My Carrier: blackberry developer

Re: SQL logic error or missing database

my CID iwll be X,and it was failing doing like this,using bind value fixed it