1 | public class TriggerSourceTab extends BaseSourceTab↵ | | 1 | public class ViewSourceTab extends OracleSourceTab↵
|
2 | {↵ | | 2 | {↵
|
3 | private static final StringManager s_stringMgr =↵ | | 3 | private static final StringManager s_stringMgr =↵
|
4 | StringManagerFactory.getStringManager(TriggerSourceTab.class);↵ | | 4 | StringManagerFactory.getStringManager(ViewSourceTab.class);↵
|
|
|
5 | /** SQL that retrieves the source of a stored procedure↵ | | 5 | /**↵
|
| | | 6 | * This interface defines locale specific strings.↵
|
| | | 7 | */↵
|
| | | 8 | private interface i18n↵
|
| | | 9 | {↵
|
| | | 10 | // i18n[oracle.diplayScriptDetails=Display script details]↵
|
| | | 11 | String HINT = s_stringMgr.getString("oracle.diplayScriptDetails");↵
|
| | | 12 | }↵
|
|
6 | . */↵ | | 13 | /** SQL that retrieves the data. */↵
|
7 | private static String SQL =↵ | | 14 | private static final String SQL =↵
|
8 | "select trigger_body from sys.all_triggers"↵ | | |
|
9 | + " where owner = ? and trigger_name↵ | | 15 | "select 'CREATE OR REPLACE VIEW ' || VIEW_NAME ||' AS ', TEXT " +↵
|
| | | 16 | "FROM SYS.ALL_VIEWS " +↵
|
10 | = ?";↵ | | 17 | "WHERE OWNER = ? AND VIEW_NAME = ? ";↵
|
| | | 18 | ↵
|
11 | public TriggerSourceTab()↵ | | 19 | public ViewSourceTab()↵
|
12 | {↵ | | 20 | {↵
|
13 | // i18n[oracle.showTriggerSource=Show trigger source]↵ | | 21 | ↵
|
14 | super(s_stringMgr.getString("oracle.showTriggerSource"));↵ | | 22 | super(i18n.HINT);↵
|
15 | }↵ | | 23 | }↵
|
|
16 | protected PreparedStatement createStatement() throws SQLException↵ | | 24 | protected PreparedStatement createStatement() throws SQLException↵
|
17 | {↵ | | 25 | {↵
|
18 | final ISession session = getSession();↵ | | 26 | ISession session = getSession();↵
|
19 | final IDatabaseObjectInfo doi = getDatabaseObjectInfo();↵ | | 27 | ↵
|
|
20 | ISQLConnection conn = session.getSQLConnection();↵ | | 28 | PreparedStatement pstmt = session.getSQLConnection()↵
|
21 | PreparedStatement pstmt = conn.prepareStatement(SQL↵ | | 29 | .prepareStatement(SQL);↵
|
22 | );↵ | | 30 | IDatabaseObjectInfo doi = getDatabaseObjectInfo();↵
|
23 | pstmt.setString(1, doi.getSchemaName());↵ | | 31 | pstmt.setString(1, doi.getSchemaName());↵
|
24 | pstmt.setString(2, doi.getSimpleName());↵ | | 32 | pstmt.setString(2, doi.getSimpleName());↵
|
25 | return pstmt | | 33 | return pstmt
|