I have a database link to a MS Access database in an Oracle database using Oracle's Heterogeneous Services. Some of the Access table column names are longer than the Oracle allowed 30 characters. As a result, my PL/SQL code is returning an error:

declare
   my_record myaccesstable@MSAccessODBC64%rowtype;
begin
   null;
   --dbms_output.put_line(my_record."flight_pattern_combination_string");
end;
/
declare
*
ERROR at line 1:
ORA-04052: error occurred when looking up remote object BASE.MSNS_MISSIONS@AMGBASETABLES64
ORA-00600: internal error code, arguments: [kglhfr-bad-free], [], [], [], [], [], [], [], [], [], [], []
ORA-06553: PLS-114: identifier 'flight_pattern_combination_str' too long

Is there a way to trim or truncate the column names when using the %rowtype syntax? I'm not allowed to modify the Access database. I can use a record data type declaration, but this would involve copying all of the column data types into a pl/sql block or package. I tried to use the following:

create table test as select * from myaccesstable@MSAccessODBC64
                        *
ERROR at line 1:
ORA-00997: illegal use of LONG datatype

Is there a way to trim or truncate the column names when using the %rowtype syntax in a PL/SQL Block?

1

There are 1 answers

0
Faisal Niazi On

I am not sure what exactly your requirement is, but Did you try creating a View based on the table

create or replace view vw (col1) as select  flight_pattern_combination_str from myaccesstable@MSAccessODBC64

and then use that view in your procedure.