Whoops...DBMS_SQL


Remember the fan fare when VARCHAR2 went from 2000 to 4000 bytes...Looks like someone forgot to tell the people that look after DBMS_SQL

SQL> declare
  2    l_theCursor     integer default dbms_sql.open_cursor;
  3    l_columnValue   dbms_sql.varchar2_table;
  4    l_empty         dbms_sql.varchar2_table;
  5    l_status        integer;
  6    l_cnt           number := 0;
  7    l_start  number default dbms_utility.get_time;
  8    l_descTbl       dbms_sql.desc_tab;
  9    l_colCnt        number;
 10    l_array_size    number := 10;
 11  begin
 12    dbms_sql.parse( l_theCursor,
 13                        'select rpad(dummy,4000) x from dual',
 14                         dbms_sql.native );
 15
 16    dbms_sql.describe_columns( l_theCursor, l_colCnt, l_descTbl );
 17
 18    dbms_sql.define_array( l_theCursor, 1, l_columnValue,10,1 );
 19
 20    l_status := dbms_sql.execute( l_theCursor );
 21    l_status := dbms_sql.fetch_rows(l_theCursor);
 22    dbms_sql.column_value(l_theCursor,1,l_columnValue);
 23
 24    dbms_sql.close_cursor( l_theCursor );
 25  end;
 26  /
declare
*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "SYS.DBMS_SYS_SQL", line 1205
ORA-06512: at "SYS.DBMS_SQL", line 328
ORA-06512: at line 21