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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Trusted Contributor
ankitagrawal
Posts: 135
Registered: ‎02-15-2012
My Carrier: Airtel

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??

Please use plain text.
Developer
simon_hain
Posts: 13,787
Registered: ‎07-29-2008
My Carrier: O2 Germany

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
Please use plain text.
Trusted Contributor
ankitagrawal
Posts: 135
Registered: ‎02-15-2012
My Carrier: Airtel

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"??

Please use plain text.
Developer
simon_hain
Posts: 13,787
Registered: ‎07-29-2008
My Carrier: O2 Germany

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
Please use plain text.
Trusted Contributor
ankitagrawal
Posts: 135
Registered: ‎02-15-2012
My Carrier: Airtel

Re: Sqlite Query

Thanks simon.

 

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

 

Now, I am using bindings for Insert operations.

Please use plain text.
Developer
shaan_softwaredvlpr
Posts: 172
Registered: ‎01-17-2011
My Carrier: Airtel

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.
Please use plain text.
Trusted Contributor
ankitagrawal
Posts: 135
Registered: ‎02-15-2012
My Carrier: Airtel

Re: Sqlite Query

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

 

Thanks for your suggestion.

Please use plain text.