1 | public class SnapshotSourceTab extends OracleSourceTab↵ | | 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(SnapshotSourceTab.class↵ | | 4 | StringManagerFactory.getStringManager(ViewSourceTab.class);↵
|
|
|
| | | 5 | /**↵
|
| | | 6 | * This interface defines locale specific strings.↵
|
| | | 7 | */↵
|
| | | 8 | private interface i18n↵
|
| | | 9 | {↵
|
| | | 10 | // i18n[oracle.diplayScriptDetails=Display script details]↵
|
5 | );↵ | | 11 | String HINT = s_stringMgr.getString("oracle.diplayScriptDetails");↵
|
| | | 12 | }↵
|
|
6 | /** SQL that retrieves the data. */↵ | | 13 | /** SQL that retrieves the data. */↵
|
7 | private static final String SQL =↵ | | 14 | private static final String SQL =↵
|
8 | "SELECT 'CREATE MATERIALIZED VIEW ' || TABLE_NAME || ' AS ', QUERY " +↵ | | 15 | "select 'CREATE OR REPLACE VIEW ' || VIEW_NAME ||' AS ', TEXT " +↵
|
9 | "FROM SYS.ALL_SNAPSHOTS " +↵ | | 16 | "FROM SYS.ALL_VIEWS " +↵
|
10 | "WHERE OWNER = ? AND TABLE_NAME = ? ";↵ | | 17 | "WHERE OWNER = ? AND VIEW_NAME = ? ";↵
|
11 | ↵ | | 18 | ↵
|
12 | public SnapshotSourceTab()↵ | | 19 | public ViewSourceTab()↵
|
13 | {↵ | | 20 | {↵
|
14 | // i18n[oracle.displaySnapshotDetails=Display materialized view details]↵ | | 21 | ↵
|
15 | super(s_stringMgr.getString("oracle.displaySnapshotDetails"));↵ | | |
|
16 | super.sourceType = OracleSourceTab.TABLE_TYPE;↵ | | 22 | super(i18n.HINT);↵
|
17 | }↵ | | 23 | }↵
|
|
18 | protected PreparedStatement createStatement() throws SQLException↵ | | 24 | protected PreparedStatement createStatement() throws SQLException↵
|
19 | {↵ | | 25 | {↵
|
20 | ISession session = getSession();↵ | | 26 | ISession session = getSession();↵
|
21 | PreparedStatement pstmt = session.getSQLConnection().prepareStatement(SQL);↵ | | 27 | PreparedStatement pstmt = session.getSQLConnection().prepareStatement(SQL);↵
|
22 | IDatabaseObjectInfo doi = getDatabaseObjectInfo();↵ | | 28 | IDatabaseObjectInfo doi = getDatabaseObjectInfo();↵
|
23 | pstmt.setString(1, doi.getSchemaName());↵ | | 29 | pstmt.setString(1, doi.getSchemaName());↵
|
24 | pstmt.setString(2, doi.getSimpleName());↵ | | 30 | pstmt.setString(2, doi.getSimpleName());↵
|
25 | return pstmt | | 31 | return pstmt
|