Using 2 DB in SQLITE (ATTACH)

HMG en Español

Moderator: Rathinagiri

Post Reply
jorge.posadas
Posts: 87
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: 4 times
Contact:

Using 2 DB in SQLITE (ATTACH)

Post by jorge.posadas » Tue Jan 01, 2019 8:42 am

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 5514272013
SKYPE: jorge.posadasch
Email: jorge.posadas@gmail.com

User avatar
Anand
Posts: 369
Joined: Tue May 24, 2016 4:36 pm
DBs Used: DBF
Has thanked: 93 times
Been thanked: 49 times

Post by Anand » Tue Jan 01, 2019 1:01 pm

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: 87
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: 4 times
Contact:

Post by jorge.posadas » Tue Jan 01, 2019 4:07 pm

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 5514272013
SKYPE: jorge.posadasch
Email: jorge.posadas@gmail.com

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

Post by dragancesu » Thu Jan 03, 2019 9:04 am

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: 5262
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 167 times
Been thanked: 172 times
Contact:

Post by Rathinagiri » Fri Jan 04, 2019 2:25 am

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