Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT NOMBRE_TABLA, NOMBRE_PK, NOMBRE_COL_PK, TIPO_DATO_COL_PK, ORDEN_COL_PK, NUM_IND_COL
- FROM
- ((
- (SELECT cons.TABLE_NAME AS NOMBRE_TABLA, cons.CONSTRAINT_NAME AS NOMBRE_PK, cols.COLUMN_NAME AS NOMBRE_COL_PK, cols.POSITION AS ORDEN_COL_PK
- FROM all_constraints cons INNER JOIN all_cons_columns cols ON cons.constraint_name = cols.constraint_name
- WHERE (cons.constraint_type = 'P') AND cons.OWNER = 'PARRANDEROS'))
- FULL OUTER JOIN
- (SELECT cons.TABLE_NAME, cons.INDEX_NAME, COUNT(INDEX_NAME) AS NUM_IND_COL
- FROM all_tab_columns cols, all_constraints cons
- WHERE cons.TABLE_NAME = cols.TABLE_NAME AND cons.OWNER = 'PARRANDEROS' AND (cons.constraint_type = 'P')
- GROUP BY cons.TABLE_NAME,cons.INDEX_NAME)
- ON NOMBRE_TABLA = TABLE_NAME)
- FULL OUTER JOIN
- (SELECT TND, DATA_TP AS TIPO_DATO_COL_PK
- FROM
- (SELECT cons.TABLE_NAME AS TND, DATA_TYPE AS DATA_TP
- FROM all_constraints cons, all_tab_columns cols
- WHERE (cons.constraint_type = 'P') AND cons.OWNER = 'PARRANDEROS' AND cons.table_name = cols.table_name)) ON NOMBRE_TABLA=TND
- GROUP BY NOMBRE_TABLA, NOMBRE_PK, NOMBRE_COL_PK,TIPO_DATO_COL_PK, ORDEN_COL_PK, NUM_IND_COL
- ORDER BY NOMBRE_TABLA, NOMBRE_PK, TIPO_DATO_COL_PK, ORDEN_COL_PK;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement