Inserting LONG RAW Columns into a Table
We have Oracle 11G that consists of multiple schemas that have the same tables.
I would like to copy table EMPLOYEE for the multiple schemas into a single table BASE.EMPLOYEE that is in the BASE schema, using dynamic SQL, like this:
-- Load EMPLOYEE Table
DECLARE
v_DynSQL VARCHAR2 (32767);
RetVal VARCHAR2 (32767);
BEGIN
FOR con
IN ( SELECT TAB.OWNER,
EMPLOYEE_ID_NO,
LISTAGG (COLUMN_NAME, ',') WITHIN GROUP (ORDER BY COLUMN_ID)
ATTRIBUTES
FROM DBA_TAB_COLS TAB, BASE.EMPLOYEE_ID CTR
WHERE TABLE_NAME = 'EMPLOYEE'
AND TAB.OWNER = CTR.SCHEMA_NAME
GROUP BY OWNER, EMPLOYEE_ID_NO