Hello,
I am migrating the tables from one SQL Server DB to another using CQL. I am successfully able to migrate the data from one table to another, but I have the following queries:
1. My table has the following fields:
Student_ID (Primary Key), Student_Name and Student_Address
While importing, an additional ID field is generated and marked as a Primary Key instead of 'Student_ID.' Even though I tried specifying 'id_column_name=Student_ID,' still the ID field is set as the Primary Key. Is there a way to import it as is, ensuring that my Primary Key remains 'Student_ID'?
Here is the sample code snippet:
instance J = import_jdbc "" : schStudents {
sStudentMaster -> "SELECT Student_ID, Student_Name, Student_Address,Student_ID FROM StudentMaster"
options
prepend_entity_on_ids = true
id_column_name=Student_ID
}
2. Similar to the above scenario, I have two tables having a Primary Key in both tables and one table has a foreign key pointing to the Primary Key of the base table. While doing the import the newly generated ID field is marked as a Primary key in both the tables and foreign key points to the ID field of the base table instead of the original Primary key.
Here is the sample code snippet:
schema sch = literal : sql {
entities
sDependendents
sEmployees
foreign_keys
employee_id : sDependendents -> sEmployees
attributes
dependent_id : sDependendents -> Integer
first_name last_name relationship : sDependendents -> Varchar
employee_id : sEmployees -> Integer
first_name last_name email phone_number : sEmployees -> Varchar
department_id : sEmployees -> Integer
}
instance J = import_jdbc "" : sch {
sEmployees -> "SELECT employee_id as id,employee_id,first_name,last_name,email,phone_number,department_id FROM Employees"
sDependendents -> "SELECT dependent_id as id, dependent_id,employee_id,first_name,last_name,relationship FROM Dependents"
options
prepend_entity_on_ids = false
}
Kindly assist me in resolving the issue and inform me of any mistakes I might be making. Thanks in advance.
~AM
--
You received this message because you are subscribed to the Google Groups "Categorical Data" group.
To unsubscribe from this group and stop receiving emails from it, send an email to categoricalda...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/categoricaldata/e4a60837-6b6d-4adb-b63b-2dc9db710763n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/categoricaldata/ca30e43f-eca3-47d8-83ef-b5508df5a3ccn%40googlegroups.com.