0
votes
DECLARE
    TYPE EmpTabTyp IS TABLE OF bse_daily_price%ROWTYPE  INDEX BY PLS_INTEGER;
    emp_tab EmpTabTyp;
    type_info varchar2(400);

BEGIN

    SELECT * INTO emp_tab(100) FROM bse_daily_price WHERE SECURITY_CODE = 500350 and BUS_DATE='02-01-14';
    DBMS_OUTPUT.PUT_LINE(to_char(emp_tab(100)));
END;

Errors:

ORA-06550: line 11, column 25:
PLS-00306: wrong number or types of arguments in call to 'TO_CHAR'
ORA-06550: line 11, column 9:
PL/SQL: Statement ignored

1

1 Answers

3
votes

emp_tab(100) can't be converted into a string using to_char(), which is for individual numbers and dates etc.

You will need to concatenate the values in the record, e.g.

dbms_output.put_line
( emp_tab(100).firstname || ' ' || emp_tab(100).lastname );