Forum Discussion
ChayceDuncan2
7 years agoQrew Cadet
When you say last record id - can you elaborate? Are you doing an import of a parent record, then a second import of your children and then need to associate the children against that most recent parent record?
If yes - my first thought, if you're using doQuery to get the most recent parent, would be to query your parent table to sort your doQuery in descending order of record id (meaning that you are returning the newest record id's first) and then set an option parameter for number of records to be 1 - so you only return the most recent record. You can parse that for the record ID and and associate it before you import the children
Chayce Duncan | Technical Lead
(720) 739-1406 | chayceduncan@quandarycg.com
Quandary Knowledge Base
If yes - my first thought, if you're using doQuery to get the most recent parent, would be to query your parent table to sort your doQuery in descending order of record id (meaning that you are returning the newest record id's first) and then set an option parameter for number of records to be 1 - so you only return the most recent record. You can parse that for the record ID and and associate it before you import the children
Chayce Duncan | Technical Lead
(720) 739-1406 | chayceduncan@quandarycg.com
Quandary Knowledge Base
TejasvitaDhuri
7 years agoQrew Trainee
Thank you Chayce Duncan for your reply but what I want to implement:
Lets say I have 2 table 1st Parent 2nd Child and I had generated one record in parent table now i'm going to import a data into child table from csv file from my local system. After imported data in to child table now I want to relate that imported data to parent one. how I can I achieve this is there any way.
In SQL we can do this by using Query : UPDATE table_name
SET column1 = value1, column2 = value2, ...
Lets say I have 2 table 1st Parent 2nd Child and I had generated one record in parent table now i'm going to import a data into child table from csv file from my local system. After imported data in to child table now I want to relate that imported data to parent one. how I can I achieve this is there any way.
In SQL we can do this by using Query : UPDATE table_name
SET column1 = value1, column2 = value2, ...