Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Debug an Oracle Function

Avatar of Dovberman
DovbermanFlag for United States of America asked on
Oracle Database
2 Comments1 Solution585 ViewsLast Modified:
I need to analyze the following function.

    RETURN VARCHAR IS swbs VARCHAR(4000);
      
        swbsCount number;
        swbsHolder VARCHAR(4000);
        counter int;

        BEGIN

            swbs := '';
            swbsHolder := '';
            counter := 1;

            Declare
                CURSOR CUR_CURSOR  is
                    select rownum as numb,
                       COALESCE(swbs,'-'),' '
                      as swbs_info
                        from t_psa_swbs a
                                    where PSA_MASTER_SEQNUM = 3;

            Begin

Cursor rows returned:
numb (rownum)      swbs_info
1                  0004
2                  0003
3                  0001
4                  0002


FOR cur_rec IN CUR_CURSOR  --
                LOOP
                    select cur_rec.swbs_info into swbsHolder from dual;
                    swbs := swbs || swbsHolder ||'   ' ;
                end loop;
            End;

        return swbs;

This looks like it would return the string "0004 0003 0001 0002 " 

How can I test the function?

How can I debug the function and watch each step ?
Thanks,