2

How can I see in the debug window (PL/SQL Developer, version 10.0.5.1710) to look up information on an array of data in a collection: the nesting hierarchy, elements with data types and their values without listing all its elements separately?

DECLARE
    TYPE T_userinfo IS RECORD(
        surname VARCHAR2(8),
        name    VARCHAR2(6),
        sex     VARCHAR2(6)
    );
    TYPE T_group_tab IS TABLE OF T_userinfo INDEX BY VARCHAR2(6);
    TYPE T_class_tab IS TABLE OF T_group_tab INDEX BY PLS_INTEGER;

    team_tab T_class_tab;
BEGIN
    team_tab(0)('group1').surname := 'Bradley';
    team_tab(0)('group1').name    := 'Brian';
    team_tab(0)('group1').sex     := 'male';

    team_tab(1)('group2').surname := 'Johnston';
    team_tab(1)('group2').name    := 'Hilary';
    team_tab(1)('group2').sex     := 'female';
END;

I want to see in the debug window something like that:

0 => 
    'group1' => 
        'surname' => VARCHAR2 'Bradley'
        'name'    => VARCHAR2 'Brian'
        'sex'     => VARCHAR2 'male'
1 => 
    'group2' => 
        'surname' => VARCHAR2 'Johnston'
        'name'    => VARCHAR2 'Hilary'
        'sex'     => VARCHAR2 'female'

Debugging PL/SQL Collections

Community
  • 1
  • 1
ITR
  • 21
  • 3

1 Answers1

1

It seems it is not possible at the moment. According to the newest user guide I found on the web (page 25), PLSQL developer can show collection of scalar type on hovering mouse on variable or rightclicking and choosing View collection variable from context menu.

It is also possible to hover mouse on variable of record type to show values of record fields or even send these values into watch window:

team_tab T_class_tab;
team_tab0 T_group_tab;
team_tab0g T_userinfo;
...
team_tab(0)('group1').surname := 'Bradley';
team_tab(0)('group1').name    := 'Brian';
team_tab(0)('group1').sex     := 'male';
team_tab0 := team_tab(0);
team_tab0g := team_tab0('group1'); -- hover on team_tab0g

For complex types you have to make up custom function to dump data in format you require.

Tomáš Záluský
  • 10,735
  • 2
  • 36
  • 64