Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE development » Data Dictionary » One subsystem with differents database names
One subsystem with differents database names [message #2693] Sun, 27 March 2011 18:34 Go to next message
edortizq is currently offline  edortizq
Messages: 82
Registered: August 2008
Location: Ecuador
Member

I've coded a complete subsystem, I'm interested in running this subsystem with different database names, what is the best way to do it?
Re: One subsystem with differents database names [message #2694 is a reply to message #2693] Mon, 28 March 2011 01:31 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2350
Registered: April 2006
Location: Surrey, UK
Senior Member
It is not necessary for a database to have the same name as a subsystem. After you have imported a new database you can associate it to any available subsystem by using screen dict_database(upd1).html


Re: One subsystem with differents database names [message #2695 is a reply to message #2694] Mon, 28 March 2011 11:08 Go to previous messageGo to next message
edortizq is currently offline  edortizq
Messages: 82
Registered: August 2008
Location: Ecuador
Member

English is not my native language, certainly I have not expressed myself well, I'll explain with an example what I want:
I have the subsystem SBS1 coded for the database called DB1. I want to run the subsystem SBS1 with other databases that could be called DB2, DB3, etc.
I must make clear that DB1, DB2, and DB3, have the same database schema.
I'm interested to know how to automatically change the used database name for the whole subsystem.
Thanks for advance.
Re: One subsystem with differents database names [message #2696 is a reply to message #2695] Mon, 28 March 2011 13:55 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2350
Registered: April 2006
Location: Surrey, UK
Senior Member
A database can belong to one and only one subsystem, but a subsystem can have more than one database. Within the code for a subsystem you can access as many databases as you like, even if they are associated with other subsystems.

Re: One subsystem with differents database names [message #2697 is a reply to message #2696] Mon, 28 March 2011 16:52 Go to previous messageGo to next message
edortizq is currently offline  edortizq
Messages: 82
Registered: August 2008
Location: Ecuador
Member

Ok, when the file *.class.inc is created there is a line like this:

$this->dbname = 'DB1';

If I don't want to use the database DB1 anymore, instead, I want to use DB2, take in care that DB1 and DB2 have the same database schema (you can asume that DB1 is for the data of company1 and DB2 is for the data of company2, and I'm not interested to get consolidated data)

My questions are:

- Do I have to change all the *.class.inc files for to use DB2 instead of DB1?
- If I have to change all those files, is there a way to do it automatically?

Thanks for your time.
Re: One subsystem with differents database names [message #2698 is a reply to message #2697] Mon, 28 March 2011 17:31 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2350
Registered: April 2006
Location: Surrey, UK
Senior Member
There is no way to automatically change the value of $this->dbname within each class file, so you will have to do it manually. You can either make a permanent change to each file, or find a way to modify it at runtime after the class file is loaded.

Re: One subsystem with differents database names [message #2827 is a reply to message #2693] Tue, 22 November 2011 08:39 Go to previous messageGo to next message
ReynoldsEdwardKim is currently offline  ReynoldsEdwardKim
Messages: 1
Registered: November 2011
Location: 22335 Exploration Dr Ste ...
Junior Member
It is possible one subsystem with different database names.We can use different platforms for creating same database for one application.

Re: One subsystem with differents database names [message #2828 is a reply to message #2827] Tue, 22 November 2011 08:53 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2350
Registered: April 2006
Location: Surrey, UK
Senior Member
Yes. A subsystem can have any number of databases, but a database can belong to only one subsystem.

Re: One subsystem with differents database names [message #2871 is a reply to message #2828] Mon, 09 January 2012 00:49 Go to previous messageGo to next message
glenjones is currently offline  glenjones
Messages: 1
Registered: January 2012
Location: Washington
Junior Member
But how can we use different platforms for creating same database??

Glen Jones
eCommerce
Re: One subsystem with differents database names [message #2872 is a reply to message #2871] Mon, 09 January 2012 05:28 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2350
Registered: April 2006
Location: Surrey, UK
Senior Member
You can create the same databases in different DBMS systems by just following the installation instructions. I have copies of the Radicore databases maintained in MySQL, PostgreSQL, Oracle and MS SQL Server all on the same PC, so it's not difficult.

Re: One subsystem with differents database names [message #3589 is a reply to message #2872] Wed, 20 March 2013 04:00 Go to previous message
AJM is currently offline  AJM
Messages: 2350
Registered: April 2006
Location: Surrey, UK
Senior Member
I have added the ability to switch a database name at runtime so that it can be identified in the data dictionary with one name, then switched to something else depending on the server. Please refer to FAQ92.

Previous Topic: Related Tables using different names fo primary Key Columns
Next Topic: Subtype video
Goto Forum:
  


Current Time: Mon Jun 24 09:57:42 EDT 2024

Total time taken to generate the page: 0.01236 seconds