Storage partitioning - query on multiple partitions performance?

Hello

We use Oracle 11.2.0.3 and have a central fact table large with several alternative identifiers that have the index bitmap on them and fks looking at the dimension tables + several measures

(PRODUCT_ID,
CUSTOMER_ID,
DAY_ID,
TRANS_TYPE_ID,
REGION_ID,
QTY.
VALUE)

We have 2 separate sets of queries users seek to run for the most part, those accessing transactions products regradless of the time transactions that happened (that is, not financial queries - approximately 70%,)
queries to determine what happened in a particular week - 20% of the queries.

Table will be about 4 billion lines eventually.

Whereas the addition of additional column to that partition the DATE range and this for us to abandon the old partitions each year - but these data would not be joined to any other table.

Whereas then infra partitioning by hash of the product_id that is the key to override to the product dimension.

Reflections on the performance?

Queries by their nature would have hit several secondary partitions.

Reflections on the performance of the queries of queries that access several sub-sub-sheet music/scores compared to applications running on a single table.

Any other thoughts on partitioning strategy in our situation much apprecaited.

Thank you

>
Hash partitioning gives not the size of partition with these predicates to join because they use the equality operator?
>
Size of the partition occurs at the stage of the analysis. Oracle analyzes the query used and for partitioned tables, trying to determine which partitions are necessary. If filter predicates include information which indicates that one or more specific partitions the Oracle can "prune" other partitions because they are not necessary.

So if 'product_id' is partitioned hash then all rows with the same value will be in the same partition. Then a query like

SELECT * FROM myTable
WHERE PRODUCT_ID = 7

Oracle will know when the query is analyzed which sharing one and one only, is necessary because the value 7 always hash to the same partition and Oracle can chop the literal "7" at the time of the analysis to determine which partition is necessary; so cut the other partitions.

If product_id is used in a join predicate to another table but is not limited to specific values like the example above then Oracle cannot determine at the time exactly what partitions might be necessary because it will depend on the discovery at the time of actual data values.

The information needed to trim must be available at the stage of the analysis. In other words, the query and the metadata for the table (DDL, statistics, etc.) will be used to make decisions of pruning - the actual table data are not a factor because the data are not available at the time of the analysis.

Tags: Database

Similar Questions

  • LUN and storage Partitions

    When you use the IBM DS4700 SAN and if ESX supports only one active path to a logic unit at a time number - if I have a logic of Production and an another LUN of Test unit number, I'd rather create a partion of storage for each, then ask SAN CTRL A - & gt; path preferred on Production LUN SAN CTRL B - & gt; the path preferred to LUN of Test? the attached picture shows how I have two paths each HBA, FC switch and SAN. I would like to optimize traffice as much as possible. Any suggestions?

    Thank you

    Am I right assuming that I would be better for the performance of each logic unit on a separte storage partition number and each controller

    Altogether.

    For each RAID Group (or group of physical disks), only 1 LUN.

    At least 2 LUNS.

    If possible (if you have 4 way and many records) also consider using 4 LUNs.

    Rember that each logic unit number must be<>

    André

    * If you found this device or any other answer useful please consider awarding points for correct or helpful answers

  • Storage VMFS Partition Performance

    I am trying to determine if I'll get best performance of 6-300 Gb 15 K FC disks in a table 6 FC - 300 GB 15 K in a table of RAID5 or RAID10?

    I don't have much time to really sit and Experiment (would like to but time = $$).

    This is the table that will store between 5-9 WIN2k3 VM.

    I like the idea of RAID 10, which allows more than 1 drive fail (as long as it isn't the same mirror) and still survive with times of rapid reconstruction.

    This question has been turned off before, but not with the amount of readers, I want to say

    Any help is appreciated!

    If you have a load of joint task force (most do) then RAID10 will give good performance than RAID5. RAID5 has faster sequential readings as RAID10, but RAID10 is normally the one who gives you the best performance in a VMware environment where multiple virtual machines are access to the same storage.

    Lars

  • Mark partition performance.

    Hi gurus of the Oracle,.

    I had a quick question. I thought that of the 2 techniques will give me better performance.

    (1) a table querying and using partition name in the clause as from

    Select count (*) in the table table_name partition (nom_partition).

    The partition in the business_date for this table.

    (2) a table querying partitioned with a where condition clause (here the column in the where condition is partitioned for the date).

    "SELECT count (*) from table_name, including table_name.business_date ='1-Dec-2009.

    Please let me know if you need any clarification.

    user10696492 wrote:
    Hi gurus of the Oracle,.

    I had a quick question. I thought that of the 2 techniques will give me better performance.

    Well, theoretically by using the name of the partition will be a few milliseconds faster - second method call mechanism of size of static partition of the optimizer while the first directly say which partition to use.

    SY.

  • Is there a hidden recovery storage partition?

    Compaq Presario C304
    Intel T1350 @1. 86 GHz clocked at 1.86 GHz
    DDR2 533 2 GB
    WD Caviar 60 GB
    Windows Edition sp2 family

    1. the C partition is 48,71 GB D GB 7,18 FAT32 and NTFS
    2. the name of D:PRESARIO_RP
    3. There is only a d lock, named RECOVERY

    Is there a hidden partition that stores the recovery?
    What means PR on behalf of the RECOVERY_RP?

    Thank you!

    When you request support, please provide the number full name or product model of the HP computer in question. HP/Compaq made thousands of computer models. Without this information, it can be difficult, even impossible to help you solve your problem.

    The information requested above are at the bottom of your computer or inside the battery compartment. , Please do not include your serial number. Please enter the product/model information in the HP Online Support page for consumers , and/or post it here for our review.

    (1) the C: 48,71 GB NTFS partition is your Windows operating system partition and 7.18 GB FAT32 partition D: is your recovery partition.

    (2) PRESARIO_RP D: is the recovery partition... the "RP" means "recovery Partition".

    (3) the "pad locked" RECOVERY D: folder is a hidden folder / protected with the all files recovery.

    If you have not already done so, please create your personal recovery disk set before you alter or change anything.

     

    If you have any other questions, feel free to ask.

    Please click the White Star of KUDOS to show your appreciation

  • Query Tunning of Sql performance

    Hello

    I have A table with size tables plus 120,000002 million are size 2 million on the Table B and less than 1 million on table C.

    I had created the Partition and parallel degree 4 on the table Created A. table B with parallel degree 2 and created table C with NOPARALLEL.

    My query is using above tables with joins and insertion in table D use INDICATOR / * + APPEND NOLOGGING * /.
    I ran the command explain on the above criteria, the cost is showing 20767.

    More later created the tables A, B and C with NOPARALLEL. Applied the TIP on Table D / * + APPEND NOLOGGING * /.
    and applied als HINT / * + PARALLEL(A, 4) select PARALLEL(B C, 2) on a query that uses to insert in table D.


    My question, which advised on the creation of PARALLEL degree at the level of the table or query:


    (a) create table with parallel (level 4)

    (b) applying HINT / * + PARALLEL (TABLE A, 4) * / at the level of the query

    Kind regards
    Prakash

    957901 wrote:
    Hello

    I have A table with size tables plus 120,000002 million are size 2 million on the Table B and less than 1 million on table C.

    I had created the Partition and parallel degree 4 on the table Created A. table B with parallel degree 2 and created table C with NOPARALLEL.

    My query is using above tables with joins and insertion in table D use INDICATOR / * + APPEND NOLOGGING * /.
    I ran the command explain on the above criteria, the cost is showing 20767.

    The cost is meaningless out of context.

    More later created the tables A, B and C with NOPARALLEL. Applied the TIP on Table D / * + APPEND NOLOGGING * /.
    and applied als HINT / * + PARALLEL(A, 4) select PARALLEL(B C, 2) on a query that uses to insert in table D.

    My question, which advised on the creation of PARALLEL degree at the level of the table or query:

    (a) create table with parallel (level 4)

    (b) applying HINT / * + PARALLEL (TABLE A, 4) * / at the level of the query

    According to what works best for you to reach.

    Which is another way of saying that you have not provided enough information for anyone here to take an informed decision or a suggestion for you.

    {message: id = 9360002}

    For performance issues/tuning queries, read two threads related to this FAQ: {message identifier: = 9360003}

  • Rewrite the query to improve the performance and the optimized below cost.

    Oracle 10g.

    ----------------------

    Query

    UPDATE FACETS_CUSTOM. MMR_DTL

    SET

    CAPITN_PRCS_IND = 2,

    FIL_RUN_DT = Current_fil_run_dt,

    ROW_UPDT_DT = dta_cltn_end_dttm

    WHERE CAPITN_PRCS_IND = 5

    AND HSPC_IND = 'Y '.

    AND EXISTS (SELECT 1

    OF FACETS_STAGE. CRME_FUND_DTL_STG STG_CRME

    WHERE STG_CRME. MBR_CK = MMR_DTL. MBRSHP_CK

    AND MMR_DTL. PMT_MSA_STRT_DT BETWEEN STG_CRME. ERN_FROM_DT AND STG_CRME. ERN_THRU_DT

    AND STG_CRME. FUND_ID IN ('AAB1', '1AA2', '1BA2', 'AAB2', '1AA3', '1BA3', ' 1 B 80 ', ' 1 HAS 80 '))

    AND EXISTS (SELECT 1

    OF FACETS_CUSTOM. FCTS_TMS_MBRID_XWLK XWLK

    WHERE XWLK. MBR_CK = MMR_DTL. MBRSHP_CK

    AND MMR_DTL. PMT_MSA_STRT_DT BETWEEN XWLK. HSPC_EVNT_EFF_DT AND XWLK. HSPC_EVNT_TERM_DT);

    Explain the plan of the query

    -----------------------------------------------

    Hash value of plan: 3109991485

    -------------------------------------------------------------------------------------------------------

    | ID | Operation | Name                  | Lines | Bytes | Cost (% CPU). Time |

    -------------------------------------------------------------------------------------------------------

    |   0 | UPDATE STATEMENT.                       |     1.   148. 12431 (2) | 00:02:30 |

    |   1.  UPDATE                       | MMR_DTL |       |       |            |          |

    |   2.   SEMI NESTED LOOPS.                       |     1.   148. 12431 (2) | 00:02:30 |

    |*  3 |    HASH JOIN RIGHT SEMI |                       |    49.  5488. 12375 (2) | 00:02:29 |

    |   4.     TABLE ACCESS FULL | FCTS_TMS_MBRID_XWLK |  6494 | 64940 |    24 (0) | 00:00:01 |

    |*  5 |     TABLE ACCESS FULL | MMR_DTL |   304K |    29 M | 12347 (2) | 00:02:29 |

    |*  6 |    TABLE ACCESS BY INDEX ROWID | CRME_FUND_DTL_STG |     1.    36.     5 (0) | 00:00:01 |

    |*  7 |     INDEX RANGE SCAN | IE1_CRME_FUND_DTL_STG |     8.       |     1 (0) | 00:00:01 |

    -------------------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    3 - access("XWLK".") MBR_CK "=" MMR_DTL. " ("' MBRSHP_CK")

    filter ("XWLK". "HSPC_EVNT_EFF_DT" < = INTERNAL_FUNCTION ("MMR_DTL". " PMT_MSA_STRT_DT') AND

    'XWLK '. "" HSPC_EVNT_TERM_DT "> = INTERNAL_FUNCTION ("MMR_DTL". "PMT_MSA_STRT_DT")) "

    5 - filter("CAPITN_PRCS_IND"=5 AND "HSPC_IND"='Y')

    6 filter (("STG_CRME". "FUND_ID" = "1 HAS 80 ' OR 'STG_CRME'." " FUND_ID "="1AA2"OR"

    'STG_CRME '. "FUND_ID"= '1AA3' OR 'STG_CRME'. "FUND_ID" = "1 B 80 ' OR 'STG_CRME'. '. "FUND_ID" = "1BA2" OR "

    'STG_CRME '. "FUND_ID"= "1BA3" OR "STG_CRME". "FUND_ID"= "AAB1" OR "STG_CRME". ("FUND_ID"="AAB2") AND

    'STG_CRME '. "" ERN_FROM_DT "< = INTERNAL_FUNCTION ("MMR_DTL". "PMT_MSA_STRT_DT") AND "

    'STG_CRME '. "" ERN_THRU_DT "> = INTERNAL_FUNCTION ("MMR_DTL". "PMT_MSA_STRT_DT")) "

    7 - access("STG_CRME".") MBR_CK "=" MMR_DTL. " ("' MBRSHP_CK")

    I could not optimize this query for best performance and optimized the cost... Can someone guide me on this.

    Thank you

    DS

    You think you're going to lines updates 85K, Oracle think it will update a line.

    At the time where the existence of the first test runs that oracle think already up to 49 lines, which is probably why he uses the loop join nested for the second test. (In your version of Oracle, the subquery introduced existence a very bad assumption (small) on the amount of data will survive).

    It is possible that you will get better performance if you hint Oracle using a hash join for testing the existence - and you might want to think what test will eliminate most of the data and that we can first force.

    Having said that, however, note that MMR_DTL research is a considerable fraction of the cost of the query - and an analysis is an easy thing for Oracle cost properly - if, despite your comments on update a column with a clue to this topic, you will find that the query can be more effective if you use an index. This is more likely to be the case if data ' WHERE CAPITN_PRCS_IND = 5 AND HSPC_IND = 'Y' "is well grouped (perhaps the latest data added to the table).". "  You could then reduce the cost of maintaining this index by creating an index based on a feature that indexes only the lines where the predicate are both true so that the 2 update deletes the index entries and allows the index remain as thin as possible.

    Concerning

    Jonathan Lewis

  • Storage control IO to multiple LUNS on 1 table

    Yesterday I read on I/o control of storage in vSphere, and it seems logical to me. However, what has not been clarified is if/how it works when you multiple LUNS on the same table, and how you set it up in such a scenario.

    In our environment, we have 2 bays EqualLogic (PS100 and PS6000), with the array created as a single group with a little less of 7 TB of space in RAID 10.

    Most of our data is shared between 3 LUNs, 1 store our VDIs, the 2 other storage server VM, set up a single data store with a certain extent. (I'm trying to develop a plan to better distribute our virtual machines for a server) to get rid of the measure and 2) recover unused space (the server of virtual machines are only about 3 TB in size, but because of servers added and retired, takes more space on the San of 3.9 to).

    Thank you

    Each data store gets its own statistics IGCS, so each of them is controlled indepedently.

  • Can't understand why this query returns multiple lines with the same data

    Hi all
    I am a relative novice and self-taught when it comes to SQL. I wrote a query to our reporting tool that returns multiple rows, and I can't understand why. I know that I can use the SELECT DISTINCT option, but it really slows the execution when I do. I'd really rather understand if I can change the code to avoid the multiples. This is the query. I've included a few statements in italics to help explain the break. Any ideas?

    SELECT MATSITE, MATPONUM, FIRSTRECPTDATE
    Of
    Subquery that concludes the first date on which purchase orders have been implemented with ACK State
    (SELECT ACKSTAT. PONUM AS 'ACKPONUM', (MIN (ACKSTAT. CHANGEDATE)) AS 'FIRSTACKDATE '.
    OF PZMAX. POSTATUS ACKSTAT
    WHERE (ACKSTAT. STATE = 'ACK') AND (ACKSTAT.ORGID ='CGSALTUS)
    GROUP OF ACKSTAT. PONUM),
    Subquery that concludes the first reception against a purchase order transaction for purposes of comparison
    (SELECT TRANS. PONUM AS "MATPONUM", TRANS. SITEID AS 'MATSITE', (MIN (TRANS. TRANSDATE)) AS 'FIRSTRECPTDATE '.
    OF PZMAX. MATRECTRANS TRANS
    WHERE (TRANS.ORGID ='CGSALTUS) AND (TRANS. HOUR > =: startDate and TRANS. TRANSDATE < =: endDate)
    TRANS GROUP. SITEID, TRANS. PONUM)
    WHERE
    (ACKPONUM = MATPONUM AND FIRSTRECPTDATE < FIRSTACKDATE) OR (NOT EXISTS (SELECT 1 FROM PZMAX. POSTATUS ACKSTAT2 WHERE (ACKSTAT2. PONUM = MATPONUM) AND (ACKSTAT2. STATE = 'ACK') AND (ACKSTAT2.ORGID ='CGSALTUS)))

    The where the instruction is intended to find when one of two conditions exists. ((1) received happened before the command either in ACK or 2) a reception that's happened, but the purchase order is never in ACK State. It seems that this second condition that creates multiple lines.

    Any thoughts will be appreciated geratly.

    Dave Teece
  • What query is good in Performance?

    Hi all

    I'm trying to find duplicate records, PK-based. I wrote 2 queries. Can someone tell me what is the best in performance & why?

    Query 1
    Select the rowid, * from my_table a
    where ROWID is NOT in)
    Select max (ROWID)
    from my_table b
    where a.COL1 = b.COL1
    and a.COL2 = b.COL2
    and a.COL3 = b.COL3)
    and COL3 = to_char (to_date ('20090404', 'YYYYMMDD'), 'DD-MON-YYYY')


    Query 2
    Select * from my_table where rowid NOT IN (select MAX (ROWID) group by COL1, COL2, COL3 my_table)
    and COL3 = to_char (to_date ('20090404', 'YYYYMMDD'), 'DD-MON-YYYY');

    Thank you
    ACE

    Is COL3 in this example a VARCHAR2? Or a DATE?

    It is useless to take a literal string ('20090404'), that convert a date, and then convert the date to a string in a different format. If COL3 is a DATE, which I guess it is, then that COL3 to be converted to a string (using NLS_DATE_FORMAT of the session, which is subject to change), the forces preventing the use all indexes on COL3. If you take a string, convert it to a date and convert into a string so that you can compare it to something that gets converted from a date to a string. That's a lot of conversion going on, some of them implicit and therefore fragile.

    Especially if performance is a concern, you always want to compare the strings to strings, dates, dates. Comparison of strings to dates is fragile at best.

    Justin

  • ISE Server - query of multiple networks

    Hi guys

    We intend to deploy a Cisco ISE server to handle NAC for 300 users (Windows, WYSE, phones Avaya and HP printers). DHCP is running on the domain controller and the ISE interface Layer 2 visibility of all of the network segment management.

    We received an additional amount for a dedicated/completely separate switch VLAN which provides unlimited Internet access. It would be connected to a third-party router connected to the Internet, allowing connections directly on the internet. Indeed, it is a completely separate network of a single VLAN and Internet access.

    Is it not possible to manage the security of the ports for that VLAN from the ISE Server? If so, the server ISE would need an additional NIC configured in the VIRTUAL Internet LAN subnet?

    Basically, I wonder if a single ISE server can be used to manage 2 totally independent networks. The Internet would not use AD authentication and access would have to grant manually on a case by case basis.

    Thank you very much

    M

    Just to clarify, ISE has NO need to be Layer2-adjacent to clients to work. Only if you use specific profiles of the probes is this useful ever. Has no use when you perform the validation of the mac addresses or 802. 1 x.

    As for your question, yes ISE can manage the addresses of mac validation by the ex. say requiring access to your 'Internet' VLAN and your internal VLANS at the same time. However, it is not made with the 'port security' switch feature, but rather by entering the mac addresses that need access to your server to ISE and using the "group" you put them in ISE, in ads a condition when the permission access to ISE.

  • Query with multiple Tables

    Hello

    I want to run the table several queries. I have 4 tables. Table 1 is to have relatively in table 2, but table 3 & 4 is not related with table 1. wherever I want to extract the data from table 1, table 4. My current query works well but it miss the Chronogram of table 1, which records do not exist in table 2, where, from table 2 of table 4 its working fine.

    SELECT z.productcode, fabqty z.productionadviceno, sum (z.fabricatedqty).

    Fabqtynoms Round (Sum(z.fabricatedqty*.015) + Sum (z.fabricatedqty)),

    w.workorderno, ons min (w.ons).

    ((SOMME (w.qtyinsheets) * min (ons))) PCS,

    (SELECT SUM (NVL (mrnqty, 0)))

    OF CANMRN

    WHERE workorderno = w.workorderno) mrnqty;

    (SELECT ROUND (SUM (NVL (ptnqty, 0))))

    OF CANPTN

    WHERE workorderno = w.workorderno

    ) ptnqty

    OF CANWORKORDER w, productionadvice z

    where w.productionadviceno = z.productionadviceno

    and w.productcode = 501001

    GROUP BY w.workorderno, z.productionadviceno, z.productcode

    PRODUCTCODE PRODUCTIONADVICENO FABQTY FABQTYNOMS WORKORDERNO ONS SCP MRNQTY PTNQTY

    ----------- ------------------ --------- ---------- ----------- --------- --------- --------- ------

    501001 20004182 250000 253750 20001805 15 253755 16917 253755

    501001 20004229 200000 203000 20001817 15 202995 13533 202995

    501001 20004251 130000 131950 20001829 15 131955 8797 131955

    501001 20004256 200000 203000 20001839 15 202995 13533 202995

    501001 20004277 500000 507500 20001844 15 507495 33833 507495

    501001 20004411 500000 507500 20001918 15 507495 31619 474285

    501001 20004904 230000 233450 20002150 15 233445

    I want to get this record also is missing after you run the query, as I had mentioned w.productionadviceno = z.productionadviceno due to which its does not, how, in a delicate way, we can use this relationship.

    501001 20004905 10000 10150

    Sandy

    use of EXTERNAL JOINS as follows

    where w.productionadviceno = z.productionadviceno (+)
    

    above is a left outer join. A LEFT OUTER JOIN is a JOIN operations that allow you to specify a join clause. He keeps the lines without correspondence of the first (left) table, join them with a NULL row in the form of the second table (right).

    More details: LEFT OUTER JOIN operation

  • Run the query with multiple parameters

    Dear

    Motion code below for the data is of per_all_people_f, who works for only one setting, when I pass 2 parameters, then is to take the last of them fail times two, could you pls advice how it both join in where clause.

    ================================================================================

    --------------------------------control file ----------------------------------

    ================================================================================

    ' Public Sub processFormRequest (pageContext OAPageContext, OAWebBean webBean)

    {

    super.processFormRequest (pageContext, webBean);

    Am = (OAApplicationModule) pageContext.getApplicationModule (webBean) OAApplicationModule;

    OAApplicationModule am = pageContext.getRootApplicationModule ();

    String model = pageContext.getParameter ("ALL");

    String pempno = pageContext.getParameter ("paramEmpNo");

    String phiredt = pageContext.getParameter ("paramHireDate");

    System.out.println ("control controller exucution");

    If (pageContext.getParameter ("GetData")! = null)

    {

    System.out.println ("controller exucution");

    Boolean ExecuteQuery = BooleanUtils.getBoolean (false);

    [Serializable] parameters = {pempno, phiredt, model, executeQuery};

    Class [] paramTypes = {String.class, String.class, String.class, Boolean.class};

    am.invokeMethod ("initSummary", parameters, paramTypes);

    OAAdvancedTableBean = table

    (OAAdvancedTableBean) webBean.findChildRecursive ("ResultsTable");

    When a user of handling started looking, we always need to run

    the query, so we move on 'false' to queryData().

    table.queryData (pageContext, false);

    }

    }

    ================================================================================

    -Request module file-

    ================================================================================

    public void initSummary (string model,

    String ParmEmpNum,

    String ParmHireDt,

    String created,

    String showMyOrders,

    Boolean ExecuteQuery)

    {

    xxEmployeeVOImpl vo = getxxEmployeeVO1();

    If (vo is nothing)

    {

    Tokens [] MessageToken = {new MessageToken ("parameter", "xxEmployeeVO")};

    throw new OAException ("AK", "FWK_TBX_OBJECT_NOT_FOUND", chips);

    }

    vo.initQuery (model, ParmEmpNum, ParmHireDt, executeQuery);

    System.out.println ("calling vo...");

    }

    ================================================================================

    -xxEmployeeVOImpl-

    ================================================================================

    public void initQuery (String, String ParamEmpNum, String ParmHireDt, Boolean executeQuery model)

    {

    StringBuffer whereClause = new StringBuffer (100);

    Whole CheckWhere;

    Vector of parameters = new Vector (3);

    setWhereClause (null);

    setWhereClauseParams (null);

    Integer bindCount = 0;

    String WhereClause = null;

    If ((ParamEmpNum! = null) & & (!("".)) Equals (ParamEmpNum.Trim ()))

    {

    setWhereClause (null);

    setWhereClauseParams (null);

    setWhereClause ("EMPLOYEE_NUMBER =:" + CheckWhere);

    setWhereClauseParam(0,ParamEmpNum);

    System.out.println ("request" + this.getQuery ());

    System.out.println ("ParamEmpNum" + ParamEmpNum);

    CheckWhere = CheckWhere ++;

    }

    If ((ParmHireDt! = null) & & (!("".)) Equals (ParmHireDt.Trim ()))

    {

    CheckWhere = CheckWhere ++;

    If (CheckWhere > 1)

    {

    setWhereClause (null);

    setWhereClauseParams (null);

    setWhereClause ("AND START_DATE =:" + CheckWhere);

    setWhereClauseParam(0,ParmHireDt);

    System.out.println ("request" + this.getQuery ());

    }

    on the other

    {

    {setWhereClause (null);

    setWhereClauseParams (null);

    setWhereClause ("START_DATE =:"+ CheckWhere ");

    setWhereClauseParam(0,ParmHireDt);

    System.out.println ("request" + this.getQuery ()) ;}

    }

    System.out.println ("ParamEmpNum" + ParmHireDt);

    }

    System.out.println ("request" + this.getQuery ());

    executeQuery();

    Try this:

    public void initQuery(String dummy,String ParamEmpNum,String ParmHireDt, Boolean executeQuery)
    {
      System.out.println("ParamEmpNum: "+ ParamEmpNum);
      System.out.println("ParmHireDt : "+ ParmHireDt);
    
      setWhereClause(null);
      setWhereClauseParams(null);
    
      String WhereClause = null;
    
      int bindCount = 0;
      HashMap paramMap = new HashMap();
    
      if  ( (ParamEmpNum != null) && (!("".equals(ParamEmpNum.trim())))  )
      {
      paramMap.put(bindCount,ParamEmpNum);
      WhereClause = "EMPLOYEE_NUMBER = :"+ (++bindCount) + " AND ";
      }
      if  ( (ParmHireDt != null) && (!("".equals(ParmHireDt.trim())))  )
      {
      paramMap.put(bindCount,ParmHireDt);
      WhereClause = WhereClause + ("START_DATE = :"+ (++bindCount) + " AND ");
      }
      if(bindCount > 0)
      {
      // Remove the AND at the end
      WhereClause = WhereClause.substring(0, WhereClause.length()-5);
    
      setWhereClause(WhereClause);
      for(int i = 0; i < bindCount; i ++) {
      setWhereClauseParam(i,paramMap.get(i));
      }
      }
    
      System.out.println("Query "+ this.getQuery());
      executeQuery();
    }
    

    You may need to change the START_DATE whereclause as below:

    WhereClause = WhereClause + ("START_DATE = TO_DATE (:" + (++ bindCount) + ', "MON-DD-YYYY" ") AND" ' ");

    Note:-need to specify the correct format.

    See you soon

    AJ

  • using the query, add multiple, logically divide

    query

    create table dummy ( a number , b number);
    
    insert into dummy values (78,16);
    insert into dummy values (102,16);
    insert into dummy values (40,45);
    insert into dummy values (87,19);
    

    I want to build a query only, which should result as below:

    col1 col2 COL3
    78160
    100016
    40450
    87136

    explanation

    1. 78 + 16 = 94

    2. 102 + 16 = 118, baseline is 100, 100 = col1, col2 = 0, number more than 100 should fill col3

    3 87 19 plus 106, 87 = col1, col2 = 13 while col1 and col2 = 100 and more col3 > 100 complete with 6

    SQL > select col1 least (a 100).
    case 2
    3 when a + b > 100 then 0
    4 least (b 100) else
    5 end col2,
    case 6
    7 when a + b > 100 then least(a,100) + least (b 100) - 100
    8 0 otherwise
    end 9 col3
    model 10
    11.

    COL1 COL2 COL3
    ---------- ---------- ----------
    78 16 0
    100 0 16
    40 45 0
    87          0          6

    SQL >

    SY.

  • Help with sql query / a subquery to perform the COUNT

    Hello everyone,

    Co-worker colleague asked me to post a request here in hopes of getting more support.  Here's the question:

    There are 3 tables associated with this request.  A table of the application, which displays a number of application open for a particular request, an audit table that shows you all employees who worked on this application and one employee who shows you the details of the employee table.  My colleague is trying to understand what, how to see only applications that have been published by a wizard, but not a Manager.  There are a few applications that worked on both, but he won't see this request in its results.

    Here are the tables

    EMP

    ID FULL_NAME
    1234John Doe
    5467Jane Doe
    2345Clark Kent
    5432June Cleaver

    Unfortunately, this table does not have a title column (which was created provider, so we cannot change the internal structure).  My colleague knows who is the Assistant and the Director, then in this case, the first two of the id:

    1234 and 5467 are managers and the other 2 are assistants

    T_APPLICATION

    app_id app_number date_opened app_type
    901854778JANUARY 10, 2014NETWORK
    901954779JANUARY 11, 2014DATABASE
    901055000MARCH 12, 2014MATERIAL

    T_APP_AUDIT

    APP_ID PROCESSED_BY
    90181234
    90182345
    90185432
    90192345
    90195432
    90105432

    So, here is the actual query, I was given: it is actually to check the number of times that each application has been published per person:

    Select a.app_id, c.full_name, count (*) that controls

    t_application a, t_app_audit b, c of the emp

    where a.app_id = b.app_id and b.processed_by = c.id and

    a.app_type in ('NETWORK', "DATABASE")

    and b.processed not in ('1234, ' 5467')

    GROUP OF A.APP_ID, c.full_name;

    IF I won't see 9018 in my results, since at one time it was edited by a Manager (1234).  Unfortunately, this request does not eliminate the app_id 9018, it eliminates only the name of handlers appear in the query.  I hope I've explained this properly, and any help to point us in the right direction is welcomed.  Thanks in advance.

    Select

    a.app_id

    c.full_name

    , count (*) as the controls

    of t_application one

    t_app_audit b

    c of the emp

    where a.app_id = b.app_id

    and b.processed_by = c.id

    and a.app_type in ('NETWORK', "DATABASE")

    and b.app_id by (not in

    Select app_id

    of t_app_audit

    where processed_by in ('1234, ' 5467')

    )

    GROUP OF A.APP_ID, c.full_name;

Maybe you are looking for

  • Is it possible to add a mute icon on the status bar

    I understand the desire to keep the clean status bar, but a mute icon would be really useful for many users. This is my first iPhone and I had a LIFEPROOF case to protect it. The problem is that this case does not allow me to determine the setting of

  • I hate the damned lightning flashes constantly. How can I make them disappear?

    Has achieved flashes permanently in the toolbar at the top. This irritates me.

  • box replacement aluminum macbook 13 inch 2006

    Wondering if any third party company may sell an aluminum for the 2006 13 "macbook case? I do not use this "dinosaur" longer, but it still works like a champ! Seeing as how it was created before the unibody models smaller, I flirted with the idea of

  • Update Qbittorent problems

    I used the dropbox community Possin qbittorrentr6_3.3.0_armel.deb and since then I can't access the web interface. The default admin and adminadmin password do not work nor has my original password from the old version. I tried to remove and reinstal

  • Automatically change the exposure time

    Hi all Please, here, I have a program performing two different processes. I have only one camera and I need to set the exposure time of camera for example for 200 microseconds for the first process (this process takes about 30 seconds). After that th