Page 1 of 1

Using 2 DB in SQLITE (ATTACH)

Posted: Tue Jan 01, 2019 8:42 am
by jorge.posadas
Grupo

He visto que se puede usar 2 bases de datos SQLite en una aplicación y es precisamente lo que estoy necesitando, he visto documentación al respecto, pero me gustaría si alguien ya ha hecho eso y si me puede indicar con un ejemplo el CÓMO se puede hacer.

De antemano agradezco la ayuda al respecto.

------------------------------------------------------------------------------------------------------------------------------------------------------------------------

First of all, I'm sorry 4 my bad English

I need to use two SQLITE DB , are you have a example I meen I have CatalogDB and TransactionDB I need Attach a SQLITE DB and then use it in sentence like next:

Select c.Country_Id, c. Country_Name, t.Distributor_id, d.Distributor_Name
FROM CatalogDB AS C
INNER JOIN TransactionDB AS t on t.Country_Id = c.Country_Id

BUT I don't know how use ATTACH DATABASE and then how use the two database in muy prg

Thks for some LIGHT (luz in spanish)

Re: Using 2 DB in SQLITE (ATTACH)

Posted: Tue Jan 01, 2019 1:01 pm
by Anand
https://stackoverflow.com/questions/569 ... -databases gives an example of similar request. You may try it. I have not used same in HMG but.

Regards,

Anand

Re: Using 2 DB in SQLITE (ATTACH)

Posted: Tue Jan 01, 2019 4:07 pm
by jorge.posadas
Anand

Thanks but my problem is with SQLITE and using two different databases (SQLITE) and also I do not know how to use ATTACH

But I appreciate your help

Re: Using 2 DB in SQLITE (ATTACH)

Posted: Thu Jan 03, 2019 9:04 am
by dragancesu
I do not know the structure of the database and tables,
Is it possible to put both tables in one base?
I do not use it but in MySQL you can

Code: Select all

Select c.Country_Id, c. Country_Name, t.Distributor_id, d.Distributor_Name
FROM base1.CatalogDB AS C
INNER JOIN base2.TransactionDB AS t on t.Country_Id = c.Country_Id
Try putting all tables in one base

Re: Using 2 DB in SQLITE (ATTACH)

Posted: Fri Jan 04, 2019 2:25 am
by Rathinagiri
In this link you can have the Encrypt SQLite source code. I have used Attach Database in that.

http://hmgforum.com/download/file.php?id=2455