My Oracle Support Banner

EScript Array Sort Function Resulting In Incorrectly Sorted Array (Doc ID 2244857.1)

Last updated on FEBRUARY 03, 2019

Applies to:

Siebel CRM - Version 15.6 [IP2015] and later
Information in this document applies to any platform.


On : 15.6 [IP2015] version, Siebel VB / eScript / COM

eScript Array sort function resulting in incorrectly sorted array

While sorting two dimensional arrays using escript function: arrayName.sort([compareFunction]), it is returning incorrectly sorted array.

Customer is implementing eScript code which requires to sort an Array of Objects using two criteria (sort using first criterion, followed by sort using second criterion).
The problem occurs when they set the Array elements using the first sort criterion and execute second sort. The expectation after second sort is that the Array indexes are retained because the comparison function returns zero.

However first Array elements ends up as the last element.

In general, when executing sort using any two dimensional Array, if the compare function returns zero or -1, the first element before sort ends up as the last element after sort for any group of elements which have the same comparison value.

While sorting two dimensional arrays using escript function: arrayName.sort([compareFunction]), the sorted array should be returned correctly.

The issue can be reproduced at will with the following escript:

The issue has the following business impact:
Due to this issue, users cannot use escript function: arrayName.sort([compareFunction]).


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.