|
Import from database |
Top Previous Next |
|
For importing data automatically from your own database select the Data | Import from database option from the menu.
Data on the following items can be imported from existing databases:
Create an ODBC data source through which the Wise Timetable connects to the database before importing.
1. Settings All settings for importing from a database are set in dbsettings.ini file. Example:
[connection] import_db_conn_str = DSN=Urnik;Uid=root;Pwd=password export_db_conn_str = DSN=Urnik;Uid=root;Pwd=mmm
[sql] import_rooms = select r.Room_Id, r.Name, r.Seats_Num from Room r import_tutors = select t.Tutor_Id, t.First_Name, t.Last_Name, NULL, NULL, NULL from Tutor t order by t.Last_Name, t.First_Name import_programs = select program_id, name, code, years from Program import_branches = import_courses = import_students =
[logging] use_logger = 1
[performance] commit_step=100
Description of parameters which are used for import:
2. Import rooms The following data are imported:
Data example:
Example of sql state: select NULL, r.Name, r.Seats_Num from Room r
3. Import lecturers The following data are imported:
Data example:
Example of sql state: select t.Tutor_Id, t.First_Name, t.Last_Name, NULL, NULL, NULL from Tutor t order by t.Last_Name, t.First_Name
4. Import programs The following data are imported:
Data example:
Example of sql state: select program_id, name, code, years from Program
5. Import subject areas The following data are imported:
Data example:
Example of sql state: SELECT DISTINCT NULL, p.Name, b.Name, NULL FROM Branch b, Program p WHERE b.Program_Id = p.Program_Id
6. Import courses The following data are imported:
Data example:
(continuation)
Example of sql state: SELECT c.Course_Id, p.Name, b.Name, b.Year, c.Name, ct.Name, c.Code, tut.First_Name, tut.Last_Name, 1, 15, 1 FROM Branch b, Course c, Course_Branch cb, CoursePart cp, CourseType ct, Program p, Turn t, Turn_Tutor ttut, Tutor tut WHERE cb.Branch_Id = b.Branch_Id AND cb.Course_Id = c.Course_Id AND cp.Course_Id = c.Course_Id AND ct.CourseType_Id = cp.CourseType_Id AND p.Program_Id = b.Program_Id AND t.CoursePart_Id = cp.CoursePart_Id AND ttut.Turn_Id = t.Turn_Id AND tut.Tutor_Id = ttut.Tutor_Id
7. Import students The following data are imported:
Data example:
Example of sql state: SELECT s.Student_Id, p.Name, b.Name, b.Year, s.First_Name, s.Last_Name, s.Student_Num FROM Branch b, Program p, Student s WHERE p.Program_Id = b.Program_Id AND s.Branch_Code = b.Code AND s.Year = b.Year | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||