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

Web and WebWorks Development

Reply
Visitor
miesamjafry
Posts: 1
Registered: ‎06-14-2013
My Device: Z10
My Carrier: Telenor

Web Works SQL Join

[ Edited ]

Hi Everyone,

I am developing my first BB10 App using HTML Web Works, in my app I am using HTML Sqlite API for database, its working fine.

I am facing problem in fetching data from 3 tables, scenario is that I have 3 tables:

Doctors (id, name), Specs (id, name), doc_specs (id, d_id, s_id)

now on Doctor Profile I want to display all specialties of selected doctor.

Kindly help me selecting Name of all Specialties of doctor where ID='x'


I will be very thankful to you ppl.


Regards
Miesam Jafry

Please use plain text.
Developer
peardox
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C
My Carrier: 3, Orange, Vodafone

Re: Web Works SQL Join

Not possible

 

SQLlite is sorta just that - very lite

 

You can't so a Join

 

It would be possible is some Open Source DB was ported to BB10 - MySQL would do nicely as would PostGres

 

I would suggest you join a discussion here to get it in the plan (there ain't one)




Click the like button if you find my posts useful!
Please use plain text.
BlackBerry Development Advisor
oros
Posts: 1,523
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: Web Works SQL Join

It's been a while since I've touched SQLite; perhaps you can't use the JOIN command, but I believe something like so should do it:

 

SELECT DISTINCT Doctors.name, Specs.name FROM Doctors, doc_specs, Specs WHERE Doctors.id='x' AND Doctors.id=docs_specs.d_id AND docs_specs.s_id=Specs.id;

 


Note: Not tested. Not efficient. But I believe that should retrieve the desired results.


Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.
Please use plain text.
Developer
peardox
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C
My Carrier: 3, Orange, Vodafone

Re: Web Works SQL Join

Is there any reason you can't use a real DB on a real server?

 

Send the SQL - get the results?




Click the like button if you find my posts useful!
Please use plain text.