Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add ability to join cursors by specific columns(PK/UK) #453

Closed
@jgebal

Description

@jgebal

Ability to join cursors by specific columns(PK/UK)


This feature could/should be implemented in a similar fashion as excluding columns with a_exclude parameter.

We would have additional parameter for the ut_equal matcher if the matcher is used with refcursor.

If the parameter is present, we can transform it into XPATH to extract PK/UK/join specific column values from the data and store them in a separate VARCHAR2 column of the temp table for cursor data (with limit of 4000 bytes).
There are few ways of extracting column data from XML - XSL
https://stackoverflow.com/questions/17314062/how-to-convert-xml-to-csv-using-xsl
or
Extract with XPath:

select extract(dbms_xmlgen.getxmltype('
       select object_name, object_type
       from user_objects
       '),'//OBJECT_NAME/text()|//OBJECT_TYPE/text()') xml
from dual;

The temp table keys column could be indexed with a unique index, so that we can actually validate that the join columns are unique.

If columns are not unique, the expectation should fail with meaningful message informing that the cursor data contains duplicates.
We need to be able to inform the user which of the compared cursors doesn't have uniqueness which is again tricky as the data_value are not aware of where they were created from (actual or expected).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions