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
Trusted Contributor
ankitagrawal
Posts: 141
Registered: ‎02-15-2012
My Device: 9800

Sqlite Query

INSERT INTO 'tablename'('column1','column2')VALUES
('data1','data2'),
('data3','data4'),
('data5','data6'),
('data7','data8');

 

 

 

Can I use above mentioned query in Blackberry while performing DB transaction??

Developer
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Sqlite Query

i would suggest that you try the statement with an sql manager, i use sqlite manager as an addon in 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
Trusted Contributor
ankitagrawal
Posts: 141
Registered: ‎02-15-2012
My Device: 9800

Re: Sqlite Query

Hi simon,

 

I have tried it with sqlite manager add-on, but it's not working. And also giving error while implementing in code.

 

So want to know - "Is there any other method to insert multiple rows into database"??

Developer
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Sqlite Query

i guess you have to insert them one after another. not really my area of expertise though.
----------------------------------------------------------
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
Trusted Contributor
ankitagrawal
Posts: 141
Registered: ‎02-15-2012
My Device: 9800

Re: Sqlite Query

Thanks simon.

 

Please tell me the optimized way to insert rows into database.

 

Now, I am using bindings for Insert operations.

Developer
shaan_softwaredvlpr
Posts: 172
Registered: ‎01-17-2011
My Device: 9500 series

Re: Sqlite Query

Why don't you add these rows by running a loop like for loop.
In per loop statement insert one row. Hence you are having very less no. of rows to insert than it should not be a problem.
Trusted Contributor
ankitagrawal
Posts: 141
Registered: ‎02-15-2012
My Device: 9800

Re: Sqlite Query

It is not an issue shaan. I just want to optimize my existing code.

 

Thanks for your suggestion.