locked
SQLite multiple databases RRS feed

  • Question

  • Hi,

    I just started developing my first desktop app. I want to offer a tool where you can open several SQLite databases simultaneously.

    I know I can attach several databases with ATTACH. The databases all have exactly the very same tables and formats in them. I need to open one specific table from each database.

    My question is: (I just need to show all results in a row.)

    Can I use one query to open them all at the same time? My guess would have been with UNION ALL but all examples I found were for tables that have some common key, e.g. referencing the same client over several tables. But here the table has the same structure thus id 1 from table 1 is not related to id 1 from table 2.

    SELECT * from targetstring FROM db0 UNION ALL SELECT * from targetstring FROM db1 …

    Or do I just query the table in a row?

    SELECT * from targetstring FROM db0 WHERE x

    then

    SELECT * from targetstring FROM db1 WHERE x

    aso until I got all results?


    regards,

    Pascal

    Sunday, January 27, 2019 11:10 AM

Answers

  • Hi Dave Patrick,

    I can't remember into which forum where I posted first. I'm quite new to this MS forum as before I only had to do with asp net forums, so I chose a forum I thought was most appropriate.

    I started coding a VB.NET winforms desktop app. The database attached is not SQL Server (which I know quite well) but SQLite for which their devs do not offer VB.NET winforms support as it is coded in C-language.

    Right now I solved the issue be calling every database in a row. It seems to work fine but I'm not sure if it's the best option.

    regards,

    Pascal


    • Edited by ElPazzo Wednesday, January 30, 2019 2:26 PM
    • Marked as answer by ElPazzo Thursday, January 31, 2019 11:48 AM
    Wednesday, January 30, 2019 2:22 PM

All replies

  • SQLite is not a microsoft product, there are some support options listed here.

    https://www.sqlite.org/support.html

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    • Proposed as answer by Guido Franzke Monday, January 28, 2019 6:43 AM
    Monday, January 28, 2019 4:18 AM
  • Hi,

    I thought this was a forum in order to help people getting their Windows (Microsoft) desktop applications to run as expected even if this affects non-MS products …

    Monday, January 28, 2019 4:38 PM
  •  I don't know where you originally asked but the post was moved to off topic forum. This is "where is" forum for direction on where best to ask questions. What Microsoft desktop applications are you asking about?

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    Monday, January 28, 2019 4:41 PM
  • You cannot do that, you will have to UNION the result in memory

    Please mark as answer, if this was it. Visit my SQL Server Compact blog http://erikej.blogspot.com

    Monday, January 28, 2019 7:18 PM
  • Hi Dave Patrick,

    I can't remember into which forum where I posted first. I'm quite new to this MS forum as before I only had to do with asp net forums, so I chose a forum I thought was most appropriate.

    I started coding a VB.NET winforms desktop app. The database attached is not SQL Server (which I know quite well) but SQLite for which their devs do not offer VB.NET winforms support as it is coded in C-language.

    Right now I solved the issue be calling every database in a row. It seems to work fine but I'm not sure if it's the best option.

    regards,

    Pascal


    • Edited by ElPazzo Wednesday, January 30, 2019 2:26 PM
    • Marked as answer by ElPazzo Thursday, January 31, 2019 11:48 AM
    Wednesday, January 30, 2019 2:22 PM
  • Glad to hear you issue is sorted. Seems someone unwittingly moved this thread to SQL Server forums.

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    Wednesday, January 30, 2019 2:28 PM