Using 2 DB in SQLITE (ATTACH)

HMG en Español

Moderator: Rathinagiri

Post Reply
jorge.posadas
Posts: 103
Joined: Mon May 19, 2014 7:43 pm
DBs Used: DBF, SQLite, MS-SQL, ACCESS, MariaDB (en proceso)
Location: Tizayuca, Hgo. México
Been thanked: 8 times
Contact:

Using 2 DB in SQLITE (ATTACH)

Post 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)
Cordialmente

Jorge Posadas Ch
Tizayuca, Hgo.
M é x i c o .
Movil +52 55 2038 5338
SKYPE: jorge.posadasch
Email: jorge.posadas@gmail.com

User avatar
Anand
Posts: 481
Joined: Tue May 24, 2016 4:36 pm
DBs Used: DBF
Has thanked: 184 times
Been thanked: 69 times

Post 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
Image

jorge.posadas
Posts: 103
Joined: Mon May 19, 2014 7:43 pm
DBs Used: DBF, SQLite, MS-SQL, ACCESS, MariaDB (en proceso)
Location: Tizayuca, Hgo. México
Been thanked: 8 times
Contact:

Post 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
Cordialmente

Jorge Posadas Ch
Tizayuca, Hgo.
M é x i c o .
Movil +52 55 2038 5338
SKYPE: jorge.posadasch
Email: jorge.posadas@gmail.com

User avatar
dragancesu
Posts: 769
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia
Has thanked: 28 times
Been thanked: 199 times

Post 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

User avatar
Rathinagiri
Posts: 5287
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 178 times
Been thanked: 196 times
Contact:

Post 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
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

Post Reply