Slow SQL output when table alias is NOT used in order by clause

Hi guys,
My query is based on Oracle 9208
I have a table TAB1 with 68000 records with transaction_id as the primary key in this table (unique index).
I have another TAB2 with the same number of records again with transaction_id in this table (foreign key to above).
I have the below query that gets executed via an application:-
SELECT TO_CHAR(V1.TRANSACTION_ID), V1.POLICY_ID, V1.REQUEST_TYPE
FROM <VIEW> V1 WHERE V1.CERT_SERIAL_NUM=56192 AND
(V1.AUTH_GROUP_ID=0 OR V1.AUTH_GROUP_ID=1) AND ROWNUM <= 3 ORDER
BY TRANSACTION_ID ASC
The above view V1 is created as below:-
CREATE OR REPLACE FORCE VIEW "V1"
("TRANSACTION_ID",
"PARENT_TRANSACTION_ID",
"CA_DN_ID",
"AUTH_GROUP_ID",
"POLICY_ID",
"REQUEST_TYPE",
"REQUEST_STATUS",
"EE_DN_HASH",
"EE_DN",
"EE_EMAIL_HASH",
"EE_EMAIL",
"KEY_USAGE",
"SMART_CARD_SERIAL",
"CERT_TYPE",
"CERT_SERIAL_NUM",
"CERT_INDEX",
"RENEWAL_FLAG",
"ARCHIVE_FLAG",
"TIME_RECEIVED",
"DOWNLOADED",
"REQUEST_DATA",
"ACTION",
"STEP_NUM")
AS
SELECT
T1.transaction_id,
T1.parent_transaction_id,
T1.ca_dn_id,
V2.auth_group_id,
V2.policy_id,
T1.request_type,
T1.request_status,
T2.ee_dn_hash,
T2.ee_dn,
T2.ee_email_hash,
T2.ee_email,
T2.key_usage,
T2.smart_card_serial,
T2.cert_type,
T2.cert_serial_num,
T2.cert_index,
T2.renewal_flag,
T2.archive_flag,
T1.time_received,
T1.downloaded,
T1.request_data,
V2.action,
V2.step_num
FROM TAB1
<ANOTHER VIEW> V2,
TAB2 T1,
TAB2 T2
WHERE
T1.transaction_id = T2.transaction_id
AND
V2.policy_id = T1.policy_id
order by transaction_id;
The query at the top runs within milliseconds if the VIEW is created as :-
order by t2.transaction_id
But without the alias "t2" in the order by, the query takes about 1 1/2 minutes
Can you tell me why? I thought if you ordering by primary key (lesser number of values compared to foreign key values), the query should be faster..no?
Thanks in advance

Thanks for keeping up with this issue Hemant.
Here are the plans for each case.
I would be very interested in how you'd recognize which plan is the best and what are the derivatives.
I don't much (or rather anything!) what is 'card' values, 'cost' values etc which I believe are used to decide the best plan of the lot.
Thanks again
Note TAB1 and TAB2 are from view definition posted initially
1) Execution Plan for VIEW1 <<-- With ORDER BY" clause but no table ailas (order by transaction_id)
SQL> EXPLAIN PLAN FOR SELECT TO_CHAR(QT.TRANSACTION_ID), QT.POLICY_ID, QT.REQUEST_TYPE
2 FROM <VIEW1> QT WHERE QT.CERT_SERIAL_NUM=24293 AND
3 (QT.AUTH_GROUP_ID=0 OR QT.AUTH_GROUP_ID=1) AND ROWNUM <= 3 ORDER
4 BY TRANSACTION_ID ASC
5 /
Explained.
Elapsed: 00:00:01.00
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
| Id | Operation | Name | Rows | Bytes | Cost |
| 0 | SELECT STATEMENT | | 3 | 195 | 17 |
|* 1 | COUNT STOPKEY | | | | |
| 2 | VIEW | VIEW1 | 17 | 1105 | 17 |
|* 3 | SORT ORDER BY STOPKEY | | 17 | 38573 | 17 |
| 4 | NESTED LOOPS | | 17 | 38573 | 10 |
| 5 | MERGE JOIN CARTESIAN | | 1 | 167 | 9 |
| 6 | VIEW | VIEW2 | 1 | 52 | 8 |
| 7 | SORT UNIQUE | | 1 | 156 | 8 |
| 8 | NESTED LOOPS | | 1 | 156 | 6 |
| 9 | NESTED LOOPS | | 1 | 143 | 6 |
| 10 | NESTED LOOPS OUTER | | 1 | 117 | 5 |
|* 11 | HASH JOIN | | 1 | 104 | 5 |
| 12 | NESTED LOOPS | | 1 | 52 | 2 |
|* 13 | TABLE ACCESS FULL | TAB3 | 1 | 39 | 2 |
|* 14 | INDEX UNIQUE SCAN | (PK_TAB4) | 1 | 13 | |
| 15 | TABLE ACCESS FULL | TAB5 | 82 | 4264 | 2 |
| 16 | VIEW PUSHED PREDICATE | View3 | 1 | 13 | |
| 17 | NESTED LOOPS | | 1 | 52 | 2 |
| 18 | NESTED LOOPS | | 1 | 39 | 2 |
|* 19 | INDEX UNIQUE SCAN | (PK_TAB6) | 1 | 13 | 1 |
|* 20 | INDEX RANGE SCAN | (PK_TAB7) | 1 | 26 | 1 |
|* 21 | INDEX UNIQUE SCAN | (PK_TAB8) | 1 | 13 | |
| 22 | TABLE ACCESS BY INDEX ROWID| TAB9 | 3 | 78 | 1 |
|* 23 | INDEX UNIQUE SCAN | (PK_TAB9) | 1 | | |
|* 24 | INDEX UNIQUE SCAN | (PK_TAB10)| 1 | 13 | |
| 25 | BUFFER SORT | | 1 | 115 | 9 |
| 26 | TABLE ACCESS BY INDEX ROWID | TAB2 | 1 | 115 | 1 |
|* 27 | INDEX RANGE SCAN | (TAB2_IDX2)| 1 | | |
|* 28 | TABLE ACCESS BY INDEX ROWID | TAB1 | 12 | 25224 | 1 |
|* 29 | INDEX UNIQUE SCAN | (PK_TAB1) | 1 | | |
Predicate Information (identified by operation id):
1 - filter(ROWNUM<=3)
3 - filter(ROWNUM<=3)
11 - access("TAB5"."PATH_ID"="TAB4"."PATH_ID")
13 - filter("TAB3"."AUTH_GROUP_ID"<>(-1) AND ("TAB3"."AUTH_GROUP_ID"=0 OR "TAB3"."AUTH_GROUP_ID"=1))
14 - access("TAB3"."PATH_ID"="TAB4"."PATH_ID")
19 - access("TAB5"."DOMAIN_ID"="TAB6"."DOMAIN_ID")
20 - access("TAB6"."DOMAIN_ID"="TAB7"."DOMAIN_ID")
21 - access("TAB7"."RULE_ID"="TAB8"."RULE_ID")
23 - access("TAB9"."POLICY_ID"="TAB5"."POLICY_ID")
24 - access("TAB9"."ASSOCIATED_FORM_ID"="TAB10"."FORM_ID")
27 - access("TAB2"."CERT_SERIAL_NUM"=24293)
28 - filter("View2"."POLICY_ID"="TAB1"."POLICY_ID")
29 - access("TAB1"."TRANSACTION_ID"="TAB2"."TRANSACTION_ID")
Note: cpu costing is off
54 rows selected.
Elapsed: 00:00:01.81
Execution Plan
0 SELECT STATEMENT Optimizer=CHOOSE
1 0 COLLECTION ITERATOR (PICKLER FETCH) OF 'DISPLAY'
Statistics
39 recursive calls
0 db block gets
629 consistent gets
0 physical reads
104 redo size
5169 bytes sent via SQL*Net to client
405 bytes received via SQL*Net from client
5 SQL*Net roundtrips to/from client
31 sorts (memory)
0 sorts (disk)
54 rows processed
2) Execution Plan for VIEW1 <<-- With ORDER BY" clause and table alias (order by TAB2.transaction_id)
SQL> explain plan for SELECT TO_CHAR(QT.TRANSACTION_ID), QT.POLICY_ID, QT.REQUEST_TYPE
2 FROM <VIEW1> QT WHERE QT.CERT_SERIAL_NUM=30003 AND
3 (QT.AUTH_GROUP_ID=0 OR QT.AUTH_GROUP_ID=1) AND ROWNUM <= 3 ORDER
4 BY TRANSACTION_ID ASC
5 /
Explained.
Elapsed: 00:00:10.20
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
| Id | Operation | Name | Rows | Bytes | Cost |
| 0 | SELECT STATEMENT | | 3 | 195 | 14 |
| 1 | SORT ORDER BY | | 3 | 195 | 14 |
|* 2 | COUNT STOPKEY | | | | |
| 3 | VIEW | VIEW1 | 17 | 1105 | 13 |
| 4 | NESTED LOOPS | | 17 | 38573 | 13 |
| 5 | MERGE JOIN CARTESIAN | | 1 | 167 | 12 |
|* 6 | TABLE ACCESS BY INDEX ROWID | TAB2 | 1 | 115 | 4 |
| 7 | INDEX FULL SCAN | (TAB2_IDX) | 94 | | 1 |
| 8 | BUFFER SORT | | 1 | 52 | 8 |
| 9 | VIEW | VIEW2 | 1 | 52 | 8 |
| 10 | SORT UNIQUE | | 1 | 156 | 8 |
| 11 | NESTED LOOPS | | 1 | 156 | 6 |
| 12 | NESTED LOOPS | | 1 | 143 | 6 |
| 13 | NESTED LOOPS OUTER | | 1 | 117 | 5 |
|* 14 | HASH JOIN | | 1 | 104 | 5 |
| 15 | NESTED LOOPS | | 1 | 52 | 2 |
|* 16 | TABLE ACCESS FULL | TAB3 | 1 | 39 | 2 |
|* 17 | INDEX UNIQUE SCAN | (PK_TAB4) | 1 | 13 | |
| 18 | TABLE ACCESS FULL | TAB5 | 82 | 4264 | 2 |
| 19 | VIEW PUSHED PREDICATE | View3 | 1 | 13 | |
| 20 | NESTED LOOPS | | 1 | 52 | 2 |
| 21 | NESTED LOOPS | | 1 | 39 | 2 |
|* 22 | INDEX UNIQUE SCAN | (PK_TAB6) | 1 | 13 | 1 |
|* 23 | INDEX RANGE SCAN | (PK_TAB7) | 1 | 26 | 1 |
|* 24 | INDEX UNIQUE SCAN | (PK_TAB8) | 1 | 13 | |
| 25 | TABLE ACCESS BY INDEX ROWID| TAB9 | 3 | 78 | 1 |
|* 26 | INDEX UNIQUE SCAN | (PK_TAB9) | 1 | | |
|* 27 | INDEX UNIQUE SCAN | (PK_TAB10) | 1 | 13 | |
|* 28 | TABLE ACCESS BY INDEX ROWID | TAB1 | 12 | 25224 | 1 |
|* 29 | INDEX UNIQUE SCAN | (PK_TAB1) | 1 | | |
Predicate Information (identified by operation id):
2 - filter(ROWNUM<=3)
6 - filter("TAB2"."CERT_SERIAL_NUM"=30003)
14 - access("TAB5"."PATH_ID"="TAB4"."PATH_ID")
16 - filter("TAB3"."AUTH_GROUP_ID"<>(-1) AND ("TAB3"."AUTH_GROUP_ID"=0 OR "TAB3"."AUTH_GROUP_ID"=1))
17 - access("TAB3"."PATH_ID"="TAB4"."PATH_ID")
22 - access("TAB5"."DOMAIN_ID"="TAB6"."DOMAIN_ID")
23 - access("TAB6"."DOMAIN_ID"="TAB7"."DOMAIN_ID")
24 - access("TAB7"."RULE_ID"="TAB8"."RULE_ID")
26 - access("TAB9"."POLICY_ID"="TAB5"."POLICY_ID")
27 - access("TAB9"."ASSOCIATED_FORM_ID"="TAB10"."FORM_ID")
28 - filter("VIEW2"."POLICY_ID"="TAB1"."POLICY_ID")
29 - access("TAB1"."TRANSACTION_ID"="TAB2"."TRANSACTION_ID")
Note: cpu costing is off
53 rows selected.
Elapsed: 00:00:08.29
Execution Plan
0 SELECT STATEMENT Optimizer=CHOOSE
1 0 COLLECTION ITERATOR (PICKLER FETCH) OF 'DISPLAY'
Statistics
1079 recursive calls
0 db block gets
597 consistent gets
21 physical reads
0 redo size
5177 bytes sent via SQL*Net to client
405 bytes received via SQL*Net from client
5 SQL*Net roundtrips to/from client
63 sorts (memory)
0 sorts (disk)
53 rows processed
3) Execution Plan for VIEW1 <<-- Without any "ORDER BY" clause
SQL> explain plan for SELECT TO_CHAR(QT.TRANSACTION_ID), QT.POLICY_ID, QT.REQUEST_TYPE
2 FROM <VIEW1> QT WHERE QT.CERT_SERIAL_NUM=30003 AND
3 (QT.AUTH_GROUP_ID=0 OR QT.AUTH_GROUP_ID=1) AND ROWNUM <= 3 ORDER
4 BY TRANSACTION_ID ASC
5 /
Explained.
Elapsed: 00:00:10.20
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
| Id | Operation | Name | Rows | Bytes | Cost |
| 0 | SELECT STATEMENT | | 3 | 213 | 11 |
| 1 | SORT ORDER BY | | 3 | 213 | 11 |
|* 2 | COUNT STOPKEY | | | | |
| 3 | NESTED LOOPS | | 17 | 1207 | 10 |
| 4 | MERGE JOIN CARTESIAN | | 1 | 32 | 9 |
| 5 | VIEW | VIEW2 | 1 | 26 | 8 |
| 6 | SORT UNIQUE | | 1 | 156 | 8 |
| 7 | NESTED LOOPS | | 1 | 156 | 6 |
| 8 | NESTED LOOPS | | 1 | 143 | 6 |
| 9 | NESTED LOOPS OUTER | | 1 | 117 | 5 |
|* 10 | HASH JOIN | | 1 | 104 | 5 |
| 11 | NESTED LOOPS | | 1 | 52 | 2 |
|* 12 | TABLE ACCESS FULL | TAB3 | 1 | 39 | 2 |
|* 13 | INDEX UNIQUE SCAN | PK_TAB4 | 1 | 13 | |
| 14 | TABLE ACCESS FULL | TAB5 | 82 | 4264 | 2 |
| 15 | VIEW PUSHED PREDICATE | VIEW3 | 1 | 13 | |
| 16 | NESTED LOOPS | | 1 | 52 | 2 |
| 17 | NESTED LOOPS | | 1 | 39 | 2 |
|* 18 | INDEX UNIQUE SCAN | PK_TAB6 | 1 | 13 | 1 |
|* 19 | INDEX RANGE SCAN | PK_TAB7 | 1 | 26 | 1 |
|* 20 | INDEX UNIQUE SCAN | PK_TAB8 | 1 | 13 | |
| 21 | TABLE ACCESS BY INDEX ROWID| TAB9 | 3 | 78 | 1 |
|* 22 | INDEX UNIQUE SCAN | PK_TAB9 | 1 | | |
|* 23 | INDEX UNIQUE SCAN | PK_TAB10 | 1 | 13 | |
| 24 | BUFFER SORT | | 1 | 6 | 9 |
| 25 | TABLE ACCESS BY INDEX ROWID | TAB2 | 1 | 6 | 1 |
|* 26 | INDEX RANGE SCAN | TAB2_IDX2 | 1 | | |
|* 27 | TABLE ACCESS BY INDEX ROWID | TAB1 | 12 | 468 | 1 |
|* 28 | INDEX UNIQUE SCAN | PK_TAB1 | 1 | | |
Predicate Information (identified by operation id):
2 - filter(ROWNUM<=3)
10 - access("TAB5"."PATH_ID"="TAB4"."PATH_ID")
12 - filter("TAB3"."AUTH_GROUP_ID"<>(-1) AND ("TAB3"."AUTH_GROUP_ID"=0 OR "TAB3"."AUTH_GROUP_ID"=1))
13 - access("TAB3"."PATH_ID"="TAB4"."PATH_ID")
18 - access("TAB5"."DOMAIN_ID"="TAB6"."DOMAIN_ID")
19 - access("TAB6"."DOMAIN_ID"="TAB7"."DOMAIN_ID")
20 - access("TAB7"."RULE_ID"="TAB8"."RULE_ID")
22 - access("TAB9"."POLICY_ID"="TAB5"."POLICY_ID")
23 - access("TAB9"."ASSOCIATED_FORM_ID"="TAB10"."FORM_ID")
26 - access("TAB2"."CERT_SERIAL_NUM"=1022)
27 - filter("VIEW2"."POLICY_ID"="TAB1"."POLICY_ID")
28 - access("TAB1"."TRANSACTION_ID"="TAB2"."TRANSACTION_ID")
Note: cpu costing is off
52 rows selected.
Elapsed: 00:00:03.37
Execution Plan
0 SELECT STATEMENT Optimizer=CHOOSE
1 0 COLLECTION ITERATOR (PICKLER FETCH) OF 'DISPLAY'
Statistics
38 recursive calls
0 db block gets
287 consistent gets
0 physical reads
0 redo size
5006 bytes sent via SQL*Net to client
405 bytes received via SQL*Net from client
5 SQL*Net roundtrips to/from client
29 sorts (memory)
0 sorts (disk)
52 rows processed

Similar Messages

  • Field or table alias is not allowed as an input of table functions

    Hi,
    I am trying to invoke a user defined table function through a SQL snippet like below.
    SELECT (SELECT * FROM PKG_ORG_ORG_HAS_CHILDREN(org_id)) has_child
    from PA_ORG_OWNER
    where stud_id = 'np1';
    But for some reason it will not accept column name as an IN parameter
    Could not execute 'SELECT (SELECT * FROM PKG_ORG_ORG_HAS_CHILDREN(org_id)) has_child from PA_ORG_OWNER os where ...' in 2 ms 451 µs .
    SAP DBTech JDBC: [7] (at 47): feature not supported: field or table alias is not allowed as an input of table functions: line 1 col 48 (at pos 47)
    In general our product has a LOT of small Oracle PL/SQL functions that are invoked from SQL within application code. This is a huge bottleneck while migrating to HANA. Any best practice anyone can recommend for this issue?
    -Thanks
    nphana

    Hi nphana,
    Instead of using single function, you can create another function and Invoke the function and can use IN parameter.
    Here is the example:
    CREATE FUNCTION RAJ.MY_FUNC (I_VKORG NVARCHAR (4), I_VTWEG NVARCHAR (2), 
                 I_SPART NVARCHAR (2),  I_PARVW NVARCHAR (2), I_PARZA NVARCHAR (3) )
    RETURNS TABLE (KUNNR NVARCHAR (10))
    LANGUAGE SQLSCRIPT AS
    BEGIN
      RETURN
      SELECT "ECC2HANA"."KNVP".KUNNR FROM  "ECC2HANA"."KNVP"
       WHERE "ECC2HANA"."KNVP".VKORG = :I_VKORG
         AND "ECC2HANA"."KNVP".VTWEG = :I_VTWEG
         AND "ECC2HANA"."KNVP".SPART = :I_SPART
         AND "ECC2HANA"."KNVP".PARVW = :I_PARVW
         AND "ECC2HANA"."KNVP".PARZA = :I_PARZA
    END
    SELECT * FROM RAJ.MY_FUNC('7500','10','00','AG','000');
    Result is shown below:
    Now I created another function so that I can use the result set of above function which is used as criteria for some other table.
    I not used any input parameter for second function but can be used if required.
    CREATE FUNCTION RAJ.FUNC_MY_FUNC ( )
    RETURNS TABLE (NAME1 NVARCHAR (35))
    LANGUAGE SQLSCRIPT AS
    BEGIN
    RETURN 
    SELECT "ECC2HANA"."KNA1".NAME1 FROM "ECC2HANA"."KNA1"
      WHERE "ECC2HANA"."KNA1".KUNNR IN (SELECT * FROM RAJ.MY_FUNC('7500','10','00','AG','000'));
    END;
    Result is shown below:
    Similarly you can do for your requirement.
    Regards
    Raj

  • Com.sap.sql.log.OpenSQLException: table or view not exists

    Hi!.
    I'm developing a Portal Component over NW EP 2004s (7.0) which access to SQL Server database. I have created three tables on the system db (EPD). Connection is Ok, over datasource object, but i can't make a SELECT operation to my new tables.
    Hovewer, making a SELECT operation over older system tables is OK.
    I have adjusted permissions on my new tables, similar to the older tables. The table's owner is the same too.
    The exception i get is:
    **Exception of type com.sap.sql.log.OpenSQLException caught: The SQL statement "SELECT * FROM "SAPEPDDB"."UME_EP_UNLOCKUSERS"" contains the semantics error[s]: - 1:24 - the table or view >>UME_EP_UNLOCKUSERS<< does not exist**
    [EXCEPTION]
    *com.sap.sql.log.OpenSQLException: The SQL statement "SELECT * FROM "SAPEPDDB"."UME_EP_UNLOCKUSERS"" contains the semantics error[s]: - 1:24 - the table or view >>UME_EP_UNLOCKUSERS<< does not exist*
    at com.sap.sql.jdbc.common.StatementAnalyzerImpl.check(StatementAnalyzerImpl.java:38)
    at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement(StatementAnalyzerImpl.java:101)
    at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement(StatementAnalyzerImpl.java:87)
    at com.sap.sql.jdbc.common.CommonStatementImpl.executeQuery(CommonStatementImpl.java:114)
    at com.sap.engine.services.dbpool.wrappers.StatementWrapper.executeQuery(StatementWrapper.java:172)
    at com.uralita.database.DbManager.executeQuery(DbManager.java:105)
    at com.uralita.ListaSistemas$ListaSistemasDynPage.getSystemsR3(ListaSistemas.java:184)
    at com.uralita.ListaSistemas$ListaSistemasDynPage.doInitialization(ListaSistemas.java:93)
    at com.sapportals.htmlb.page.PageProcessor.handleRequest(PageProcessor.java:105)
    at com.sapportals.portal.htmlb.page.PageProcessorComponent.doContent(PageProcessorComponent.java:134)
    at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)
    at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)
    at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
    at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
    at com.sapportals.portal.prt.core.async.AsyncIncludeRunnable$1$DoDispatchRequest.run(AsyncIncludeRunnable.java:377)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sapportals.portal.prt.core.async.AsyncIncludeRunnable.run(AsyncIncludeRunnable.java:390)
    at com.sapportals.portal.prt.core.async.ThreadContextRunnable.run(ThreadContextRunnable.java:164)
    at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:729)
    at java.lang.Thread.run(Thread.java:534)
    Caused by: com.sap.sql.sqlparser.CommonSQLParserException: - 1:24 - the table or view >>UME_EP_UNLOCKUSERS<< does not exist
    at com.sap.sql.sqlparser.CommonSQLStatement.checkSemantics(CommonSQLStatement.java:171)
    at com.sap.sql.jdbc.common.StatementAnalyzerImpl.check(StatementAnalyzerImpl.java:35)
    ... 19 more
    caused by
    com.sap.sql.sqlparser.CommonSQLParserException: - 1:24 - the table or view >>UME_EP_UNLOCKUSERS<< does not exist
    at com.sap.sql.sqlparser.CommonSQLStatement.checkSemantics(CommonSQLStatement.java:171)
    at com.sap.sql.jdbc.common.StatementAnalyzerImpl.check(StatementAnalyzerImpl.java:35)
    at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement(StatementAnalyzerImpl.java:101)
    at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement(StatementAnalyzerImpl.java:87)
    at com.sap.sql.jdbc.common.CommonStatementImpl.executeQuery(CommonStatementImpl.java:114)
    at com.sap.engine.services.dbpool.wrappers.StatementWrapper.executeQuery(StatementWrapper.java:172)
    at com.uralita.database.DbManager.executeQuery(DbManager.java:105)
    at com.uralita.ListaSistemas$ListaSistemasDynPage.getSystemsR3(ListaSistemas.java:184)
    at com.uralita.ListaSistemas$ListaSistemasDynPage.doInitialization(ListaSistemas.java:93)
    at com.sapportals.htmlb.page.PageProcessor.handleRequest(PageProcessor.java:105)
    at com.sapportals.portal.htmlb.page.PageProcessorComponent.doContent(PageProcessorComponent.java:134)
    at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)
    at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)
    at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
    at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
    at com.sapportals.portal.prt.core.async.AsyncIncludeRunnable$1$DoDispatchRequest.run(AsyncIncludeRunnable.java:377)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sapportals.portal.prt.core.async.AsyncIncludeRunnable.run(AsyncIncludeRunnable.java:390)
    at com.sapportals.portal.prt.core.async.ThreadContextRunnable.run(ThreadContextRunnable.java:164)
    at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:729)
    at java.lang.Thread.run(Thread.java:534)
    Someone has been getting this problem? Any idea?
    Thanks!

    I have tried that.
    [EXCEPTION]
    *com.sap.sql.log.OpenSQLException: The SQL statement "SELECT * FROM EPD.SAPEPDDB.UME_EP_SLD" contains the syntax error[s]: - Open SQL syntax error: table names must not specify a catalog name (delete "EPD". before "SAPEPDDB"."UME_EP_SLD")*
    Database name must be Ok, because i can access to other tables which are in the same DB...
    Thanks for your help

  • How to reduce the transmission of data when the phone is not used?

    When my iPhone is not used the transmission of data is ongoing and I will not stop the 3G, what should I do?

    Priya:
    It is likely that the BLOB content defined in your table is being stored 'Out-of-Line'. This means that the LOB columns are stored in segments of their own. These then are the segments that may need shrinking.
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14249/adlob_tables.htm#i1006363
    Varad

  • How feed many record in table component and not use append command again

    hi master
    How I feed Multiple records in table component and not use append and save command again and again
    Same as oracle grid
    I give many record and save one time
    Please give me idea how I add Multiple record and save one time not use append and save command again and again
    Thank�s
    aamir

    Hi!
    appendRow() method just add temporal row. For add them to DB commitChanges() method should be used. So you can use appendRow() method several times, fill every new row and only then use commitChanges() method. In this case all new rows will be added to DB per one time.
    Thanks,
    Roman.

  • Setting up iCloud when you choose do not use icloud

    How do you activTe iCloud when you choose do not use iCloud on last iOS update

    Follow: http://www.apple.com/icloud/setup/

  • Count records in table where fields not used in Report

    Hi
    I was wondering if anyone could help me with a problem I have. I am new to Crystal Reports... I am using CR2008 and XSD as a datasource.
    I have the following tables used in the report.
    Programme Table          Risk Table          Control Table          Test Table
    ID               ID               ID               ID
    Name               ProgrammeID          RiskID               ControlID
    Details               Description          Description          Description
    Opinion               Notes               Notes               Notes
                   Risk Recs Table          Control Recs Table     Test Rec Table
                   ID               ID               ID     
                   RiskID               ControlID          TestID
                   Description          Description          Description
    In the report that I have to design, I need to display the Notes from each of the Risk, Control and Test tables in hierarchical order and also display the notes when there are one or more recommendations attached to each Notes.
              Risk Notes     - Display only when risk rec count <> 0
              Control Notes     - Display only when control rec count <> 0
              Test Notes     - Display only when test rec count <> 0
    So far I have designed the report as follows:
    I have grouping around the Risk Notes, Control Notes and Test Notes as
         Group 1 - Group by ProgrammeID
         Group 2 - Group by RiskID
         Group 3 - Group by ControlID
         Group 4 - Group by TestID
    (This is giving me the notes in the order that I want)
    Since I want to know if each of the risk, control and test have got any recommendations, I created summary counts to get the recommendation count for Risk, Control and Tests. But I am not able to get the right count. Effectively, what I need to do is go through the Risk Recommendation table and count the recommendations that belong to that particular RiskID. If the count = 0 then I want to supress the Risk Notes (Group Header 2.)
    Can anyone suggest how to get the count?
    Thanks

    Hi
    I am using Distinct Count.
    When there are no recommendations then the count always comes out as 1 and the count is correct for the first grouping. After that even if there are more than one recommendation, the count is always 1!
    How do I reset a summary count?
    I even tried writing a formula to do the count..
    NumberVar riskCount;
    WhilePrintingRecords;
    riskCount := DistinctCount ({RiskRec.ID}, {Control.RiskID})
    and another formula to reset this count, even then the count is still coming out incorrect. It brings a value 1 when there are no recommendations and the count is right for one set of grouping only.
    I have just recently started using CR and havent quite mastered it yet!
    Thanks...

  • Identify tables which are not used in any access seq.

    Hi
    Need to identify those tables (A500 - A999) which are NOT used in any access sequence (table T682I).
    Not sure how to do this.
    Thanks for the help

    Hi Karen,
    if you don't want to use SE11 and see it on one glance, you could use the following coding:
    DATA: it_t682i TYPE TABLE OF t682i,
          wa_t682i TYPE t682i,
          it_missing TYPE TABLE OF t682i,
          wa_count TYPE kotabnr VALUE 499.
    SELECT * FROM t682i INTO TABLE it_t682i
                  WHERE kvewe = 'A'
                  AND  kotabnr BETWEEN 500 AND 999.
    DO.
      ADD 1 TO wa_count.
      READ TABLE it_t682i INTO wa_t682i
                 WITH KEY kotabnr = wa_count.
      IF sy-subrc <> 0.
        CLEAR wa_t682i.
        MOVE wa_count TO wa_t682i-kotabnr.
        APPEND wa_t682i TO it_missing.
      ENDIF.
      IF wa_count = 999.
        EXIT.
      ENDIF.
    ENDDO.
    BREAK 'your user'.
    The table it_missing is just a quicky solution, you could use a table with just one field or use write to print the result.
    Hope that helps!
    Regards
    Nicola

  • How can I prevent iTunes from opening when Firefox is open, when the computer is not used for a few minutes?

    iTunes opens on my screen if Firefox is on, with page minimised or with current page open, if I do not use the machine for a few minutes. I can't find anything to turn this off.

    When you first insert a CD your Mac comes up with a box saying
    "You have inserted a CD" (duuh, Apple...)
    Then you choose from a pop-up menu that offers "Open in Finder", "Open in iTunes", etc
    At some point you (or someone) has chosen "Open in iTunes" then checked the little box that says "Make this the default from now on".
    If you go into System Prefs (as already mentioned) you have a choice to reset what you want to do with a blank CD.

  • 3 Table Join with group by and order by clauses

    I am porting from MySQL to Oracle 8i. I have a three Table Join in MySQL as follows:
    select distinct TO_DAYS(l.listend)-TO_DAYS(NOW()) AS daysLeft, i.minbid, l.listend, i.itemid, i.itemtitle, l.listingid, l.lendstart, l.lendend, l.status, MAX(b.amount) AS curBid, COUNT(b.amount) AS numBids from TBL_ITEMS i, TBL_LISTING l LEFT JOIN TBL_BIDS b ON l.listingid=b.listingid where i.itemid = l.itemid AND l.status='1' AND (TO_DAYS(l.listend)-TO_DAYS(NOW()) >= 0) AND i.catcode LIKE'12__' GROUP BY listingid order by curBid DESC, daysLeft;
    It performs an straight join on the first 2 tables (TBL_ITEMS and TBL_LISTING) and a LEFT JOIN between the previous result set and TBL_BIDS. TBL_BIDS uses a group by clause to obtain MAX and COUNT info. This final result set is the sorted (ORDER BY).
    I have tried to reconstruct this type of call in Oracle and have failed. Several problems that I have notices: Oracle does not let me pull in additional columns when doing a GROUP BY clause.
    (see below for my work around)
    I have worked around the problem by creating a TABLE with the group by functionality and doing a straing 3 table join. (NOTE: I cannot create a view because use a LIKE function in the call... view dont have indexes). However, when I try to alias the column that returns DATE subtraction ("l.listend-TRUNC(SYSDATE) daysLeft" OR "l.listend-TRUNC(SYSDATE) dayLeft") I cannot use the LIKE statement.
    Here is my question. How do I port the above 3-table MySQL call to Oracle. Why am I having these problems (is it the Oracle optimizer?) and how do I avaopid them in the future.
    I really appreciate anyone's input. Thanks,
    Inder
    WORK AROUND:
    FIRST STEP:
    "create TABLE BIDSUM as
    select l.listingid, COUNT(b.amount) numBids, MAX(b.amount) curBid from TBL_LISTING l, TBL_BIDS b where l.listingid=b.listingid(+) group by (l.listingid);"
    NEXT STEP:
    select i.minbid, i.itemtitle, l.lendstart-TRUNC(SYSDATE), l.lendend, l.listingid, l.status, s.numbids, s.curbid from TBL_ITEMS i, TBL_LISTING l, BIDSUM s where l.listingid=s.listingid AND i.itemid=l.itemid AND l.status='1' AND i.catcode LIKE '12%';
    THIS ALSO WORKS (no LIKE):
    "select i.minbid, i.itemtitle, l.lendstart-TRUNC(SYSDATE) daysLeft, l.lendend, l.listingid, l.status, s.numbids, s.curbid from TBL_ITEMS i, TBL_LISTING l, BIDSUM s where l.listingid=s.listingid AND i.itemid=l.itemid AND l.status='1' AND i.catcode='12'";
    BUT THIS DOES NOT (alias the DATE arimetic)
    select i.minbid, i.itemtitle, l.lendstart-TRUNC(SYSDATE) daysLeft, l.lendend, l.listingid, l.status, s.numbids, s.curbid from TBL_ITEMS i, TBL_LISTING l, BIDSUM s where l.listingid=s.listingid AND i.itemid=l.itemid AND l.status='1' AND i.catcode LIKE '12__';

    I am porting from MySQL to Oracle 8i. I have a three Table Join in MySQL as follows:
    select distinct TO_DAYS(l.listend)-TO_DAYS(NOW()) AS daysLeft, i.minbid, l.listend, i.itemid, i.itemtitle, l.listingid, l.lendstart, l.lendend, l.status, MAX(b.amount) AS curBid, COUNT(b.amount) AS numBids from TBL_ITEMS i, TBL_LISTING l LEFT JOIN TBL_BIDS b ON l.listingid=b.listingid where i.itemid = l.itemid AND l.status='1' AND (TO_DAYS(l.listend)-TO_DAYS(NOW()) >= 0) AND i.catcode LIKE'12__' GROUP BY listingid order by curBid DESC, daysLeft;
    It performs an straight join on the first 2 tables (TBL_ITEMS and TBL_LISTING) and a LEFT JOIN between the previous result set and TBL_BIDS. TBL_BIDS uses a group by clause to obtain MAX and COUNT info. This final result set is the sorted (ORDER BY).
    I have tried to reconstruct this type of call in Oracle and have failed. Several problems that I have notices: Oracle does not let me pull in additional columns when doing a GROUP BY clause.
    (see below for my work around)
    I have worked around the problem by creating a TABLE with the group by functionality and doing a straing 3 table join. (NOTE: I cannot create a view because use a LIKE function in the call... view dont have indexes). However, when I try to alias the column that returns DATE subtraction ("l.listend-TRUNC(SYSDATE) daysLeft" OR "l.listend-TRUNC(SYSDATE) dayLeft") I cannot use the LIKE statement.
    Here is my question. How do I port the above 3-table MySQL call to Oracle. Why am I having these problems (is it the Oracle optimizer?) and how do I avaopid them in the future.
    I really appreciate anyone's input. Thanks,
    Inder
    WORK AROUND:
    FIRST STEP:
    "create TABLE BIDSUM as
    select l.listingid, COUNT(b.amount) numBids, MAX(b.amount) curBid from TBL_LISTING l, TBL_BIDS b where l.listingid=b.listingid(+) group by (l.listingid);"
    NEXT STEP:
    select i.minbid, i.itemtitle, l.lendstart-TRUNC(SYSDATE), l.lendend, l.listingid, l.status, s.numbids, s.curbid from TBL_ITEMS i, TBL_LISTING l, BIDSUM s where l.listingid=s.listingid AND i.itemid=l.itemid AND l.status='1' AND i.catcode LIKE '12%';
    THIS ALSO WORKS (no LIKE):
    "select i.minbid, i.itemtitle, l.lendstart-TRUNC(SYSDATE) daysLeft, l.lendend, l.listingid, l.status, s.numbids, s.curbid from TBL_ITEMS i, TBL_LISTING l, BIDSUM s where l.listingid=s.listingid AND i.itemid=l.itemid AND l.status='1' AND i.catcode='12'";
    BUT THIS DOES NOT (alias the DATE arimetic)
    select i.minbid, i.itemtitle, l.lendstart-TRUNC(SYSDATE) daysLeft, l.lendend, l.listingid, l.status, s.numbids, s.curbid from TBL_ITEMS i, TBL_LISTING l, BIDSUM s where l.listingid=s.listingid AND i.itemid=l.itemid AND l.status='1' AND i.catcode LIKE '12__';

  • Jdbc bug in executeUpdate(sql, int[]) when table name is case-sensitive;

    I have found a bug in oracle's jdbc (ojdbc6.jar), can someone tell me how to submit it so that it can be fixed?
    The BUG: using executeUpdate(insert_sql_stmt, int[]) to retrieve the generatedKey generated by before-insert trigger using a sequence results in error when the tablename is case-sensitive (but OK if table name in uppercase).
    Steps to reproduce:
    1a. create table "mixCase" (f1 integer, f2 varchar2(20));
    1b. create table upperCase (f1 integer, f2 varchar2(20));
    2a. create sequence mixCase_seq start with 1;
    2b. create sequence upperCase seq start with 1;
    3a. create or replace trigger mixCase_trigger before insert on "mixCase"
    bq. for each row \\ begin \\ select mixCase_seq.nextval into :new.f1 from dual; \\ end;
    3b. create or replace trigger upperCase_trigger before insert on upperCase
    bq. for each row \\ begin \\ select upperCase_seq.nextval into :new.f1 from dual; \\ end;
    4a. String url = "jdbc:oracle:thin:@//localhost:1521/orcl";
    bq. conn=DriverManager.getConnection(url,user,password); \\ Statement stmt = conn.createStatement (); \\ int rc=stmt.executeUpdate("insert into \"mixCase\"(f2) values('aa')",new int[]{1});
    4b. String url = "jdbc:oracle:thin:@//localhost:1521/orcl";
    bq. conn=DriverManager.getConnection(url,user,password); \\ Statement stmt = conn.createStatement (); \\ int rc=stmt.executeUpdate("insert into upperCase(f2) values('aa')",new int[]{1});
    When you run 4a or 4b in a java jdbc program:
    4b runs OK and rset=stmt.getGeneratedKeys() returns the correct f1 value of 1.
    4a results in error:
    bq. h6. java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist \\ + at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:91)+ \\ + at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:112)+ \\ + at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:173)+ \\ + at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)+ \\ + at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:406)+ \\ + ...+
    +Notes:&lt;/&lt;/em&gt;
    # If Statement.RETURN_GENERATEDKEYS is used instead of "new int[]{1}" in 4b, there is no error but the rset=stmt.getGeneratedKeys() returned in a ROWID such as 'AAARUyAAEAAAAGQAAL', not what is expected. Other database's jdbc return the correct generated integer value.
    # Same 4b error if new String[]{"f1"} is used as 2nd argument for executeUpdate.
    # The only difference in 4a and 4b is that 4a has case-sensitive table name. All sequence names, trigger names, column names are implicitly deemed to be uppercase by oracle in both cases.
    bq.
    Edited by: user10343198 on Oct 2, 2008 5:50 PM
    Edited by: user10343198 on Oct 2, 2008 6:34 PM

    Please patch one fo your machines to 10.2.0.3 and then try and duplicate. You do not have to go through the complete registration of the XSD process thoguh you can check and see if the c based parser will validate on the command line using the
    schema executible under your oracle_home bin directory.
    schema 1.xml 1.xsd
    for example
    if it dupes in 10.2.0.3 open a TAR with support so that we may bug it.
    regards
    Coby

  • Extremely Slow Download Speeds when MacBook Pro is not plugged in.

    I have a MacBook Pro 17" that I bought in May of 2007. I have Verizon High Speed DSL service. I have a Netgear wireless router. When my MacBook Pro is plugged in to a power outlet, it has very fast download speeds. As soon as I unplug it, it slows way down. I am talking like 2 or 3 minutes to load a page that would normally take about 1 second. Is there a setting I can change?

    i have a similar problem. My MBP is taking a while to load pages. I dont know if its my internet speeds or my computer.

  • Answers shows error for table that is not used in query

    Hi,
    I have two fact tables, both share one common dimension and also have other dimensions. For simplicity let's assume there are only two dimensions for each fact: Dim1 and Dim2 have joins to Fact1 and Dim2 and Dim3 joins to Fact2. (Dim2 is joined to both).
    When I query in answers aggregated data from Dim2, Fact1 and Fact2 everything is ok. When I query data from Dim2 and only Fact1 also everything looks fine, however when I query data from Dim1 and Fact1 I get error about Fact2
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 15018] Incorrectly defined logical table source (for fact table fakti - Grāmatojumu rindas) does not contain mapping for [dim - Piegādātājs.Hansa kods]. (HY000)
    SQL Issued: SELECT "dim - Piegādātājs"."Hansa kods" saw_0, "fakti - Piegādātāju rēķinu rindas"."Summa ar PVN (LVL)" saw_1 FROM "Kreditori single source" ORDER BY saw_0
    As you can see table "fakti - Grāmatojumu rindas" is even not shown in SQL Issued.
    One more thing - if I first query data from Dim1, Dim2 and Fact1, look at results and afterwards delete Dim2 (leaving Dim1 and Fact1) then query returns data without error.
    Must be that error is in Business Layer, but I have no idea what should I do to correct it.

    Sveiks!
    I am not really sure what could have caused this. And, obviously, rebuilding the repository helped.
    It seems you could get it to work if you queried dim1, dim2 and fact and then removed dim2 (like you said). So, that suggests something almost on the order of a glitch or, possibly, a bug. The fact that simply rebuilding the repository helped seems to support my glitch hunch, but I am not really sure.
    I am relatively new to this product, and the only thing I can suggest as far as business model goes is to pay attention to any warnings when you do "Check Global Consistency". Sometimes, things work even with warnings, but you might encounter strange problems down the line.
    -sb

  • Help - Premiere CC2014 When exporting it's not using my whole CPU LONG EXPORTS

    Using my recently built computer with:
    250gb SSD samsung (Software)
    2TB HD 7200 rpm (media, export)
    6 core I7 4930K
    Noctua SSO CPU cooler
    Nvidia Geforce 770 4gb GPU
    32 gb of ram
    750 watt power supply
    Asus mobo
    Pretty decent computer. that shouldnt have problems exporting pretty basic videos.
    I am exporting for the web.   .h264 CBR with 12-16 mbps  or similar
    No Max rendering checked.
    using multiple camera files from Sony, Canon, Gopro.
    When it starts exporting a video that is 20 minutes long will take 4 hours to export. Video that is 3 minutes long (right now) is taking 25 minuts to export. That didn't used to be the case.
    I open my Task manager and look at the processor it is only using 1 core at about 10%
    I do have GPU acceleration on but I have switched it on and off and it hasn't made a difference.
    I believe when I exported from my CS5 version it would use the whole processor and hash it out real quick.
    THE BIG QUESTION: IS THERE ANY SETTINGS I NEED TO CHANGE TO OPTIMIZE MY COMPUTERS HARDWARE TO EXPORT THINGS EFFICIENTLY.
    Anyone have this problem and find a solution for it?
    I am new to usin the adobe community and problem solving on forums so let me know if I didn't give you enough information.

    I too have this problem, and it seems to be relatively new. I'm trying to figure out if there's anything I changed, but I can't place it. I've read a few threads with people having this same issue though, so I don't feel like it's anything I've done.
    The only solution I've come across is to do a restart. After restarting, I open AME and just start my queue. It then utilizes all cores. Tomorrow I'm going to attempt to install a previous version of AME and see if the problem goes away.
    This thread mentions a solution: AME CC2014 Very Slow Encoding
    However, I believe this solution does not work. I did as it says, and it only temporarily fixed it, and I think that was due to the restart. Also, my power settings are set to Performance.

  • Why does iTunes shut down when playing music but not using computer, why does iTunes shut down when playing music but not using computer

    Hi Everybody
    When I use my macbook pro running lion 10.7.2 to play music through itunes it shuts down after about 2 minutes, is there anything I can set to keep the itunes open and playing when  not in use, this problem only started when I updated from snow loepard to lion.
    Thanks

    Hi Limnos
    I have tried that but it makes no difference at all, the only way I have found to get continues sound is to open and set a keynote presentation onto play and dimmed the screen using the function key and adjusting it manually so as not to kicker my screen, there must be an easier way than this.
    Thanks for trying

Maybe you are looking for

  • I need major help with Adobe Reader!

    I am a student and I need Adobe Reader for my e-books and when I click on my chapter to read it, Adobe Reader says not responding after a few seconds and closes.  I have double checked the license agreement and accepted twice so I know that is not th

  • Photoshop CS6 Extended is not in the Download Assistant

    How can I d/l Photoshop CS6 Extended? It's not in the Download Assistant.

  • Upgraded to Mavericks 10.9, running very slow all the time

    I know this has been asked many times, and I've read through many threads, but I have never seen a definitive answer or anything approaching an official response from Apple. I upgraded my Macbook Pro from 10.6.8 to 10.9 several weeks after it was rel

  • Connect by - generate list with interval

    Hi all, I'm in process of migrating some package from SQL Server 2005 to Oracle 11g. Please help me to recreate list generation. Here is my SQL Server code: with rows as (SELECT 1 AS rowid, 1 AS rowbeg, 6 AS rowend union all select rowid+1, rowbeg+6,

  • Help on loading by schedule infoPackage

    Hi all take a look at the picture first. http://img2.freeimagehosting.net/image.php?2b2cadc249.jpg I wanna load data to ODS "Assignment of Role to Project Element" When I schedule 5 infopackage immediately, they're all yellow. and the details have be