Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added new virtual field "OrderIntegrationOrderId", so when we import … #35

Merged
merged 3 commits into from
Nov 19, 2024

Conversation

MatthiasSort
Copy link
Contributor

…orderlines we can make a lookup on the EcomOrders to fetch the OrderId and place it in the OrderLineOrderId column. Uptimized AddMappingsThatNeedsToBeThereForMoveToMainTables and RemoveColumnMappingsThatShouldBeSkippedInMoveToMainTables so they are triggered for all mappings and not just the first.

…orderlines we can make a lookup on the EcomOrders to fetch the OrderId and place it in the OrderLineOrderId column. Uptimized AddMappingsThatNeedsToBeThereForMoveToMainTables and RemoveColumnMappingsThatShouldBeSkippedInMoveToMainTables so they are triggered for all mappings and not just the first.
var OrderCustomerAccessUserExternalIdMapping = columnMappings.Find(cm => string.Compare(cm.DestinationColumn.Name, OrderCustomerAccessUserExternalId, true) == 0);
if (OrderCustomerAccessUserExternalIdMapping != null && OrderCustomerAccessUserExternalIdMapping.SourceColumn != null)
_existingOrders = [];
SqlDataAdapter ordersDataAdapter = new("select OrderId, OrderIntegrationOrderId from EcomOrders ", Connection);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add WHERE clause for filtering out the null or empty IntegrationOrderIds that are not needed, also maybe you can GroupBy IntegrationOrderId so you don't then need to check if _existingOrders.ContainsKey

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DWDBE I am not sure if GROUP BY in SQL is good enough, as it needs both SELECT columns in it for it to work
image
and then it still is able to return multiple "same" values
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could change the "Hashtable _existingOrders" to a Dictionary<string, string> and do a TryAdd() instead?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can try with just one column in grouping: "GroupBy OrderIntegrationOrderId"
yes, try with Dictionary<string, string>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DWDBE I've changed the Hashtables to Dictionary<string, string>, but can not do the GROUP BY of just one of the selected columns (see picture above, as SQL Manager fails)

@MatthiasSort MatthiasSort merged commit dc6e3ef into main Nov 19, 2024
1 check passed
@MatthiasSort MatthiasSort deleted the mss/21601 branch November 19, 2024 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants