PL/SQL wrong number or types of arguments in call to 'P'

380 Views Asked by At

I have a very simple situation in PL/SQL application. I create an array like so:

TYPE myArrayType IS TABLE OF myList%ROWTYPE;
myArray myArrayType;

myList is a cursor with 63 rows. Later in my code I try to loop trough my newly created array like so:

    htp.p('<h2>My data table</h2>');
    htp.p('<table>');

      for elem in 1 .. myArray.count loop
        htp.p('<tr>');
          htp.p('<td>');
            htp.p(' Data= '||myArray(elem)||' ');    //   <-- ERROR 
          htp.p('</td>');
        htp.p('</tr>');
      end loop;

    htp.p('</table>');

But I get an error 'wrong number or types of arguments', can someone please help a newbie?

1

There are 1 best solutions below

0
On BEST ANSWER

In the line:

htp.p(' Data= '||myArray(elem)||' ');    //   <-- ERROR

You are trying to concatenate string with the record, therefore you are getting an error. To fix your problem you have to provide the column name existing in this record:

htp.p(' Data= '||myArray(elem).column_name||' ');