「SQL文の研修」と「李さんのblog」

「李さんのblog」

http://www.dlitclub.com/home/space.php?uid=109

 

「SQL文の研修」

1、SELECT text FROM user_source WHERE type LIKE 'PACKAGE BODY' AND name LIKE 'XX%'  AND text LIKE '%FND%PROFILE%';

 


2、SELECT * FROM dba_objects WHERE object_name LIKE 'GL_L%' AND object_type = 'TABLE';

 

 

3、SELECT c.*

   FROM

  (SELECT a.owner    ,

    a.table_name     ,

    a.constraint_name,

    a.constraint_type,

    b.column_name    ,

    b.position       ,

    a.search_condition

     FROM dba_constraints a,

    dba_cons_columns b

    WHERE a.owner       =b.owner

  AND a.table_name      = b.table_name

  AND a.constraint_name = b.constraint_name

UNION ALL

   SELECT a.table_owner owner   ,

    a.table_name                ,

    a.index_name constraint_name,

    a.index_type

    || '_'

    || a.uniqueness constraint_type,

    b.column_name                  ,

    b.column_position position     ,

    NULL search_condition

     FROM dba_indexes a,

    dba_ind_columns b

    WHERE a.owner  = b.table_owner

  AND a.table_name = b.table_name

  AND a.index_name = b.index_name

  ) c

  WHERE table_name = upper('&TABLE_NAME')

ORDER BY constraint_name,

  position;

 

テーブルの主キーを検索

 

 

 

 

 

 

 

你可能感兴趣的:(sql,C++,c,PHP,Blog)