Skip to Content
Nov 12, 2015 at 03:01 PM

select distinct from CDS ends with ORA-01791



I consume a CDS in a program with the following construct:

open cursor lv_cursor for

select distinct partner from z_my_cds_dima

where partner in @l_rng_partner " by default is initial to simulate no restrictions

order by partner.

fetch next cursor lv_cursor into table @data(lt_partner) package size @lv_package. " set to 100

close cursor lv_cursor.

cl_demo_output=>write_data( lt_partner ).

cl_demo_output=>display( ).

When I run the Program, I become a short dump with the message ORA-01791.

Changing the CDS entity name with the DB view in the select statement works!

Changing to another field in the selection list and in the ORDER BY works!

Undoing everything to its original causes a crash!

what ist wrong with the original definition?

any help would be appreciated.

many thanks in advance