Problem with nested select in procedure and order by

Hi,
I have this procedure:
CREATE OR REPLACE PROCEDURE Mkt_Flussi_Giornalieri2
( idGruppo IN VARCHAR2
, dataInizio IN DATE
, dataFine IN DATE
, startRow IN NUMBER
, endRow IN NUMBER
, column_order in varchar2
--, order_name in varchar2
, recordsetCursor OUT SYS_REFCURSOR
, countRow OUT NUMBER
) IS
order_clause varchar2(200) := ' ';
sql_stm varchar2(32000);
BEGIN
IF column_order IS NOT NULL
THEN
order_clause := column_order;
ELSE
order_clause := ' stato DESC ';
END IF;
dbms_output.put_line('clausola:'||order_clause);
sql_stm:='
     SELECT idflusso, descrizioneFlusso, dataRiferimento, strDataRiferimento,
        stato,  dataElaborazione, ultimoMessaggio, livello, utentiRiferimento,
        exec_seq, provider_description, log_info FROM
  (SELECT idflusso, descrizioneFlusso, dataRiferimento, strDataRiferimento,
        stato,  dataElaborazione, ultimoMessaggio, livello, utentiRiferimento,
        exec_seq, provider_description, log_info FROM
  (SELECT
temp.flow_id AS idFlusso,
MKT_FLOW.flow_id || '' - '' || MKT_FLOW.flow_description || ''('' || temp.exec_seq || '')'' AS descrizioneFlusso,
TO_DATE(temp.date_id,''yyyymmddhh24miss'') AS dataRiferimento,
TO_CHAR(TO_DATE(temp.date_id,''yyyymmddhh24miss''),''dd/mm/yyyy'')||'' h. ''||TO_CHAR(TO_DATE(temp.date_id,''yyyymmddhh24miss''),''hh24:mi'') AS strDataRiferimento,
temp.status AS stato, temp.end_time AS dataElaborazione, DECODE(temp.status,3, ERROR_DESC, 1, TRACE_DES) AS ultimoMessaggio,
DECODE(temp.status,3, error_level, 1, fk_trace_level) AS livello,
Get_Group_Description(MKT_FLOW.flow_id) AS utentiRiferimento, temp.exec_seq AS exec_seq, mp.provider_description,
                         mp.provider_link, mfc.log_info
FROM (
  SELECT v.*, tr.TRACE_ID, tr.TRACE_DES , tr.trace_date, tr.fk_trace_level, e.ERROR_ID, e.ERROR_CODE, NVL(e.ERROR_DESC, er.ERROR_DESC) AS ERROR_DESC, e.error_date, e.error_level,
  MIN(e.error_id) OVER (PARTITION BY e.fk_exec_seq) eid,
  MAX(tr.trace_id) OVER (PARTITION BY tr.fk_exec_seq) tid
  FROM (
    SELECT fc.*, MAX(exec_seq) OVER (PARTITION BY flow_id, flow_frequency, n_run, date_id) exsq
    FROM mkt_flow_conf_view fc
    WHERE TRUNC(end_time) >= :1
      AND TRUNC(end_time) <= :2
  ) v, MKT_ERROR er, MKT_FLOW_ERROR e, MKT_FLOW_TRC tr
  WHERE v.exec_seq        = v.exsq
    AND e.fk_exec_seq (+) = v.exec_seq
    AND tr.fk_exec_seq (+) = v.exec_seq
    AND er.error_id (+) = e.error_code
) temp
INNER JOIN MKT_FLOW
ON MKT_FLOW.flow_id = temp.flow_id AND MKT_FLOW.n_run = temp.n_run AND MKT_FLOW.flow_frequency = temp.flow_frequency
INNER JOIN MKT_FLOW_GROUP ON MKT_FLOW_GROUP.flow_id = MKT_FLOW.flow_id
LEFT OUTER JOIN
                         (SELECT DISTINCT flow_id, log_info
                                     FROM mkt_flow_conf) mfc
                         ON mkt_flow.flow_id = mfc.flow_id
                         , mkt_provider mp
WHERE NVL(error_id, -1) = NVL(eid, -1)
  AND NVL(trace_id, -1) = NVL(tid, -1)
  AND MKT_FLOW_GROUP.group_id=:3
  AND NVL (mkt_flow.fk_provider_id, '' '') =
                                                     NVL (mp.provider_id, '' '') )
  WHERE ROWNUM <= :4
  MINUS
  (SELECT idflusso, descrizioneFlusso, dataRiferimento, strDataRiferimento,
        stato,  dataElaborazione, ultimoMessaggio, livello, utentiRiferimento,
        exec_seq, provider_description, log_info FROM
  (SELECT
temp.flow_id AS idFlusso,
MKT_FLOW.flow_id || '' - '' || MKT_FLOW.flow_description || ''('' || temp.exec_seq || '')'' AS descrizioneFlusso,
TO_DATE(temp.date_id,''yyyymmddhh24miss'') AS dataRiferimento,
TO_CHAR(TO_DATE(temp.date_id,''yyyymmddhh24miss''),''dd/mm/yyyy'')||'' h. ''||TO_CHAR(TO_DATE(temp.date_id,''yyyymmddhh24miss''),''hh24:mi'') AS strDataRiferimento,
temp.status AS stato, temp.end_time AS dataElaborazione, DECODE(temp.status,3, ERROR_DESC, 1, TRACE_DES) AS ultimoMessaggio,
DECODE(temp.status,3, error_level, 1, fk_trace_level) AS livello,
Get_Group_Description(MKT_FLOW.flow_id) AS utentiRiferimento, temp.exec_seq AS exec_seq, mp.provider_description,
                         mp.provider_link, mfc.log_info
FROM (
  SELECT v.*, tr.TRACE_ID, tr.TRACE_DES , tr.trace_date, tr.fk_trace_level, e.ERROR_ID, e.ERROR_CODE, NVL(e.ERROR_DESC, er.ERROR_DESC) AS ERROR_DESC, e.error_date, e.error_level,
  MIN(e.error_id) OVER (PARTITION BY e.fk_exec_seq) eid,
  MAX(tr.trace_id) OVER (PARTITION BY tr.fk_exec_seq) tid
  FROM (
    SELECT fc.*, MAX(exec_seq) OVER (PARTITION BY flow_id, flow_frequency, n_run, date_id) exsq
    FROM mkt_flow_conf_view fc
    WHERE TRUNC(end_time) >= :5
      AND TRUNC(end_time) <= :6
  ) v, MKT_ERROR er, MKT_FLOW_ERROR e, MKT_FLOW_TRC tr
  WHERE v.exec_seq        = v.exsq
    AND e.fk_exec_seq (+) = v.exec_seq
    AND tr.fk_exec_seq (+) = v.exec_seq
    AND er.error_id (+) = e.error_code
) temp
INNER JOIN MKT_FLOW
ON MKT_FLOW.flow_id = temp.flow_id AND MKT_FLOW.n_run = temp.n_run AND MKT_FLOW.flow_frequency = temp.flow_frequency
INNER JOIN MKT_FLOW_GROUP ON MKT_FLOW_GROUP.flow_id = MKT_FLOW.flow_id
LEFT OUTER JOIN
                         (SELECT DISTINCT flow_id, log_info
                                     FROM mkt_flow_conf) mfc
                         ON mkt_flow.flow_id = mfc.flow_id
                         , mkt_provider mp
WHERE NVL(error_id, -1) = NVL(eid, -1)
  AND NVL(trace_id, -1) = NVL(tid, -1)
  AND MKT_FLOW_GROUP.group_id=:7
  AND NVL (mkt_flow.fk_provider_id, '' '') =
                                                     NVL (mp.provider_id, '' '') )
  WHERE ROWNUM <= :8
  )  ) ORDER BY :9 ' ;
dbms_output.enable(30000);
dbms_output.put_line(sql_stm);
OPEN recordsetCursor FOR sql_stm USING dataInizio, dataFine, idGruppo, endRow, dataInizio, dataFine, idGruppo, startRow, order_clause;
   SELECT COUNT(*) INTO countRow FROM
  (SELECT
temp.flow_id AS idFlusso,
MKT_FLOW.flow_id || ' - ' || MKT_FLOW.flow_description || '(' || temp.exec_seq || ')' AS descrizioneFlusso,
TO_DATE(temp.date_id,'yyyymmddhh24miss') AS dataRiferimento,
TO_CHAR(TO_DATE(temp.date_id,'yyyymmddhh24miss'),'dd/mm/yyyy')||' h. '||TO_CHAR(TO_DATE(temp.date_id,'yyyymmddhh24miss'),'hh24:mi') AS strDataRiferimento,
temp.status AS stato, temp.end_time AS dataElaborazione, DECODE(temp.status,3, ERROR_DESC, 1, TRACE_DES) AS ultimoMessaggio,
DECODE(temp.status,3, error_level, 1, fk_trace_level) AS livello,
Get_Group_Description(MKT_FLOW.flow_id) AS utentiRiferimento, temp.exec_seq AS exec_seq, mp.provider_description,
                         mp.provider_link, mfc.log_info
FROM (
  SELECT v.*, tr.TRACE_ID, tr.TRACE_DES , tr.trace_date, tr.fk_trace_level, e.ERROR_ID, e.ERROR_CODE, NVL(e.ERROR_DESC, er.ERROR_DESC) AS ERROR_DESC, e.error_date, e.error_level,
  MIN(e.error_id) OVER (PARTITION BY e.fk_exec_seq) eid,
  MAX(tr.trace_id) OVER (PARTITION BY tr.fk_exec_seq) tid
  FROM (
    SELECT fc.*, MAX(exec_seq) OVER (PARTITION BY flow_id, flow_frequency, n_run, date_id) exsq
    FROM mkt_flow_conf_view fc
    WHERE TRUNC(end_time) >= dataInizio
      AND TRUNC(end_time) <= dataFine
  ) v, MKT_ERROR er, MKT_FLOW_ERROR e, MKT_FLOW_TRC tr
  WHERE v.exec_seq        = v.exsq
    AND e.fk_exec_seq (+) = v.exec_seq
    AND tr.fk_exec_seq (+) = v.exec_seq
    AND er.error_id (+) = e.error_code
) temp
INNER JOIN MKT_FLOW
ON MKT_FLOW.flow_id = temp.flow_id AND MKT_FLOW.n_run = temp.n_run AND MKT_FLOW.flow_frequency = temp.flow_frequency
INNER JOIN MKT_FLOW_GROUP ON MKT_FLOW_GROUP.flow_id = MKT_FLOW.flow_id
LEFT OUTER JOIN
                         (SELECT DISTINCT flow_id, log_info
                                     FROM mkt_flow_conf) mfc
                         ON mkt_flow.flow_id = mfc.flow_id
                         , mkt_provider mp
WHERE NVL(error_id, -1) = NVL(eid, -1)
  AND NVL(trace_id, -1) = NVL(tid, -1)
  AND MKT_FLOW_GROUP.group_id=idGruppo
  AND NVL (mkt_flow.fk_provider_id, ' ') =
                                                     NVL (mp.provider_id, ' '));
END Mkt_Flussi_Giornalieri2;
/When I call the procedure, from java, I receive this error:
>
Caused by: java.sql.SQLException: invalid column index
     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
     at oracle.jdbc.driver.OracleResultSetImpl.getString(OracleResultSetImpl.java:385)
     at it.edison.markettracker.dao.spring.VistaFlussiGiornalieriDaoImpl.mapRow(VistaFlussiGiornalieriDaoImpl.java:155)
     at it.edison.markettracker.dao.spring.VistaFlussiGiornalieriDaoImpl.mapRow(VistaFlussiGiornalieriDaoImpl.java:1)
     at org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(RowMapperResultSetExtractor.java:92)
     at org.springframework.jdbc.core.JdbcTemplate.processResultSet(JdbcTemplate.java:1124)
     at org.springframework.jdbc.core.JdbcTemplate.extractOutputParameters(JdbcTemplate.java:1085)
     at org.springframework.jdbc.core.JdbcTemplate$5.doInCallableStatement(JdbcTemplate.java:997)
     at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:936)
     ... 26 more
When I call the procedure from toad in this way:
SET serveroutput ON
DECLARE
TROVATI SYS_REFCURSOR;
NUMERO_TROVATI NUMBER;
BEGIN
      DBMS_OUTPUT.ENABLE(30000);
      dbms_output.put_line('INIZIO');
      Mkt_Flussi_Giornalieri2(1, trunc(sysdate), trunc(sysdate), 100, 50, null, TROVATI, NUMERO_TROVATI);
      dbms_output.put_line('RECORD TROVATI:'||NUMERO_TROVATI);
END; I don't receive any error messages but I don't see any message.
Why this behaviour? I work on this procedure from the last monday. Please help me. I need to call the procedure from java.
Thanks, bye bye.
Edited by: Abdujaparov on Mar 5, 2009 3:44 PM

Hi,
I have solved the problem, I forgot a parameter in the select, so java tells the an error. But now I have another problem. The procedure doesn't execute the order by. I pass the couple column_name order_type in a string as ("provider_description desc") dinamically but the procedure doesn't execute the ordering. Why?
The problem is in the dynamic query, I think:
sql_stm:='
     SELECT idflusso, descrizioneFlusso, dataRiferimento, strDataRiferimento,
        stato,  dataElaborazione, ultimoMessaggio, livello, utentiRiferimento,
        exec_seq, provider_description, provider_link, log_info FROM
  (SELECT idflusso, descrizioneFlusso, dataRiferimento, strDataRiferimento,
        stato,  dataElaborazione, ultimoMessaggio, livello, utentiRiferimento,
        exec_seq, provider_description, provider_link, log_info FROM
  (SELECT
temp.flow_id AS idFlusso,
MKT_FLOW.flow_id || '' - '' || MKT_FLOW.flow_description || ''('' || temp.exec_seq || '')'' AS descrizioneFlusso,
TO_DATE(temp.date_id,''yyyymmddhh24miss'') AS dataRiferimento,
TO_CHAR(TO_DATE(temp.date_id,''yyyymmddhh24miss''),''dd/mm/yyyy'')||'' h. ''||TO_CHAR(TO_DATE(temp.date_id,''yyyymmddhh24miss''),''hh24:mi'') AS strDataRiferimento,
temp.status AS stato, temp.end_time AS dataElaborazione, DECODE(temp.status,3, ERROR_DESC, 1, TRACE_DES) AS ultimoMessaggio,
DECODE(temp.status,3, error_level, 1, fk_trace_level) AS livello,
Get_Group_Description(MKT_FLOW.flow_id) AS utentiRiferimento, temp.exec_seq AS exec_seq, mp.provider_description,
                         mp.provider_link, mfc.log_info
FROM (
  SELECT v.*, tr.TRACE_ID, tr.TRACE_DES , tr.trace_date, tr.fk_trace_level, e.ERROR_ID, e.ERROR_CODE, NVL(e.ERROR_DESC, er.ERROR_DESC) AS ERROR_DESC, e.error_date, e.error_level,
  MIN(e.error_id) OVER (PARTITION BY e.fk_exec_seq) eid,
  MAX(tr.trace_id) OVER (PARTITION BY tr.fk_exec_seq) tid
  FROM (
    SELECT fc.*, MAX(exec_seq) OVER (PARTITION BY flow_id, flow_frequency, n_run, date_id) exsq
    FROM mkt_flow_conf_view fc
    WHERE TRUNC(end_time) >= :1
      AND TRUNC(end_time) <= :2
  ) v, MKT_ERROR er, MKT_FLOW_ERROR e, MKT_FLOW_TRC tr
  WHERE v.exec_seq        = v.exsq
    AND e.fk_exec_seq (+) = v.exec_seq
    AND tr.fk_exec_seq (+) = v.exec_seq
    AND er.error_id (+) = e.error_code
) temp
INNER JOIN MKT_FLOW
ON MKT_FLOW.flow_id = temp.flow_id AND MKT_FLOW.n_run = temp.n_run AND MKT_FLOW.flow_frequency = temp.flow_frequency
INNER JOIN MKT_FLOW_GROUP ON MKT_FLOW_GROUP.flow_id = MKT_FLOW.flow_id
LEFT OUTER JOIN
                         (SELECT DISTINCT flow_id, log_info
                                     FROM mkt_flow_conf) mfc
                         ON mkt_flow.flow_id = mfc.flow_id
                         , mkt_provider mp
WHERE NVL(error_id, -1) = NVL(eid, -1)
  AND NVL(trace_id, -1) = NVL(tid, -1)
  AND MKT_FLOW_GROUP.group_id=:3
  AND NVL (mkt_flow.fk_provider_id, '' '') =
                                                     NVL (mp.provider_id, '' '') )
  WHERE ROWNUM <= :4
  MINUS
  (SELECT idflusso, descrizioneFlusso, dataRiferimento, strDataRiferimento,
        stato,  dataElaborazione, ultimoMessaggio, livello, utentiRiferimento,
        exec_seq, provider_description, provider_link, log_info FROM
  (SELECT
temp.flow_id AS idFlusso,
MKT_FLOW.flow_id || '' - '' || MKT_FLOW.flow_description || ''('' || temp.exec_seq || '')'' AS descrizioneFlusso,
TO_DATE(temp.date_id,''yyyymmddhh24miss'') AS dataRiferimento,
TO_CHAR(TO_DATE(temp.date_id,''yyyymmddhh24miss''),''dd/mm/yyyy'')||'' h. ''||TO_CHAR(TO_DATE(temp.date_id,''yyyymmddhh24miss''),''hh24:mi'') AS strDataRiferimento,
temp.status AS stato, temp.end_time AS dataElaborazione, DECODE(temp.status,3, ERROR_DESC, 1, TRACE_DES) AS ultimoMessaggio,
DECODE(temp.status,3, error_level, 1, fk_trace_level) AS livello,
Get_Group_Description(MKT_FLOW.flow_id) AS utentiRiferimento, temp.exec_seq AS exec_seq, mp.provider_description,
                         mp.provider_link, mfc.log_info
FROM (
  SELECT v.*, tr.TRACE_ID, tr.TRACE_DES , tr.trace_date, tr.fk_trace_level, e.ERROR_ID, e.ERROR_CODE, NVL(e.ERROR_DESC, er.ERROR_DESC) AS ERROR_DESC, e.error_date, e.error_level,
  MIN(e.error_id) OVER (PARTITION BY e.fk_exec_seq) eid,
  MAX(tr.trace_id) OVER (PARTITION BY tr.fk_exec_seq) tid
  FROM (
    SELECT fc.*, MAX(exec_seq) OVER (PARTITION BY flow_id, flow_frequency, n_run, date_id) exsq
    FROM mkt_flow_conf_view fc
    WHERE TRUNC(end_time) >= :5
      AND TRUNC(end_time) <= :6
  ) v, MKT_ERROR er, MKT_FLOW_ERROR e, MKT_FLOW_TRC tr
  WHERE v.exec_seq        = v.exsq
    AND e.fk_exec_seq (+) = v.exec_seq
    AND tr.fk_exec_seq (+) = v.exec_seq
    AND er.error_id (+) = e.error_code
) temp
INNER JOIN MKT_FLOW
ON MKT_FLOW.flow_id = temp.flow_id AND MKT_FLOW.n_run = temp.n_run AND MKT_FLOW.flow_frequency = temp.flow_frequency
INNER JOIN MKT_FLOW_GROUP ON MKT_FLOW_GROUP.flow_id = MKT_FLOW.flow_id
LEFT OUTER JOIN
                         (SELECT DISTINCT flow_id, log_info
                                     FROM mkt_flow_conf) mfc
                         ON mkt_flow.flow_id = mfc.flow_id
                         , mkt_provider mp
WHERE NVL(error_id, -1) = NVL(eid, -1)
  AND NVL(trace_id, -1) = NVL(tid, -1)
  AND MKT_FLOW_GROUP.group_id=:7
  AND NVL (mkt_flow.fk_provider_id, '' '') =
                                                     NVL (mp.provider_id, '' '') )
  WHERE ROWNUM <= :8
  )  ) ORDER BY :9' ;
OPEN recordsetCursor FOR sql_stm USING dataInizio, dataFine, idGruppo, endRow, dataInizio, dataFine, idGruppo, startRow, order_clause;Where order_clause is defined so:
IF column_order IS NOT NULL
THEN
order_clause := column_order;
ELSE
order_clause := ' stato DESC ';
END IF;If I insert manually a name of a column and a type of ordering (asc or desc) the ordering is executed correctly. How can I solve this issue?
Thanks, bye bye.

Similar Messages

  • Problem with Pie chart, Store Procedure and Category Axis

    Hi All,
    I'm having a problem when i try to use a Pie Chart with a store procedure
    when Category Axis - Field value is "none", the chart appears, but the description say Undefined
    but when i put any field from store procedure, the chart doesn't show.
    when I try the same with a normal SQL statement, all data was displayed
    my store procedure only have 2 columns
    n - numeric
    state - text
    The Store Procedure and the SQL, returns the same data in the same order
    Thanks in advance
    Cristian

    Hi guys,
    I need guide on creating a system using store procedure, referring to this thread: JDBC System Connection VS BI JDBC System Connection
    Hope you can help me out.
    Thanks a lot,
    Sarah

  • Performance Problem with Nested Select

    I have an urgent performance question, I run a nested select like this one
      SELECT tabname
               INTO ls_dd02l
               FROM dd02l
               WHERE tabname LIKE c_feld
               AND   buffered IS NOT NULL.
          SELECT tabname fieldname keyflag position
                 INTO CORRESPONDING FIELDS OF ls_dd03l
                 FROM dd03l
                 WHERE tabname   = ls_dd02l-tabname
                 AND   fieldname IN ('MANDT', 'CLIENT', 'CLNT')
                 AND   keyflag   = 'X'.
            IF ( sy-subrc EQ 0 ).
              wa-tabname   = ls_dd03l-tabname.
              wa-fieldname = ls_dd03l-fieldname.
              wa-keyflag   = ls_dd03l-keyflag.
              wa-position  = ls_dd03l-position.
              APPEND wa TO itab.
            ENDIF.
          ENDSELECT.
        ENDSELECT.
    It is taking about 20sec, which is much too long.
    How can I improve the performance.
    Points rewarded!
    S.B.

    Hi Siegfried,
    As Vinay said  u can use INNER JOIN to get the data from both database tables
    or u can use FOR ALL ENTRIES statement.
    You can use the option FOR ALL ENTRIES to replace nested select loops by operations on internal tables. This can significantly improve the performance for large sets of selected data.
    The above statement is from Library. Please check this link
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3a1f358411d1829f0000e829fbfe/content.htm
    Tabular Conditions sub heading
    SELECT a~tabname
           b~fieldname
           b~keyflag
           b~position
        FROM dd02l as a INNER JOIN dd03l as b
          ON a~tabname = b~tabname
         INTO TABLE itab
       WHERE a~tabname LIKE c_feld
         AND buffered IS NOT NULL
         AND fieldname IN ('MANDT', 'CLIENT', 'CLNT')
         AND keyflag   = 'X'.
    OR
    SELECT tabname
           INTO TABLE lt_dd02l
           FROM dd02l
           WHERE tabname LIKE c_feld
           AND   buffered IS NOT NULL.
    IF NOT lt_dd02l IS INITIAL.
          SELECT tabname fieldname keyflag position
                 INTO CORRESPONDING FIELDS OF TABLE itab
                 FROM dd03l
                 FOR ALL ENTRIES IN lt_dd02l
                 WHERE tabname   = lt_dd02l-tabname
                 AND   fieldname IN ('MANDT', 'CLIENT', 'CLNT')
                 AND   keyflag   = 'X'.
    ENDIF.
    Please check this link
    /people/rob.burbank/blog/2007/03/19/joins-vs-for-all-entries--which-performs-better
    You have to look at the primary keys..
    MANDT
    STLTY
    STLNR
    STLAL
    STLKN
    STASZ
    MANDT
    STLTY
    STLNR
    STLKN
    STPOZ
    You need the stlty for both tables stas and stpo
    The on condition between stas and stpo is obvious, will help a
    bit.
    It would be much better, if you could add it to the WHERE Condition.
    Do you know it?
    If not, then as the BOM categories are not so many,
    Try
    select distinct stlty
    from stas.
    and add the values to you where condition as
    AND s1-stlty in ( ....... )
    This should improve the performance.
    I don't kknow whether the BOM Categories can change in future.
    instead of a fixed in, you could add a subselect from a customizing table.
    I am quite confident that the solution I proposed will be much faster than the FOR ALL ENTRIES.
    But with more complicated joins you really have to try it.
    There is no general rule about the number of tables in a join, there are perfectly running joins with 5 tables
    and there are porblems with 2 tables.
    You must analyze the indexes, it it is clear which index will support the accesses then it will work fine.
    The FOR ALL ENTRIES is by construction much slower!
    Best regards,
    raam

  • Validation problem with the selected Month-Year and Days in the Month.

    Hi,
    I am unable to figure out the logic for the below senario.
    There are two fields Period and Date
    If Users sets the Period to FEB-11
    and User has to select the Dates of the February Month only and if he selects any other month It should throw an error.
    How could I restrict the user to not enter any other date from the selected period.
    Please suggest.
    Thanks,
    Krishna

    Hi Gyan,
    Thanks for the update.
    I am just tring to copare the values
    able to get the period value and unable to compare to the date format.
    just look at the below code with the output of sop
            OAMessageTextInputBean mtb =
            (OAMessageTextInputBean)webBean.findIndexedChildRecursive("item1");
                OAMessageDateFieldBean mtb1 =
                (OAMessageDateFieldBean)webBean.findIndexedChildRecursive("item2");
            String period = (String)mtb.getValue(pageContext);
            System.out.println("Value of Period:::"+period);   // FEB-11 is the out put
               Date date = (Date)mtb1.getValue(pageContext);
                System.out.println("Value of Period:::"+date); // 2011-02-09 is the output
    // Converting the date to string using SimpleDateFormat
                DateFormat df = new SimpleDateFormat("dd-MM-yyyy");
                String date1 = df.format(date);
                System.out.println("String Date::"+date1);
                String date2 = date1.substring(3,5);
                System.out.println("SubString::"+date2);
           // 02 is the out put I am not able to Format the month in SimpleDateFormat("dd-MON-yyyy") to get the
          //  month as FEB is there any converter.
                String date3 = date1.substring(8,10);
                System.out.println("SubString2::"+date3);
         //11 is the out put
            if (period.equalsIgnoreCase(date2.concat(date3)) )
      // after concatinating the format is 02-11 so its going to exception
                System.out.println("Date in the same Period");
            else {
                throw new OAException ("Date Selected is out of range::");
            }I am not able to Format the month in SimpleDateFormat("dd-MON-yyyy") to get the month as FEB is there any converter.
    The logic is working fine but the month is not getting converted.
    Thanks,
    Krishna

  • Problems with partial selection in preview and other skim...

    I scan student work that is handwritten. I use preview to select a portion of that work and then I paste the portion of the image I have selected into pages or some other application. Since upgrading to Snow Leopard when I partially select an area in preview everything appears normal. But when I paste into another app it pastes the entire image, not the portion I have selected. I could really use your help on this...

    remaltzman wrote:
    I scan student work that is handwritten. I use preview to select a portion of that work and then I paste the portion of the image I have selected into pages or some other application. Since upgrading to Snow Leopard when I partially select an area in preview everything appears normal. But when I paste into another app it pastes the entire image, not the portion I have selected.
    I don't know if this is related to your problem, but you might find this TidBITs discussion thread useful:
    http://emperor.tidbits.com/TidBITS/Talk/2819

  • Problem with using both group by and order by

    example:
    SQL> select * from orgchart;
    NAME TEAM SALARY SICKLEAVE ANNUALLEAVE
    ADAMS RESEARCH 34000 34 12
    WILKES MARKETING 31000 40 9
    STOKES MARKETING 36000 20 19
    MEZA COLLECTIONS 40000 30 27
    MERRICK RESEARCH 45000 20 17
    RICHARDSON MARKETING 42000 25 18
    FURY COLLECTIONS 35000 22 14
    PERCOURT PR 37500 24 24
    SQL> select team,
    2 avg(salary),avg(sickleave),avg(annualleave)
    3 from orgchart
    4 group by team
    5 order by name;
    order by name
    ERROR at line 5:
    ORA-00979: not a GROUP BY expression
    who can tell me where is wrong?
    Thanks
    Leo

    Hi,
    These are basic things...
    what ever the Columns you are including the Select Clause must
    taken into consideration when applying the group by clause..
    without the selection in of name column how can you use in Order by Clause..
    while using the group by..
    Thanks
    Pavan Kumar N

  • Update statement with nested selects and alias usage

    Hello, we are trying to build an update statement like this...
    update table1 t1
    set attr1 = ( select someattr
    from (nested select 1) as aux1
    (nested select 2 (nested select 2.1 + nested select 2.2)) ) as aux2
    where some_join_clauses
    where t1.attr2 = 123
    and t1.attr3 = 'abc'
    Alias t1 shound be known at the level of nested select 1,2 and 2.1, 2.2? We are receiving an error message saying that t1.someattr is an invalid identifier. Can you help? Thanks!

    mauramos wrote:
    Hello, we are trying to build an update statement like this...
    update table1 t1
    set attr1 = ( select someattr
    from (nested select 1) as aux1
    (nested select 2 (nested select 2.1 + nested select 2.2)) ) as aux2
    where some_join_clauses
    where t1.attr2 = 123
    and t1.attr3 = 'abc'
    Alias t1 shound be known at the level of nested select 1,2 and 2.1, 2.2? We are receiving an error message saying that t1.someattr is an invalid identifier. Can you help? Thanks!You can only reference elements nested 1 level deeper in a correlated update statement.
    I'd suggest you try with the MERGE statement, or alternatively, post some sample data (insert statements) and table DDL (create statements), with an 'expected output' description and we can try to help you build a suitable statement.

  • I'm using mac with the newest operating system (snow leopard 10.6.7). since I've updated to Firefox 4 It doesn't display Hebrew fonts- I didn't have any problems with it before the upgrade and in safari I don't have this problem.

    Hello, I'm using Mac with the newest operating system (snow leopard 10.6.7). since I've updated to Firefox 4 It doesn't display Hebrew fonts… I didn't have any problems with it before the upgrade and in safari I have no problem with it. please help me- I don't like to use safari a my browser...

    elly903 wrote:
    Before commenting - I CANNOT install Mavericks because it'll mess up the versions of Filemaker Pro and Quicken that I use regularly...
    Quicken 2007 for Intel (Snow Leopard, Lion, Mt. Lion and Mavericks) for $15:
    http://quicken.intuit.com/personal-finance-software/quicken-2007-osx-lion.jsp
    It will input your Quicken PPC data file directly if it was Quicken 2005 through 2007.  If older you need Quicken 2006 or 2007 PPC first to convert your data file; and this update must be done BEFORE you upgrade to Mavericks:
    http://quicken.intuit.com/support/help/patching/quicken-2006-manual-updates--mac -/GEN82200.html
    Filemaker Pro PPC (in this case 7) running in Snow Leopard Server installed into Parallels for use in Lion, Mt. Lion and Mavericks:
                                  [click on image to enlarge]
    Snow Leopard Server: 1.800.MYAPPLE (1.800.692.7753) - Apple Part Number: MC588Z/A (telephone orders only)
    This solution allows you to run your Photoshop Elements in Mavericks concurrently with Filemaker Pro PPC.  Mavericks is a free download.

  • Help me please : Serious problems with collection-mapping, list-mapping and map-mappi

    Hi everybody;
    I have serious problems with list-mapping, collection-mapping and map-mapping.
    Acording to specifications and requirements in a system I am working on it is needed to
    get a "list" of values or an indivudual value.I am working with ORACLE 9i Database,
    ORACLE 9i AS and ORACLE 9i JDEVELOPER.
    I tried to map a master-detail relationship in an entity-bean, using list-mapping.
    And this was very useful in order to get a "list" of details, ...but, when I wanted
    to get a single value I have some problems with persistence, something about "saving a state"
    despite I just want to get the value of a single detail.
    I decided to change it to map-mapping and the problem related with a single detail
    worked successfully, but I can get access to the whole bunch of details.
    May anyone of you help me with that?
    I am very confused I do not know what to do.
    Have any of you a solution for that problem?
    Thank you very much.

    Have you tried a restore in iTunes?

  • HT201210 I m having problems with both my iphone 3gs and 4 when my cellular data is on and my battery is fully charge but out of suddenn it will shut off can i know how can i troubleshoot this issue thanks

    I m having problems with both my iphone 3gs and 4 when my cellular data is on and my battery is fully charge but out of suddenn it will shut off can i know how can i troubleshoot this issue thanks

    simply try doing a back up and restore
    when going thru the activation screen, select SET UP AS NEW and then test your device. if it is not shutting down then it could be 1 or more apps tht have been downloaded wch could be affecting the device
    you will then need to follow the process of eleimnation, meaning add 2 apps and then monitor your phone, if nothing happes then add another couple of them and then check
    good luck !!

  • I have a problem with the sync between iTunes and ipad2. I can not see the files in iPad. Help me please.

    I have a problem with the sync between iTunes and ipad2. I can not see the files in iPad. Help me please.

    Cannot see what files ? Music (synced music should appear in the iPod app), films/TV shows (Videos app), documents ... ?

  • Is anyone having problems with the battery heating up and draining the power?  Mine has been doing this for about 2 months now.

    Is anyone having problems with the battery heating up and draining the power?  Mine has been doing this for about 2 months now.

    This is a major problem with Lollipop, but yo said it started 2 months ago.   Several people have fixed problem by removing FaceBook And Face book messenger and then re loading the apps again.   You might want to clear your cache before reloading.  Not sure this is your problem, but worth a try.  Good Luck

  • Problems with creation of catalogue XPGrpwise and temporary

    Problems with creation of catalogue XPGrpwise and temporary files.
    I use GroupWise 8.01 and WinXP (SP2), OpenOffice 3.1.
    Why at opening files in Library, temporary files are not created in catalogue C:\Documents and Settings\Jon Smith\Local Settings\Temp\XPGrpwise, and created in catalogue C:\Documents and Settings\Jon Smith\My Documents. That causes problems. How to change a situation that worked as it is necessary.
    Catalogue XPGrpWise is created and leaves duly in catalogue C:\Documents and Settings\Jon Smith\Local Settings\Temp\.

    Cvetaev,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Visit http://support.novell.com and search the knowledgebase and/or check all
    the other self support options and support programs available.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://forums.novell.com)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://forums.novell.com/faq.php
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://support.novell.com/forums/

  • HT4009 Do you understand me ? I want money back.Because I have problem with LINE In App Purchase.And no one try to resolve this problem.And the answer of NEVER LINE JAPAN they don't have responsibility.I think it will be effect with APPLE image also.I wan

    Do you understand me ? I want money back.Because I have problem with LINE In App Purchase.And no one try to resolve this problem.And the answer of NEVER LINE JAPAN they don't have responsibility.I think it will be effect with APPLE image also.I want you to help me everyways to refound my monet back.Could you?

    Contact iTunes Store Support.

  • I have problem with Itunes losing where podcasts and some purchased music is located. Don't know how Itunes losing the locations of the files and I can't find the files on my hard drive. What can I do to stop Itunes losing location and restore my files?

    I have problem with Itunes losing where podcasts and some purchased music is located. Don't know how Itunes losing the locations of the files and I can't find the files on my hard drive. What can I do to stop Itunes losing location and restore my files?

    Try assigning Queen as the Album Artist on the compilations in iTunes on your computer.

Maybe you are looking for

  • Insert filename

    Hello, Is it possible to insert a document's filename into the text automatically in pages ? Regards Andreas

  • NEED TO SEND MAIL FROM FORMS...

    DEAR ALL, I NEED TO SEND MAIL FROM FORMS WHEN I PRESS THE MAIL BUTTON. I HAVE NO IDEA FOR THIS CRITERIA. IF ANY ONE EXPERIENCED WITH THIS CRITERIA, PLS HELP ME AND GIVE ME THE CODING FOR THAT. AND ALSO PLS EXPLAIN EACH LINE OF CODING, WHICH U POST. T

  • Cachedrowset acceptchanges()  NOT updating to database

    i wrote this code so that "cachedrowset -- crs" (i got from the "resultset -- rs") can be changed according to the condn specified and the modified cachedrowset will be updated in the oracle database. condn. is when " name=sanjiv" it will change it t

  • Space Between Tables For No Good Reason

    Hey everyone. I sliced up my web design in Photoshop and imported it into DW.  So far, so good.  Everything looks perfect.  Then I inserted a .swf into one of the tables and started to see a little bit of space between my tables.  Since the .swf was

  • Infoset vs Indexed nested loop

    Hello all,    i have an requirement in which i need to fetch data from several tables almost 6-8 tables (eventually to IT). right now i am fetching data using Select stmt using For all entries addition. So my requirement is to combine them into a big