Record count that meet certain criteria in query

Dear all,
I need to calculate number of customers that bought particular material in certain period, how can I do so?
e.g.
Cube Data
SO__CalMonth___Customer_____Material
1____2008.01____Customer A___ Material A
2____2008.01____Customer B___ Material B
3____2008.01____Customer A___ Material A
4____2008.01____Customer C___ Material A
Expected Query Result:
CalMonth__Material_____Customer Count
2008.01___ Material A___2
2008.01___ Material B___1
2008.01___ Material C___1
Since SO 1, 3, 4 all sell Material A, but only 2 customers (A & C) are involved, so the result is 2.
Since SO 2 sell Material B, and it involve only 1 customer B, so the result is 1
Please help!!
Points will be assigned for helpful answers.
Thank you.
Best regards,
Chris

Dear Pavan,
Can you further elaborate the formula you mentioned?
Source Data;
SO__CalMonth___Customer_____Material
1____2008.01____Customer A___ Material A
2____2008.01____Customer B___ Material B
3____2008.01____Customer A___ Material A
4____2008.01____Customer C___ Material A
According to what you suggest,
"Drag date char,material and customer into rows and hide customer char."
It will result in
CalMonth__Material_____Customer
2008.01___ Material A________A
2008.01___ Material A________C
2008.01___ Material B________B
But I want to merge the first 2 Material A into one row, without showing the customer. I just need to count only.
Please advise. Thank you.
Best regards,
Chris

Similar Messages

  • ADF-BC JSF Counting the number of displayed rows that meet certain criteria

    Hi everyone.
    I have a JSF page that displays a table containing rows with a type attribute that may be either 'A' or 'B'. The page uses an executeWithParams form in order to set query parameters and execute the query. My users have asked me to display percentage information for type A rows at the same page.
    One way to do this would be to create an application module method that would parametrize the query, execute it, iterate through the results, do the calculation and return everything in a formatted string.. Somehow this approach does not seem right.
    Is there a best practice regarding situations like this? Any reference to code example would be perfect.
    Thanassis

    Maybe you can use the getEstimatedRowCount() method on the view.
    See more info here:
    http://download.oracle.com/docs/html/B25947_01/bcquerying006.htm

  • How to add a character at the end of an array element that meets certain criteria.

    Hi. I am using CF 9.2.1. I started learning CF yesterday, and I am trying to figure out a way to add a special character (like "?", "!"," & ") to an array row if the first row element (say, element [1][1]) has a specific letter like " t" in the word it is holding. In this case the special character will be added at the end of the last row element (element [1][3]).
    Example: The take columns are: "Firstname", "Lastname", "Age".  If Firstname contains an "s" or "S" (in any order) then add "!" at the end of the row so that :
    Sam, Rubins, 26 !
    Nick, Palo, 32
    Robert, Williams, 28
    Oscar, Ramirez, 23 !
    I tried using the ReReplace, Refind and the #findoneof functions. I could probably loop through the array and return a value and store, while storing the value in a separate variable and using an if/Boolean function to compare that value and so on.... But I am sure there's an easier and more efficient way. Thanks in advance.
    <!--- #1 I will create a three column query named CityInfo--->
    <cfset CityInfo = QueryNew("City, State, LCode","VarChar, VarChar, Integer")>
    <cfset newRow = QueryAddRow(CityInfo, 2)>
    <cfset newRow = QueryAddRow(CityInfo, 3)>
    <cfset newRow = QueryAddRow(CityInfo, 4)>
    <cfset newRow = QueryAddRow(CityInfo, 5)>
    <cfset newRow = QueryAddRow(CityInfo, 6)>
    <!---Using the column names City, Sate and LCode I will now enter the information--->
    <cfset temp = QuerySetCell(CityInfo, "City", "Dallas", 1)>
    <cfset temp = QuerySetCell(CityInfo, "State", "TX", 1)>
    <cfset temp = QuerySetCell(CityInfo, "LCode", "214", 1)>
    <cfset temp = QuerySetCell(CityInfo, "City", "Fort Worth", 2)>
    <cfset temp = QuerySetCell(CityInfo, "State", "TX", 2)>
    <cfset temp = QuerySetCell(CityInfo, "LCode", "817", 2)>
    <cfset temp = QuerySetCell(CityInfo, "City", "San Antonio", 3)>
    <cfset temp = QuerySetCell(CityInfo, "State", "TX", 3)>
    <cfset temp = QuerySetCell(CityInfo, "LCode", "210", 3)>
    <cfset temp = QuerySetCell(CityInfo, "City", "L.A.", 4)>
    <cfset temp = QuerySetCell(CityInfo, "State", "CA", 4)>
    <cfset temp = QuerySetCell(CityInfo, "LCode", "213", 4)>
    <cfset temp = QuerySetCell(CityInfo, "City", "Austin", 5)>
    <cfset temp = QuerySetCell(CityInfo, "State", "TX", 5)>
    <cfset temp = QuerySetCell(CityInfo, "LCode", "512", 5)>
    <h4> Number1. City info TABLE contents:</h4>
    <cfoutput query = "CityInfo">
    #City# #State# #LCode#<br>
    </cfoutput> 
    <!--- #2 Now I focus on the array. I declare it first --->
    <cfset cityarray=arraynew(2)>
    <!--- Then I retrieve the data and populate the array --->
    <cfloop query="CityInfo">
    <cfset cityarray[CurrentRow][1]=City>
    <cfset cityarray[CurrentRow][2]=State>
    <cfset cityarray[CurrentRow][3]=LCode>
    </cfloop>
    <h4>Number2. City info ARRAY contents before appending:</h4>
    <cfloop index="Counter" from=1 to=5>
    <cfoutput>
    City: #cityarray[Counter][1]#,
    Estate: #cityarray[Counter][2]#,
    Code: #cityarray[Counter][3]#<br>
    </cfoutput>
    </cfloop>
    <!--- #3 I now add/append Irving to the array and change L.A. --->
    <cfset cityarray[6][1] = "Irving" />
    <cfset cityarray[6][2] = "Texas" />
    <cfset cityarray[6][3] = "972" />
    <cfset cityarray[4][1] = "Los Angeles" />
    <h4>Number3. City info Array contents after adding Irving, TX and updating L.A.:</h4>
    <cfloop index="Counter" from=1 to=6>
    <cfoutput>
    City: #cityarray[Counter][1]#,
    Estate: #cityarray[Counter][2]#,
    Code: #cityarray[Counter][3]#<br>
    </cfoutput>
    </cfloop>
    <br>
    <!--- #4 now I look for the 's' in order to add a '!' THIS IS WHERE MY PROBLEM BEGINS --->
    <h4>Number4. City info after searching for "s"</h4>
    <cfloop index="Counter" from=1 to=6>
    <cfoutput>
    City: #cityarray[Counter][1]#,
    Estate: #cityarray[Counter][2]#,
    Code: #cityarray[Counter][3]#,
    <!--- I know the findoneof function is not going to help me, but I hope it helps to give you an idea of what I am trying to do--->
    #findoneof("sS",cityarray[Counter][1])#
    <br>
    </cfoutput>
    </cfloop>

    It is much simpler than you think. Additions and modifications are in italics. Good luck!
    <h4>Number2. City info ARRAY contents before appending:</h4>
    <cfloop index="Counter" from="1" to="#CityInfo.recordcount#">
    <cfoutput>
    City: #cityarray[Counter][1]#,
    State: #cityarray[Counter][2]#,
    Code: #cityarray[Counter][3]#<br>
    </cfoutput>
    </cfloop>
    <!--- #3 I now add/append Irving to the array and change L.A. --->
    <cfset cityarray[6][1] = "Irving" />
    <cfset cityarray[6][2] = "Texas" />
    <cfset cityarray[6][3] = "972" />
    <cfset cityarray[4][1] = "Los Angeles" />
    <h4>Number3. City info Array contents after adding Irving, TX and updating L.A.:</h4>
    <cfloop  index="Counter" from="1" to="#arrayLen(cityarray)#">
    <cfoutput>
    City: #cityarray[Counter][1]#,
    State: #cityarray[Counter][2]#,
    Code: #cityarray[Counter][3]#<br>
    </cfoutput>
    </cfloop>
    <br>
    <!--- #4 now I look for the 's' in order to add a '!' THIS IS WHERE MY PROBLEM BEGINS --->
    <h4>Number4. City info after searching for "s"</h4>
    <cfloop index="Counter"  from="1" to="#arrayLen(cityarray)#">
        <cfset sPosition=findNoCase("s",cityarray[Counter][1])>
        <cfoutput>
        City: #cityarray[Counter][1]#,
      State: #cityarray[Counter][2]#,
        Code: #cityarray[Counter][3]#
        </cfoutput>
       <cfif sPosition GT 0><!--- Just display the exclamation mark--->
        <cfelse> <!--- Add whatever you like, or nothing, here--->
        (no 's')
        </cfif>
        <br>   
    </cfloop>

  • Only allow datagridviewcheckbox to check off if it meets certain criteria.

    I have a datagridview with a checkbox column next to it. The datagridview holds a list of all open invoices for a given customer. I don't want the checkbox to check off if there is no money to apply to this invoice. Basically every time the checkbox is
    unchecked and the user is trying to check in the check box it should check if there is money to apply if yes then check it off if not then it should give a message that it can't check off.
    Debra has a question

    I have a datagridview with a checkbox column next to it. The datagridview holds a list of all open invoices for a given customer. I don't want the checkbox to check off if there is no money to apply to this invoice. Basically every time the checkbox
    is unchecked and the user is trying to check in the check box it should check if there is money to apply if yes then check it off if not then it should give a message that it can't check off.
    Debra has a question
    Hello,
    You could consider doing that task inside CellValidating event like the code below.
    private void dataGridView1_CellValidating(object sender, DataGridViewCellValidatingEventArgs e)
    { //make sure the cell belongs to the checkboxColumn
    if (e.ColumnIndex ==0 && e.RowIndex >-1 )
    { //check whether it meets certain criteria here
    if (Convert.ToInt32(this.dataGridView1.Rows[e.RowIndex].Cells["criteria"].Value) < 2)
    dataGridView1.CancelEdit();
    MessageBox.Show("It doesn't meet");
    The line dataGridView1.CancelEdit(); will stop the checking and return to original value.
    You could place the opinion with your line instaed.
    Regards,
    Carl
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • HT201364 I have a MacBook Pro 17" that meets all criteria on this list but it still won't let me upgrade... Help.

    I have a MacBook Pro 17" that meets all criteria on this list but it still won't let me upgrade... Help.
    To install Mavericks, you need one of these Macs:
    MacBook Pro (15-inch or 17-inch, Mid/Late 2007 or later)  **** Maybe my MacBook Pro is early 2007 ? How do I find that out? ****
    Your Mac also needs:
    OS X Mountain Lion, Lion, or Snow Leopard v10.6.8 already installed ***YES
    2 GB or more of memory ***YES
    8 GB or more of available space ***YES
    Last Modified: Nov 6, 2013

    Then your model cannot upgrade to Mountain Lion or Mavericks. That is why you could not download it. You can upgrade to Lion, however.
    Upgrading to Lion
    If your computer does not meet the requirements to install Mountain Lion, it may still meet the requirements to install Lion.
    You can purchase Lion by contacting Customer Service: Contacting Apple for support and service - this includes international calling numbers. The cost is $19.99 (as it was before) plus tax.  It's a download. You will get an email containing a redemption code that you then use at the Mac App Store to download Lion. Save a copy of that installer to your Downloads folder because the installer deletes itself at the end of the installation.
         Lion System Requirements
           1. Mac computer with an Intel Core 2 Duo, Core i3, Core i5, Core i7,
               or Xeon processor
           2. 2GB of memory
           3. OS X v10.6.6 or later (v10.6.8 recommended)
           4. 7GB of available space
           5. Some features require an Apple ID; terms apply.

  • Solaris 8 - No Disks that meet the Criteria in the solaris installer documentation

    Hi there
    I am installin sloaris 8 in Pentium Pro Machine with Quantum Firball Hard
    Disk 10 GB , at installation time the Solaris recognize the existance of the hard disk by givingme the option to load from CD ROm or the Quantum Hard disk but later on it gives me the following message
    No Disks that meet the Criteria in the solaris installer documentation
    Your help will be appreciated
    Thanks

    Hi
    I am using IDE Controller not SCSI, the Hard disk is being partitioned using Dos FDISK , When i got this problem Solrais write this message after the error i mentioned before
    Please Check the system or try another installation option
    then it gives me Unix Prompt , I tried to use FDISK but could not get the right Disk name , I tried FDISK /drv/dsk/c0t0d0s0 or /drv/rdsk/c0t0d0s0
    but no way , I am new to Unix any way , I tried to get the disk name through df,sysdef,prtconf but could not as well , I guess may be the solaris partition is the problem ? may be if i could creat a solaris partition it will solve it ? , I am using the full version of solaris 8 not the beta one.
    Thanks for your help
    Roushdy

  • Looking for Camcorder or Video Recording DSLR That Meets Detailed Needs

    I do apologise for asking a question that may have been answered but whose answer I have not been able to find. I think once you read my requirements you may understand why.
    I am looking at being able to take video of places I go to. In the past I have used my semi pro camera system to take photos and to make movies from these with added music. Over time I am wishing that I had also taken a camcorder to record those memorable occasions which are fading in my mind.
    I am looking for a camera that will meet the following requirements: -
    1. HD 720P (do not like interlaced)
    2. Final Cut Express editable
    3/ Probably want flash memory (internal/external or external). Reason for this is that camera will be taken around in light aircraft, helicopters, 4 wheel drive vehicles, through desert, jungle, bush as well as normal circumstances.
    4/ Want 720P or 1080P (1080P unlikely except in pro camera).
    5/ Want to be able to use filters on camcorder lens.
    6/ I like a proper view finder (but I wear glasses) as quite often in bright light external screens are not visible. But I also want to have a separate, rotatable screen for hip level and above head level filming. Must be bright enough to view in desert sunlight.
    7/ Wish to be able to add a omnidirectional stereo mike or, a unidirectional mike.
    8/ Either have a battery that allows for about eight hours recording a day, or have a swappable battery option.
    9/ Be able to record in low light situations (in side cathedrals, cave entrances, sun set and sun rise)
    10/ Be capable of being able to record wildlife at distances of up to 500 metres or more. I do not like digital zoom, preferring to use optical zoom.
    11/ Being able to record fast moving objects (cheetahs to aircraft)
    12/ Being able to transfer data to a backup storage device whilst travelling. This may not be feasible.
    13/ Being able to play back what has been recorded to review all.
    Now here is a problem. I am limited in budget (approximately £1200 to £1500), and also do not enjoy carrying suitcases around with me. Suitcases go missing an awful lot. I tend to travel with a carry on bag weighing up to 12 kg (including camera system & backup device).
    If there were a digital SLR camera I might go for something like that (e.g. Panasonic DMC-GH1). Problem with this camera is that it records in AVCHD at the top levels and at Motion JPEG for 720p and below. The GH1 wraps its 24 fps movies in an interlaced 60 fps file. It is possible to use the Motion JPEG codec, though you have to drop the resolution to 1280 x 720 (at 30 fps), and deal with a 2GB file size limit. Would love to use my existing Nikkor lenses, but again not necessary.
    I do understand I am unlikely to get such a system in my price range, but what is the closest system on the market, or coming soon that meets my requirements (whether DSLR with video or Camcorder which means I still carry my DSLR).
    Thank you very much for taking the time to read all this.

    Evening Tom,
    Thanks for your response. What I am able to tell you about the Panasonic DMC-GH1 is: -
    It can record full high definition motion pictures compatable with the AVCHD format or motion pictures recorded in Motion JPEG.
    Audio will be recorded in stereo and Dolby Digital Stereo Creator format.
    In AVCHD there are a number of possible settings. In all cases the aspect ratio is 16:9.
    1/ FHD = 1920 x 1080 pixels, 17 Mbps, 50 frames per second interlaced (sensor output is at 25 fps)
    2/ SH = 1280 x 720 pixels, 17 Mbs, 50 frames per second progressive (sensor output is 50 fps)
    3/ H = 1280k720 pixels, 13 Mbps, 50 frames per second progressive (sensor output is 50 fps)
    4/ L = 1280k720 pixels, 9 Mbps, 50 frames per second progressive (sensor output is 50 fps)
    In Motion JPEG the possible settings are
    1/ HD = 1280 x 720 pixels at 30 fps and an aspect ration of 16:9
    2/ WVGA = 848 x 480 pixels at 30 fps and an aspect ration of 16:9
    3/ VGA = 640 x 480 pixels at 30 fps and an aspect ratio of 4:3
    4/ QVGA = 320 x 240 pixels at 30 fps and an aspect ratio of 4:3
    AVCHD Movies can be recorded continuously for up to 29 minutes 59 seconds. Motion picture recorded continuously in MOTION JPEG the limit is up to 2 GB (approximately 8m 20 seconds) in any one scene.
    Regards,
    Hval

  • Using Formulas and Variables To Count Rows That Meet Certain Conditions

    I have a web intelligence report designed that shows results of shipments that arrived and departed in a given period and the mode of transport (air, ocean, motor).   I've tried building formulas to give me counts for example of the number of shipments arrived via ocean, number of shipments that departed via ocean, and so on.
    I tried various the Count and If functions in different ways but I can't seem to get them to work.  What is the correct logical set of variables or formulas I need to build so that I can display summarized information in my report that shows:
    Shipments Arrived via Ocean
    Shipments Arrived via Air
    Shipments Departed via Ocean
    Shipments Departed via Air
    Key report fields are [Shipment Identifier] , [Mode]=Ocean, Air, Motor, and [Status] = Arrive;Depart

    You should be able to do one of the following:
    1. Create a measure variable ShipmentCount as
    =Count([Shipment Identifier])
    In the report, use Mode, Status and ShipmentCount. This will give an aggregated count per Mode per Status.
    2. Create a formula for each of Mode/Status combination like
    =Count([Shipment Identifier]) where ([Mode] = "Ocean" and [Status] = "Arrive")

  • Getting a record count in a query using UNIQUE

    I need to know how to grab a record count for a query so I can pass it back into the recordset.
    This select query uses UNIQUE to rollup the 555 records to 125 unique rows.
    But how would I do a record count.
    Do I pass the query to a cursor and then count the records in the cursor?
    Please detail your help please.
    Thank you in advance.

    SELECT unique
         CE.DATE_OF_SERVICE AS DOS_FROM
         ,CE.SERVICE_END_DATE AS DOS_TO
         ,CE.EVENT_SERVICE AS SERVICE_TYPE
         ,CN.CREATE_DATE_TIME
         ,CN.CASE_NOTE_ID
         ,CN.CASE_ID
         ,CN.EVENT_ID
         ,CN.REASON
         ,CN.CREATOR_USER_ID AS CREATOR_ID_USED
         ,CN.ROWID AS ROW_ID
         ,(SELECT Retrieve_Note2(CN.CASE_ID,CN.CASE_NOTE_ID) from DUAL) AS NOTE
    FROM
         MEMBER_TO_PATIENT MTA,
         CARE_EVENT CE,
         CASE_NOTES CN
    WHERE
         MTA.SUBSCRIBER_LID = '1260016473015' AND
         MTA.CASE_ID = CN.CASE_ID AND
         CN.EVENT_ID = CE.EVENT_ID
    ORDER BY
         CN.CASE_NOTE_ID DESC

  • Problem in getting update records count while executeBatch()

    hi,
    I have used "Select in Insert" queries for migrating data from one table to another.
    like
    INSERT INTO TABLE1 (COL1, COL2)
    SELECT COL1,COL2,... FROM TABLE2
    WHERE COL1 = ... AND COL2 = ...;
    Case 1:
    I added these statements as addBatch() & at the end i execute method " executeBatch()". It returned the array of integer having record count for each query respectively.
    But that count was always be -2 i.e. SUCCESS_NO_INFO.
    Case 2:
    If i run the same code with executeUpdate() method , it returned me the correct number of records counts that are inserted into the table.
    I cudn't able to understand that it is failing for case1.
    Can anybody tell the reason for this behaviour .......................
    Edited by: user11187328 on Mar 17, 2010 3:45 AM
    Edited by: user11187328 on Mar 17, 2010 3:46 AM

    hi,
    Thanks again for a correct reply but can u also tell me tht which jar i needs to included.
    There are so many jar files & should i remove old jar files or jvm auto picks the updated jar file.
    Following jar files are shown on the link:::
    ojdbc5.jar (1,996,228 bytes) - Classes for use with JDK 1.5. It contains the JDBC driver classes, except classes for NLS support in Oracle Object and Collection types.
    ojdbc5_g.jar (3,081,328 bytes) - Same as ojdbc5.jar, except that classes were compiled with "javac -g" and contain tracing code.
    ojdbc6.jar (2,111,220 bytes) - Classes for use with JDK 1.6. It contains the JDBC driver classes except classes for NLS support in Oracle Object and Collection types.
    ojdbc6_g.jar (3,401,519 bytes) - Same as ojdbc6.jar except compiled with "javac -g" and contains tracing code.
    ojdbc5dms.jar (2,429,777 bytes) - Same as ojdbc5.jar, except that it contains instrumentation to support DMS and limited java.util.logging calls.
    ojdbc5dms_g.jar (3,101,875 bytes) - Same as ojdbc5_g.jar, except that it contains instrumentation to support DMS.
    ojdbc6dms.jar (2,655,741 bytes) - Same as ojdbc6.jar, except that it contains instrumentation to support DMS and limited java.util.logging calls.
    ojdbc6dms_g.jar (3,423,263 bytes) - Same as ojdbc6_g.jar except that it contains instrumentation to support DMS.
    orai18n.jar (1,656,280 bytes) - NLS classes for use with JDK 1.5, and 1.6. It contains classes for NLS support in Oracle Object and Collection types. This jar file replaces the old nls_charset jar/zip files.
    demo.zip (603,363 bytes) - contains sample JDBC programs.

  • Get records count of all tables

    Hi ,
    I am trying to get the record count of all tables using dynamic query. I don't know how to put the value in placeholder. I tried the below code.
    SET SERVEROUTPUT ON SIZE 1000000
    DECLARE
         CURSOR table_list
         IS
         select OBJECT_NAME from user_objects
         where object_type in ('TABLE')
         and object_name not like '%AUDIT_DDL%'
         AND object_name not like 'MD_%'
         AND object_name not like 'EXT_%'
         AND object_name not like 'STG_%'
         AND object_name not like 'SYS_%'
         AND object_name not like 'TMP_%'
         AND object_name not like 'TEMP_%'
         order by 1;
         v_count     NUMBER :=0;
         query_str VARCHAR2(1000);
    BEGIN
         FOR table_name IN table_list
         LOOP
              query_str :='SELECT COUNT(1) FROM  ' || table_name.OBJECT_NAME;
    dbms_output.put_line(query_str);
              dbms_output.put_line('Table Name:' || table_name.OBJECT_NAME );
              v_count:= execute immediate query_str;
              dbms_output.put_line('Table Name:' || table_name.OBJECT_NAME || ', Count ' || v_count );
         END LOOP;
    END;
    I know I am doing wrong in the bold lines. But not sure how to fix it. Please help. Thanks in advance.

    Hi,
    Welcome to the forum!
    What you posted is basically right, assuming you really want to do dynamic SQL t all.
    The only problem with
    961618 wrote:
              query_str :='SELECT COUNT(1) FROM  ' || table_name.OBJECT_NAME; would be if the object name included special characters (such as single-quotes) or lower-case letters. To avoid any possible problems, I would put the object name inside double-quotes:
    ...     query_str := 'SELECT COUNT (*) FROM "' || table_name.OBJECT_NAME
                                               || '"';
              v_count:= execute immediate query_str;
    The correct syntax is
    execute immediate query_str INTO v_count;V_count will be the number of rows in a single table. Keep another variable (say total_v_count) that keeps the total count so far.
    Do you really need dynamic SQL?
    SELECT     SUM (num_rows)     AS total_rows
    FROM     user_tables
    WHERE     table_name     NOT_LIKE '%AUDIT_DDL%
    AND     ...
    ;gets the same information, accurate as of the last time statistics were gathered, and some of the numbers may be approximate. Depending on how you use the results, that may be good enough for you. If you actually have 10,000,123 rows, and the query says you have 10,000,000, does it really matter?

  • Problem in getting correct update records count while getUpdateCount()

    hi,
    I have used "Select in Insert" queries for migrating data from one table to another.
    like
    INSERT INTO TABLE1 (COL1, COL2)
    SELECT COL1,COL2,... FROM TABLE2
    WHERE COL1 = ... AND COL2 = ...;
    Case 1:
    I added these statements as addBatch() & at the end i execute method " executeBatch()".
    Then i execute
    getUpdateCount() method
    on that prepareStatement ,but that count was not correct all the time.
    Case 2:
    If i run the same code with executeUpdate() method , it returned me the correct number of records counts that are inserted into the table.
    I cudn't able to understand that it is failing for case1.
    Can anybody tell the reason for this behaviour .......................
    Edited by: user11187328 on Mar 18, 2010 4:52 AM

    hi,
    Thanks again for a correct reply but can u also tell me tht which jar i needs to included.
    There are so many jar files & should i remove old jar files or jvm auto picks the updated jar file.
    Following jar files are shown on the link:::
    ojdbc5.jar (1,996,228 bytes) - Classes for use with JDK 1.5. It contains the JDBC driver classes, except classes for NLS support in Oracle Object and Collection types.
    ojdbc5_g.jar (3,081,328 bytes) - Same as ojdbc5.jar, except that classes were compiled with "javac -g" and contain tracing code.
    ojdbc6.jar (2,111,220 bytes) - Classes for use with JDK 1.6. It contains the JDBC driver classes except classes for NLS support in Oracle Object and Collection types.
    ojdbc6_g.jar (3,401,519 bytes) - Same as ojdbc6.jar except compiled with "javac -g" and contains tracing code.
    ojdbc5dms.jar (2,429,777 bytes) - Same as ojdbc5.jar, except that it contains instrumentation to support DMS and limited java.util.logging calls.
    ojdbc5dms_g.jar (3,101,875 bytes) - Same as ojdbc5_g.jar, except that it contains instrumentation to support DMS.
    ojdbc6dms.jar (2,655,741 bytes) - Same as ojdbc6.jar, except that it contains instrumentation to support DMS and limited java.util.logging calls.
    ojdbc6dms_g.jar (3,423,263 bytes) - Same as ojdbc6_g.jar except that it contains instrumentation to support DMS.
    orai18n.jar (1,656,280 bytes) - NLS classes for use with JDK 1.5, and 1.6. It contains classes for NLS support in Oracle Object and Collection types. This jar file replaces the old nls_charset jar/zip files.
    demo.zip (603,363 bytes) - contains sample JDBC programs.

  • Query that provides combination of data that meet a certain criteria

    I am trying to find a combination of rows that combine to meet a criteria.
    I have a table with columns Length , Width and No of pieces. Each row represents one rectangular piece and its quantity.
    The entries are like 300 600
    30
                                    400
    300 10............etc.
    I want the user to give input like necessary rectangular length = 1000 and necessary rectangular width = 500 and the query can give me all possible combinations from available rectangular pieces that combine to form this necessary rectangle and if not, print
    an error.
    If a code is required instead of query (which i think it is) please advice the code and how to attach a code to Microsoft access file as an addin.
    Thanks

    Thanks guys for the help.
    Just to clarify what I am looking for, here are the tables. The main table from access database is - 
                       Length
                       Width
                         No of Available pieces
    300
    600
    20
    600
    400
    10
    900
    600
    5
    ………..the list is very long.
    User enters the value : Length Needed = 900 , Width needed = 1200
    Query gives this output -
    Option 1
                    Length
                      Width
                          No of needed pieces
    300
    600
    6
    Option 2
                   Length
                      Width
                             No of neede pieces
    900
    600
    2
    Option 3
                     Length
                      Width 
                            No of needed pieces
    900
    600
    1
    300
    600
    3
    ………so on

  • Regarding a query that gives a count of a certain combination of characters

    Hi all,
           I had a query to be created that gives a count of a certain combination of characteristics from a cube.
    Say a cube has 4 characteristics , Say A, B, C, D.
    Now amongst all the records that occured in the Cube I need a report of the following A, B and be able to see the count of the number of times a combination of A B occured i.e. variations of C and D for a certain A and B.
    For example say in the cube the A B C D has the following contents
    a1,b1,c1,d1
    a1,b1,c1,d2
    a1,b1,c1,d3
    a1,b1,c2,d1
    a1,b2,c1,d1
    a1,b2,c1,d2
    a1,b2,c2,d1
    a1,b2,c2,d2
    a2,b1,c1,d1.
    the report should show
    a1,b1,4 ,where 4 is the number of combination of a1 & b1.
    a1,b2,4 ,where 4 is the number of combination of a1 & b2.
    a2,b1,1 ,where 1 is the number of combination of a2 & b1.
    i want a help from all regarding this query.
    Thanking you in advance

    If you are in BW 3.5 or SEM I'd do this with a BPS-Exit that fills a key figure 'Combination Count' with 1 for each combination. If you need any details programming a BPS exit function feel free to ask.
    If you are in BW 3.0 or 3.1 without BPS-functions or you don't want to do BPS-setup just to create a user exit I'd suggest the following.
    1. Create an ODS CCOUNT that contains A,B,C,D and a key figure COUNT.
    2. Create an export data source for your cube.
    3. Create uodate rules from your cube to the ODS and set the key figure to constant 1 (with overwrite).
    4. Load your cube data into the ODS object.
    5. Load the ODS values back into the cube.
    This could lead to problems if you have other InfoObjects in your cube like time or version where you want to filter.
    Final method would be a virtual key figure but I'd try it this way first.
    B est regards
       Dirk

  • How can I get record count with a query?

    In Client/Server pplication,the client send a query to server.
    How can server get record count by oracle call interface?
    Is it need execute "select count(*) from ...."?

    Yes.
    Either that or increment a counter for each record fetched and
    loop round until you hit the last record.
    The first method would be more efficient on large datasets.

Maybe you are looking for

  • Embedded hotspots on animated gif

    Hi Guys, I'm wondering if it is possible to create multiple hotspots on an animated gif that are embedded in the gif file itself, instead of adding additional HTML to my page. Thanks

  • Cant find albums in source pane

    I thought I remembered that in the past when I created an album in iPhoto I could then find that album in the source pane. when I want to find a specific photo to upload (or attach or whatever) I need to find it by going through 2007 then the roll th

  • Frame Controls

    Anyone know how to bypass Resizing but keep Retiming active? I have a MOV at 18fps - I need it at 25fps. I can export as a DV stream from QT, the duration remains correct and the result is 25fps, rather than a QT export at 25fps which then just speed

  • Hiding the Menu bar

    Hi all Rather an odd question I have but hopefully someone has a solution. We're replacing our PC Training Room with macs and using virtual machines to have the flexibility of xp, vista linux or mac. Created a user called winxp that launches virtual

  • [ANN] xframe-swing (frozen columns with the JXTable)

    The xframe team is pleased to announce the release 0.6-beta of our swing subproject, the first beta release. Currently the main purpose of this project is the JXTable class, an extension to the JTable which offers frozen columns and groupable column