Useful SQL Queries – Customization exposed

We imparts you with great information. While surfing on web came across blog that had some articles on SQL and I think it is worth sharing with everybody. I orignal post was found on blog called nbrightside. Some useful queries that I found on that blog are:

Custom Indexs and Custom Columns:

This SQL query will give you the list all the custom indexes and column that have been created by you

select table_name, column_name
from all_tab_columns
where owner=’SIEBEL’
and table_name like ‘S\_%’ escape ‘\’
and column_name like ‘X\_%’ escape ‘\’
;

Custom Columns:

select index_name, column_name, table_name
from all_ind_columns
where table_name like ‘S\_%’ escape ‘\’
and column_name like ‘X\_%’ escape ‘\’
and table_owner = ‘SIEBEL’;

Custom Tables:

select table_name
from all_tables where
owner=’SIEBEL’
and table_name like ‘CX\_%’ escape ‘\’;

2 Responses to Useful SQL Queries – Customization exposed

  1. be aware above SQL does suit Oracle but definitely not DB2.
    for db2 use this one:

    — ALL COLUMNS OF SOME TABLES
    SELECT *
    FROM SYSIBM.SYSCOLUMNS
    WHERE TBCREATOR = ‘SIEBEL’
    AND TBNAME in (‘S_CONTACT’, ‘S_ORG_EXT’)
    and name like ‘X_SHOE_SIZE’
    FETCH FIRST 100 ROWS ONLY
    WITH UR;

  2. be aware above SQL does suit Oracle but definitely not DB2.
    for db2 use this one:

    — ALL COLUMNS OF SOME TABLES
    SELECT *
    FROM SYSIBM.SYSCOLUMNS
    WHERE TBCREATOR = ‘SIEBEL’
    AND TBNAME in (‘S_CONTACT’, ‘S_ORG_EXT’)
    and name like ‘X_SHOE_SIZE’
    FETCH FIRST 100 ROWS ONLY
    WITH UR;

Leave a Reply

Contribute