Search query returning ALL records

DW CS3 - MS Access - ASP/VBScript
I have a search form for records to display on the same page with keywords highlighted.  The search is returning ALL records and highlighting keywords throughout rather than returning specific records with the searched word.  What am I missing?  I'm sure it's something terribly simple.....
          <input name="search" type="text" id="search" value="<%= Request.QueryString("search") %>" />
          SELECT item, item, item, item
          FROM tbl_name
          WHERE item OR item OR item LIKE %MMColParam%
          ORDER BY sql_orderby, Date DESC
          Name: MMColParam
          Type: Text
          Value: Request.Querystring("search")
          Default Value: %

I was using the word "item" as an example for multiple columns without actually naming them - they are not the same.  I should've used this example:
SELECT shoes, socks, hats, gloves
FROM tbl_apparel
WHERE shoes OR socks OR hats LIKE %MMColParam%
ORDER BY sql_orderby, Date DESC
In the past, I had four duplicate query parameters for four columns which worked fine.  But since I only have one search term, I thought I could eliminate three of the duplicate parameters and use just one with the OR statement.
In the past, you questioned me on this.  You stated, "You only have one search term and so all of the parameters have the same value, but DW still wants to creates 4 parameters. If you were coding this by hand you wouldn't do it that way, but DW's one-size-fits-all code generates four seperate parms. It's nothing to worry about."

Similar Messages

  • Mac mail search function is not working. Any search term returns all records.

    Mac mail search function is not working. Any search term returns all records.

    hi eric. many thanks.
    i will have to read these links closer but what i meant to say is that the hard drive space that was being taken up seemed like it suddenly jumped way up because i had just gotten through a process in the last month where i am storing all my My Documents data on my Mac Pro. i am doing this in order to decide whether i should just keep it ALL on my Mac Pro and use ChronoSync to sync /some/ of it to my MBP.
    so if i look in the Documents folder on my Mac Pro i have a ton of folders that i have created with a ton of data. if i look in the Documents folder on my MBP there are NO folders that have data in them that i created. there are other folders such as folders that various software created but what i mean to point out is that there was a LOT of available space on my HD until recently.
    i am wondering if there is some way that running the Mail re-index (it then ran some kind of "Importing" routine) or by syncing my Photostream to the MBP caused a huge jump in data on this drive. if it is the photostream sync i can just take this off or see if it will sync more selectively. if it is something to do with mac mail jumping in size i am not sure why this would happen or what to do about it.
    does that question make sense?
    i mean, before i did these two operations my recollection is that i would have had 130 GB on the hard drive (really just guessing here) and now there is like 218 GB on the hard drive and i don't know where all this came from...

  • Using index in a query return few records than full table access

    Today we have an issue with a query, when it use the ok index the returned are not all records that apply to where clause condition.
    See bellow
    explain plan for
    select * from movdb.zan_m03 where
    M00AF = TO_DATE('11/01/28','YY/MM/DD') AND
    M00za = 10 AND
    m00AC = 50 AND
    M00AD between 136906 and 136999
    SELECT * FROM TABLE(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 1882720105
    | Id | Operation | Name |
    | 0 | SELECT STATEMENT | |
    | 1 | TABLE ACCESS BY INDEX ROWID| ZAN_M03 |
    |* 2 | INDEX RANGE SCAN | PK_ZAN_M03 |
    Predicate Information (identified by operation id):
    PLAN_TABLE_OUTPUT
    2 - access("M00AF"=TO_DATE('11/01/28','YY/MM/DD') AND "M00ZA"=10 AND
    "M00AC"=50 AND "M00AD">=136906 AND "M00AD"<=137141)
    filter("M00AD"<=137141 AND "M00AD">=136906)
    Note
    - rule based optimizer used (consider using cbo)
    20 rows selected.
    The query above return only one row insted 1579 record that apply to this conditions.
    When forcing a full table acess with a hint, the query return all records that apply, the 1579 record.
    select /*+ FULL(zan_m03) */ M00AF, M00za, m00AC , M00AD from movdb.zan_m03 where
    M00AF = TO_DATE('11/01/28','YY/MM/DD') AND
    M00za = 10 AND
    m00AC = 50 AND
    M00AD between 136906 and 137141
    Can you help me to identify what's happening?
    I am with Oracle 10g R2 10.2.0.4 standard edition
    the statistics are up to date
    the opitimizer_mode are rule, but altering in session level to all_rows happens the same issue.
    Nothing about corruption in the alert log.
    Thanks in advance
    Regards
    Cristiano

    Yes the query are the same and correct restriction for where clause are M00AD between 136906 and 137141.
    I've pasted, by mistake, another test query
    The corrects are:
    select M00AF, M00za, m00AC , M00AD from movdb.zan_m03 where
    M00AF = TO_DATE('11/01/28','YY/MM/DD') AND
    M00za = 10 AND
    m00AC = 50 AND
    M00AD between 136906 and 137141
    This use pk index and return one row
    select /*+ FULL(zan_m03) */ M00AF, M00za, m00AC , M00AD from movdb.zan_m03 where
    M00AF = TO_DATE('11/01/28','YY/MM/DD') AND
    M00za = 10 AND
    m00AC = 50 AND
    M00AD between 136906 and 137141
    This does a full table access and return 1579 records
    I´ve been searching for wrong results bugs on my oracle support, but not found one that mentions something like our issue.
    I checked the dba_tables and dba indexes and the number of rows are different, and I think this would be the same because it's is a pk.
    Look this
    SQL> select NUM_ROWS from dba_tables where table_name = 'ZAN_M03'
    2 /
    NUM_ROWS
    228527878
    select NUM_ROWS from dba_indexes where index_name = 'PK_ZAN_M03';
    SQL> select NUM_ROWS from dba_indexes where index_name = 'PK_ZAN_M03';
    NUM_ROWS
    217510185
    Is normal a index for pk having much fewer rows than table? I think not, but not sure.
    Again
    Thanks in advance
    Regards
    Cristiano

  • CAML Query returning all items with date condition

    HI,
    I have a problem doing a query with CAML over the elements of a calendar in SharePoint 2013
    I just want to retrieve all items, which have been modified on a particular date. But below query returns all items from the Calendar.
    Any suggestion how to get specific items from the calendar. The same issue exists for start date  and end date.
      var oWebsite = clientContext.get_web();
        this.collList = oWebsite.get_lists();
        var camlQuery1 = new SP.CamlQuery();
       camlQuery1.set_viewXml(
       '<query><Where>'+
          '<Eq>'+
             '<FieldRef Name=\'Modified\'  IncludeTimeValue=\'TRUE\'/>' +
             '<Value Type=\'DateTime\'>2014-02-24T12:00:00Z</Value>'+
          '</Eq>'+
       '</Where></query>');
        this.collListItem1 = oList.getItems(camlQuery1);
        clientContext.load(collListItem1);

    Firstly try to make this change in your query and see if that helps
    camlQuery1.set_viewXml(
    '<View><Query><Where>'+
    '<Eq>'+
    '<FieldRef Name=\'Modified\' IncludeTimeValue=\'TRUE\'/>' +
    '<Value Type=\'DateTime\'>2014-02-24T12:00:00Z</Value>'+
    '</Eq>'+
    '</Where></Query></View>');
    Geetanjali Arora | My blogs |

  • Returning all records for a query

    Hi,
    still working on this library. I have the majority of it working (not pretty but it works). One problem I have run into is that when I query an authors name I would like all records for that author to be shown. However, it is only showing the final record.
                   public void Search_a()throws Exception{
              String S_author1 = JOptionPane.showInputDialog(null,"Please enter the authors name");
                   String query = ("select * from library where Author=('"+S_author1+"')");
                   ResultSet rs = db_statement.executeQuery(query);
                   while (rs.next()) {
                  String s = rs.getString("Author");
                  output.setText(rs.getString("ISBN")+"\t"+rs.getString("Title")+"\t"+ s +"\t"+ rs.getString("Publisher")+"\t"+rs.getString("Genre")+"\t"+rs.getString("Details")+"\n");
              }//end while
         }// end search_aI cannot see where the error is. I think maybe I am overwriting the previous records but thought that the inclusion of +"\n" would force each result to a new line.
    Any ideas?

    Thanks for that. Not really sure how I would implement that (new to programming) but I have managed to solve it using               output.setText(output.getText()+rs.getString("ISBN")+"\t"+rs.getString("Title")+"\t"+ s +"\t"+ rs.getString("Publisher")+"\t"+rs.getString("Genre")+"\t"+rs.getString("Details")+"\n");Thanks for the reply though.

  • SEARCH (only returns one record?)

    When I run my search, it only returns the first record it finds. Can sombody give me a clue to why it won't return multipule records?
    try{
    //Connect to the Database
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con =
    DriverManager.getConnection("jdbc:odbc:ComfortZoneDB");
    Statement s = con.createStatement();
    String sql = "SELECT * from Hydronics WHERE Keyword LIKE '%"+field+"%' order by Keyword";
    //Contains results from the SQL Query
    ResultSet rs = s.executeQuery(sql);
    // Displays it all out in a table
    while (rs.next()) {
    txt_search1.setText(""+rs.getString(1)+ "|" rs.getString(2) "|"+rs.getString(3)+ "|"+rs.getString(4)+ "|"+rs.getString(5)+ "|"+rs.getString(6)+ "|"+rs.getString(7));
    rs.close();
    s.close();
    con.close();
    catch(SQLException e){
    catch(Exception e){ 
    }

    Sir,
    Slappy presents Table Models 101.
    import java.sql.*;
    import javax.swing.*;
    import javax.swing.table.*;
    import java.util.*;
    public class SlappyReadOnlyTableModel{
      private LinkedList rows;
      private String[] colnames;
      private int[] coltypes;
      public SlappyReadOnlyTableModel(ResultSet rs)throws Exception{
        ResultSetMetaData rsmd = rs.getMetaData();
        colnames = new String[rsmd.getColumnCount()];
        coltypes = new int[rsmd.getColumnCount()];
        for(int i=0;i<colnames.length;i++){
          colnames[i] = rsmd.getColumnLabel(i+1);
          coltypes[i] = rsmd.getColumnType(i+1);
        rows = new LinkedList();
        // this bit checks the cursor position. if not at the start we move it there IF we can
        if(!rs.isBeforeFirst()){
          if(rs.getType()!=ResultSet.TYPE_FORWARD_ONLY){
            rs.beforeFirst();
        while(rs.next()){
          Object[] arow = new Object[colnames.length];
          for(int i=0;i<arow.length;i++){
            switch(coltypes){
    case Types.BOOLEAN:
    arow[i] = new Boolean(rs.getBoolean(i+1));
    break;
    case Types.DATE:
    arow[i] = rs.getDate(i+1);
    break;
    case Types.INTEGER:
    arow[i] = new Integer(rs.getInt(i+1));
    break;
    case Types.DOUBLE:
    arow[i] = new Double(rs.getDouble(i+1));
    break;
    // I have left out many cases. Adjust as required.
    default:
    arow[i] = rs.getString(i+1);
    rows.add(arow);
    public int getRowCount(){
    return rows.size();
    public int getColumnCount(){
    return colnames.length;
    public Object getValueAt(int row, int column){
    Object[] arow = (Object[]) rows.get(row);
    return arow[column];
    public boolean isCellEditable(int row, int column){
    return false;
    public String getColumnName(int column){
    return colnames[column];
    Save that as SlappyReadOnlyTableModel.
    Then invoke in your code like this...
    ResulSet rs = // whereever you get result set from.
    SlappyReadOnlyTableModel tm = new SlappyReadOnlyTableModel(rs);
    rs.close();
    JTable display = new JTable(tm);
    // now add your table where you likeToday was your lucky day. Please use the API and look at the tutorial for more. http://java.sun.com/docs/books/tutorial/uiswing/components/table.html
    Sincerely,
    Slappy

  • Query returns zero records in coldfusion context, but works fine in Navicat

    I've got a query that's returning zero records when I load a page.  If I copy and paste that same query (from the debug output) into navicat, I get rows returned (as I expect).  Has anyone seen this?  It happens locally (CF9) AND remotely on our staging server (CF10).  Even weirder, it's a query that was previously working fine - I simply added an if statement to the where clause, and all of a sudden... 
    Here's the query:
            <CFQUERY name="LOCAL.getEncounterServices" datasource="#REQUEST.dsn#"> 
            SELECT
                a.EncounterProductID,
                a.DateTime AS ServiceDate,
                aa.CartItemID,
                aaa.CartID,
                aaaaa.CartStatus,
                b.ProductID,
                b.ProductName,
                b.CPTCode,
                b.Price,
                c.EncounterID,
                c.DateTimeClosed AS EncounterClosedDate,
                d.FirstName,
                d.LastName
            FROM
                EncounterProducts a
                    LEFT JOIN CartItemProduct aa ON (a.EncounterProductID = aa.EncounterProductID AND aa.Active = 1)
                    LEFT JOIN CartItem aaa ON (aa.CartItemID = aaa.CartItemID)
                    LEFT JOIN Cart aaaa ON (aaa.CartID = aaaa.CartID)
                    LEFT JOIN CartStatus aaaaa ON (aaaa.CartStatusID = aaaaa.CartStatusID),
                Product b,
                Encounters c,
                Contacts d,
                EncounterStatuses e
            WHERE
                1 = 1
                AND (aa.CartItemID IS NULL OR aaaaa.CartStatus = 'Deleted')
                AND a.Active = 1
                AND a.ProductID = b.ProductID
                AND a.EncounterID = c.EncounterID
                AND c.PatientID = d.ContactID
                AND c.EncounterStatusID = e.EncounterStatusID
                AND e.EncounterStatus = 'Closed'
              <CFIF IsDefined("ARGUMENTS.encounter") AND IsObject(ARGUMENTS.encounter)>
                     AND c.EncounterID = <CFQUERYPARAM cfsqltype="cf_sql_integer" value="#ARGUMENTS.encounter.getID()#">
             <CFELSE>
                    AND c.DateTimeClosed >= <CFQUERYPARAM cfsqltype="cf_sql_date" value="#ARGUMENTS.startDate#">
                    AND c.DateTimeClosed < <CFQUERYPARAM cfsqltype="cf_sql_date" value="#DateFormat(DateAdd('d', 1, ARGUMENTS.endDate), 'yyyy-mm-dd')# 00:00:00">
               </CFIF>
                AND c.LocationID = <CFQUERYPARAM cfsqltype="cf_sql_integer" value="#ARGUMENTS.locationID#">
                AND c.CustomerID = <CFQUERYPARAM cfsqltype="cf_sql_integer" value="#ARGUMENTS.customerID#">
            </CFQUERY>
    All of this worked just fine before I added the lines:
             <CFIF IsDefined("ARGUMENTS.encounter") AND IsObject(ARGUMENTS.encounter)>
                     AND c.EncounterID = <CFQUERYPARAM cfsqltype="cf_sql_integer" value="#ARGUMENTS.encounter.getID()#">
             <CFELSE>
                    AND c.DateTimeClosed >= <CFQUERYPARAM cfsqltype="cf_sql_date" value="#ARGUMENTS.startDate#">
                    AND c.DateTimeClosed < <CFQUERYPARAM cfsqltype="cf_sql_date" value="#DateFormat(DateAdd('d', 1, ARGUMENTS.endDate), 'yyyy-mm-dd')# 00:00:00">
              </CFIF>
    Previously, it had just been:
                    AND c.DateTimeClosed >= <CFQUERYPARAM cfsqltype="cf_sql_date" value="#ARGUMENTS.startDate#">
                    AND c.DateTimeClosed < <CFQUERYPARAM cfsqltype="cf_sql_date" value="#DateFormat(DateAdd('d', 1, ARGUMENTS.endDate), 'yyyy-mm-dd')# 00:00:00">
    With no IF/ELSE statement.
    Anyone seen anything like this before?  Any ideas? 
    Thanks.

    Right, I'll start disabusing myself of the DateFormat!
    I'm sorry, I should've posted the actual query too.  It's inserting the first part - "AND c.EncounterID = ....."
    Here's the full query:
    LOCAL.getEncounterServices (Datasource=xmddevdb, Time=9ms, Records=0) in /Applications/ColdFusion9/wwwroot/XMD_NEW/xmd_dev/cfc/ShoppingGateway.cfc @ 16:56:28.028
    SELECT
                a.EncounterProductID,
                a.DateTime AS ServiceDate,
                aa.CartItemID,
                aaa.CartID,
                aaaaa.CartStatus,
                b.ProductID,
                b.ProductName,
                b.CPTCode,
                b.Price,
                c.EncounterID,
                c.DateTimeClosed AS EncounterClosedDate,
                d.FirstName,
                d.LastName
            FROM
                EncounterProducts a
                    LEFT JOIN CartItemProduct aa ON (a.EncounterProductID = aa.EncounterProductID AND aa.Active = 1)
                    LEFT JOIN CartItem aaa ON (aa.CartItemID = aaa.CartItemID)
                    LEFT JOIN Cart aaaa ON (aaa.CartID = aaaa.CartID)
                    LEFT JOIN CartStatus aaaaa ON (aaaa.CartStatusID = aaaaa.CartStatusID),
                Product b,
                Encounters c,
                Contacts d,
                EncounterStatuses e
            WHERE
                1 = 1
                AND (aa.CartItemID IS NULL OR aaaaa.CartStatus = 'Deleted')
                AND a.Active = 1
                AND a.ProductID = b.ProductID
                AND a.EncounterID = c.EncounterID
                AND c.PatientID = d.ContactID
                AND c.EncounterStatusID = e.EncounterStatusID
                AND e.EncounterStatus = 'Closed'
                     AND c.EncounterID = ?
                AND c.LocationID = ?
                AND c.CustomerID = ?
    Query Parameter Value(s) -
    Parameter #1(cf_sql_integer) = 28
    Parameter #2(cf_sql_integer) = 16
    Parameter #3(cf_sql_integer) = 6
    Thansk again for the help!

  • Search results displaying all records, please help

    i did post this before but didnt have any luck I have used my search script before but tried it again and it is returning ALL the results from the DB..Can anyone see what i am missing?
    $var_SalaryReq_Recordset1 = "%";
    if (isset($_GET['SalaryReq'])) {
      $var_SalaryReq_Recordset1 = $_GET['SalaryReq'];
    $var_skills_offered_Recordset1 = "%";
    if (isset($_GET['skills_offered'])) {
      $var_skills_offered_Recordset1 = $_GET['skills_offered'];
    $var_location_Recordset1 = "%";
    if (isset($_GET['location'])) {
      $var_location_Recordset1 = $_GET['location'];
    $var_PositionReq_Recordset1 = "%";
    if (isset($_GET['PositionReg'])) {
      $var_PositionReq_Recordset1 = $_GET['PositionReg'];
    mysql_select_db($database_hostprop, $hostprop);
    $query_Recordset1 = sprintf("SELECT userid, FirstName, Surname, SalaryReq, PositionReq, location, otherComments, skills_offered FROM think_signup WHERE SalaryReq LIKE %s OR PositionReq LIKE %s OR location LIKE %s OR skills_offered LIKE %s", GetSQLValueString("%" . $var_SalaryReq_Recordset1 . "%", "text"),GetSQLValueString("%" . $var_PositionReq_Recordset1 . "%", "text"),GetSQLValueString("%" . $var_location_Recordset1 . "%", "text"),GetSQLValueString("%" . $var_skills_offered_Recordset1, "text"));
    $query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
    $Recordset1 = mysql_query($query_limit_Recordset1, $hostprop) or die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    the search feilds are
                <input name="PositionReq" type="text" class="textfeilds" value="Job Title" size="32" />
                <input name="skills_offered" type="text" class="textfeilds" value="Skills Required" size="32" />
                <input name="SalaryReq" type="text" class="textfeilds" value="Salary Offered" size="32" />
                <input name="location" type="text" class="textfeilds" value="Location" size="32" />
    thanks in advance

    $currentPage = $_SERVER["PHP_SELF"];
    $maxRows_Recordset1 = 5;
    $pageNum_Recordset1 = 0;
    if (isset($_GET['pageNum_Recordset1'])) {
      $pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
    $startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
    $var_SalaryReq_Recordset1 = "xxxxx";
    if (isset($_GET['SalaryReq'])) {
      $var_SalaryReq_Recordset1 = $_GET['SalaryReq'];
    $var_skills_offered_Recordset1 = "xxxxx";
    if (isset($_GET['skills_offered'])) {
      $var_skills_offered_Recordset1 = $_GET['skills_offered'];
    $var_location_Recordset1 = "xxxxx";
    if (isset($_GET['location'])) {
      $var_location_Recordset1 = $_GET['location'];
    $var_PositionReq_Recordset1 = "xxxxx";
    if (isset($_GET['PositionReg'])) {
      $var_PositionReq_Recordset1 = $_GET['PositionReg'];
    mysql_select_db($database_hostprop, $hostprop);
    $query_Recordset1 = sprintf("SELECT SalaryReq, skills_offered, location, PositionReq, otherComments, userid, FirstName, Surname FROM think_signup WHERE SalaryReq LIKE %s OR PositionReq LIKE %s OR location LIKE %s OR skills_offered LIKE %s", GetSQLValueString("%" . $var_SalaryReq_Recordset1 . "%", "text"),GetSQLValueString("%" . $var_skills_offered_Recordset1 . "%", "text"),GetSQLValueString("%" . $var_location_Recordset1 . "%", "text"),GetSQLValueString("%" . $var_PositionReq_Recordset1 . "%", "text"));
    $query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
    $Recordset1 = mysql_query($query_limit_Recordset1, $hostprop) or die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    if (isset($_GET['totalRows_Recordset1'])) {
      $totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
    } else {
      $all_Recordset1 = mysql_query($query_Recordset1);
      $totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
    $totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
    $queryString_Recordset1 = "";
    if (!empty($_SERVER['QUERY_STRING'])) {
      $params = explode("&", $_SERVER['QUERY_STRING']);
      $newParams = array();
      foreach ($params as $param) {
        if (stristr($param, "pageNum_Recordset1") == false &&
            stristr($param, "totalRows_Recordset1") == false) {
          array_push($newParams, $param);
      if (count($newParams) != 0) {
        $queryString_Recordset1 = "&" . htmlentities(implode("&", $newParams));
    $queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_Recordset1);
    the form is
                <input name="PositionReq" type="text" class="textfeilds" value="Job Title" size="32" />
                <input name="skills_offered" type="text" class="textfeilds" value="Skills Required" size="32" />
                <input name="SalaryReq" type="text" class="textfeilds" value="Salary Offered" size="32" />
                <input name="location" type="text" class="textfeilds" value="Location" size="32" />
    examples of search criteria are job title would be say police officer, location would be say london
    when using xxxx no results are being dispalyed

  • Mail - Search always returns All mail entries

    When I use the Search facility in Mail to try and find some specific mails I know I have amongst my many thousand of mails, i just can't get Search to return anything other than a full return of all items in the mailbox.
    I'm clearly being daft somehow, but can't figure it out.
    I enter single word into the search box in the top right, and it always just says 10,562 (or whatever the current number is) items, which makes no sense.  I'm using search words that should return a few hundred. I've even put in non existent words to prove the point - still get the same number 'returned'.
    Sort of sensing that no search is actually taking place, or there's some overriding criteria/setting hiding somewhere.
    Using current version of Yosemite including version 8.0 of Mail.
    What am I missing - anyone know?
    Cheers.

    I was able to solve all my problems with searching in Mail with a simple process. I backed up my entire machine with Time Machine, then booted from my OS X install / restore DVD. Then selected restore from time machine backup, it rewrote my entire hard drive with the backup from time machine and upon booting back up, Mail reindexed all messages and my computer was exactly how I left it before I backed it up.
    The problems I was having with mail included:
    Unable to search 'entire message'
    Unable to search 'entire message' when a specific inbox was selected
    Able to search messages from spotlight in the Finder, but then they would disappear.
    The spotlight index not being updated when new mail came in, making it unsearchable.
    Plus a slew of other search in Mail problems.
    Backing up and then doing a full restore from Time Machine solved all the problems.
    Hope this helps,
    Vince

  • URGENT Select Query Returning No Records take same time as that of insert

    Hello Everrybody,
    I am facing a wierd problem...
    I have table with 15 fields and I am selecting a record with some condition...
    for e.g
    select field1,field2,field3....... from tablea where field1=123
    Now I have index on field1
    When I do SQL Trace it show me time taken as
    00:00:00:60 in oracle 817 SQL PLUS
    and using
    oracle 92 sql plus it show as
    00:00:00:01 in oracle 817 SQL PLUS
    Now Query is what does this 60 denotes milliseconds or what in oracle 92 and in oracle 817 sql plus.....
    Also this query does not return any rows...
    When I run the SP that insert records in same table...That sp take about same time as that of select returning no rows......
    Why is ORACLE Taking so much time for that select ????
    Please help.....

    8i measures timings in 100th of a second but I believe that 9i measures stuff in 1000th of a second. However, from your output it looks like SQL*Plus trace is rounding up to the nearest centisecond.
    Time is a very poor way of judging performance when you're talking less than a second per operation. You'd be better off looking at CPU usage and IO activity.
    Anyway, here are some questions for you to research:
    (1) Is field1 a unique index?
    (2) How many rows does this table hold?
    (3) How fresh are the statistics on the table and the index?
    (4) What's the explain plan? What's the TKPROF output?
    (5) Are all of the above the same on both databases?
    Cheers, APC

  • Query returning more records ...

    Hi All,
    I am having a bit issues here. I have three tables and i am trying following query and it is returning 7 rows but I am expecting one row to return -
    >
    select distinct l.olic_id, b.obat_id, l.olic_key
    from op_licences l, op_batches b, op_licence_batches ba
    where BA.OBAT_ID = b.obat_id
    and l.olic_id = ba.olic_id
    and l.olic_key='HQ67138'
    >
    Getting the following result:
    >
    OLIC_ID OBAT_ID OLIC_KEY
    2     3        HQ67138
    2     1468     HQ67138
    2     1469     HQ67138
    2     1470     HQ67138
    2     1471     HQ67138
    2     1472     HQ67138
    2     1473     HQ67138
    7 rows returned in 0.14 seconds
    >
    I also have tried to use outer join and inner join but still does not work. Can any body tell me how can I get one record instead of 7?
    Thanks in advance,
    Regards,
    M Tajuddin

    i am trying following query and it is returning 7 rows but I am expecting one row to returnYou are getting seven different rows so clearly your query is not as selective as it ought to be. Which of those rows is the one you're expecting? Given that, you need to look at the source data and establish the additional criteria you need in order to filter out the other six rows. It looks like OBAT_ID is the troublesome part.
    Given that these are your tables and your business rules there is absolutely no chance that we will be able to solve this for you.
    Cheers, APC
    blog: http://radiofreetooting.blogspot.com

  • Search not returning all entries

    We destroyed our search nodes and cluster on the filesystem in one of our environments and have been working with support to get them back to life. We got the node to startup and we can now search for items without getting a "cant contact search server" error. But we are not seeing enough items in the results.
    We tried setting status to 4 in PTSEARCHSTATUS and PTCARDSTATUS and then running a search repair and search update. After doing this, the cards (documents) can be found but only some of the objects such as the portlets are being returned. The search update flipped the status column to a 1 on some items but not all. Communities and community pages are not showing up but portlets are.
    Any ideas?

    Its working now.
    It turns out that the magic number for the PTSEARCHSTATUS table's status column is 1. PTCARDSTATUS takes a 4.
    After setting this and running search update (no repair needed) all admin objects were reindexed.

  • Parameter in select to returns all records.

    Post Author: ComputerMike
    CA Forum: Crystal Reports
    Hi,
    I have a "project" parameter I use in my select formula to return records based the project field.  I would like to pass a value like "All" or "*" and have all reords returned, to see the records for all the projects.  If I pass in "3" I would just get records for project 3.  "All" would give me all the projects.
    Thanks,
    Mike

    Post Author: GraemeG
    CA Forum: Crystal Reports
    Modify your selection formula to something like:
    (if {?project} <> "ALL" then   {table.project} = {?project}else   1 = 1)
    You have to specify an 'else' and the above is a cheat that makes sure everything is selected if 'ALL'  is entered. A suggestion - make 'ALL' your parameter default.

  • Search page displaying all records after create

    Hi,
    I have created the search and the create page using the help of tutorial example. I have run into a 2 problems.
    1. After I create the a transaction and click on apply button it directs me to the search page and diaplays all the records in the table. Instead I was looking to display only the record that I created in the create page.
    I tried to change the parameter of the "pageContext.forwardImmediately" to "false" for retainAM, it is working fine, but at the same time it is not displaying the confirmation message that it ised to display.
    2. Is there a spellchecker that I could add to my page for 3 columns that are of "CLOB" type. Any advise.
    Thanks,
    Ali

    Hi Shiv,
    I have added this in the processformrequest method. I do not know how and where to add it in the processrequest methos. Can you please guide me through it. I am pasting my CO file.
    Thanks in advance for all your help.
    Ali
    package saf.oracle.apps.saf.jobperf.server.webui;
    import oracle.apps.fnd.common.VersionInfo;
    import oracle.apps.fnd.framework.webui.OAControllerImpl;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    import oracle.apps.fnd.framework.OAApplicationModule;
    import oracle.apps.fnd.framework.webui.OADialogPage;
    import oracle.apps.fnd.framework.webui.TransactionUnitHelper;
    import oracle.jbo.domain.Number;
    import oracle.apps.fnd.common.MessageToken;
    import oracle.apps.fnd.framework.OAApplicationModule;
    import oracle.apps.fnd.framework.OAException;
    import oracle.apps.fnd.framework.OAViewObject;
    import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
    import com.sun.java.util.collections.HashMap;
    import oracle.bali.share.util.IntegerUtils;
    * Controller for ...
    public class ReviewCreateCO extends OAControllerImpl
    public static final String RCS_ID="$Header$";
    public static final boolean RCS_ID_RECORDED =
    VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
    * Layout and page setup logic for a region.
    * @param pageContext the current OA page context
    * @param webBean the web bean corresponding to the region
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    // Always call this first
    super.processRequest(pageContext, webBean);
    // If isBackNavigationFired = false, we are here after a valid navigation
    // (the user selected the Create Review button) and we should proceed
    // normally and initialize a new Review.
    if (!pageContext.isBackNavigationFired(false))
    // We indicate that we are starting the create transaction(this
    // is used to ensure correct Back button behavior).
    TransactionUnitHelper.startTransactionUnit(pageContext,"jobperfCreateTxn");
    // This test ensures that we don't try to create a new review if we
    // had a JVM failover, or if a recycled application module is activated
    // after passivation. If this things happen, BC4J will be able to find
    // the row you created so the user can resume work.
    if (!pageContext.isFormSubmission())
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    am.invokeMethod("createReview",null);
    // Initialize the ApplicationpropertiesVO for PPR.
    // am.invokeMethod("init");
    else
    if (!TransactionUnitHelper.isTransactionUnitInProgress(pageContext,"jobperfCreateTxn", true))
    // We got here through some use of the browser "Back" button, so we
    // want to display a stale data error and disallow access to the page.
    // if this were a real application, we would propably display a more
    // context-specific message telling the user she can't use the browser
    //"Back" button and the "Create" page. Instead, we wanted to illustrate
    // how to display the Applications standard NAVIGATION ERROR message.
    OADialogPage dialogPage = new OADialogPage(NAVIGATION_ERROR);
    pageContext.redirectToDialogPage(dialogPage);
    } // end processRequest()
    * Procedure to handle form submissions for form elements in
    * a region.
    * @param pageContext the current OA page context
    * @param webBean the web bean corresponding to the region
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    {    //super.processFormRequest(pageContext, webBean);
    // Always call this first.
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    // Pressing the "Apply" button means the transaction should be validated
    // and committed.
    if (pageContext.getParameter("Apply") != null)
    // Generally in the tutorial application and the labs, we've illustrated
    // all BC4J interaction on the server (except for the AMs, of course). Here,
    // we're dealing with the VO directly so the comments about the reasons
    // why we're obtaining values from the VO and not the request make sense
    // in context.
    OAViewObject vo = (OAViewObject)am.findViewObject("jobperfVO1");
    // Note that we have to get this value from the VO because the EO will
    // assemble it during its validation cycle.
    // For performance reasons, we should generally be calling getEmployeeName()
    // on the EmployeeFullVORowImpl object, but we don't want to do this
    // on the client so we're illustrating the interface-appropriate call. If
    // we implemented this code in the AM where it belongs, we would use the
    // other approach.
    String employeeName = (String)vo.getCurrentRow().getAttribute("FullName");
    // We need to get a String so we can pass it to the MessageToken array below. Note
    // that we are getting this value from the VO (we could also get it from.
    // the Bean as shown in the Drilldwon to Details lab) because the item style is messageStyledText,
    // so the value isn't put on the request like a messaqeTextInput value is.
    String employeeNumber = (String)vo.getCurrentRow().getAttribute("EmployeeNumber");
    //ma String employeeNum = String.valueOf(employeeNumber.intValue());
    //ma Number employeeNumber = (Number)vo.getCurrentRow().getAttribute("EmployeeNumber");
    //ma String employeeNum = String.valueOf(employeeNumber.intValue());
    // Simply telling the transaction to commit will cause all the Entity Object validation
    // to fire.
    // Note: there's no reason for a developer to perform a rollback. This is handled by
    // the framework if errors are encountered.
    am.invokeMethod("apply");
    // Indicate that the Create transaction is complete.
    TransactionUnitHelper.endTransactionUnit(pageContext, "jobperfCreateTxn");
    // Assuming the "commit" succeeds, navigate back to the "Search" page with
    // the user's search criteria intact and display a "Confirmation" message
    // at the top of the page.
    MessageToken[] tokens = { new MessageToken("EMP_NAME", employeeName),
    new MessageToken("EMP_NUMBER", employeeNumber) };
    OAException confirmMessage = new OAException("PER", "LAC_FWK_TBX_T_EMP_CREATE_CONF", tokens,
    OAException.CONFIRMATION, null);
    // Per the UI guidelines, we want to add the confirmation message at the
    // top of the search/results page and we want the old search criteria and
    // results to display.
    pageContext.putDialogMessage(confirmMessage);
    HashMap params = new HashMap(1);
    // Replace the current employeeNumber request parameter value with "X"
    params.put("employeeNumber", "employeeNumber");
    // IntegerUtils is a handy utility
    params.put("employeeNumber",IntegerUtils.getInteger(5));
    pageContext.forwardImmediately(
    "OA.jsp?page=/saf/oracle/apps/saf/jobperf/webui/jobperfPG",
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    params, //null,
    true, // retain AM
    OAWebBeanConstants.ADD_BREAD_CRUMB_YES);
    else if (pageContext.getParameter("Cancel") != null)
    am.invokeMethod("rollbackReview");
    // Indicate that the Create transaction is complete.
    TransactionUnitHelper.endTransactionUnit(pageContext, "jobperfCreateTxn");
    pageContext.forwardImmediately("OA.jsp?page=/saf/oracle/apps/saf/jobperf/webui/jobperfPG",
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    null,
    false, // retain AM
    OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
    } // end processFormRequest()
    }

  • SAP query returning duplicate records

    Hi all,
    I'll try to elaborate as much as possible so here goes:
    I have a query that I am trying to run in SAP B1 8.8 which is not returning the true set of results I am expecting.
    Essentially I am trying to filter by product based on delivery notes. I have the query as follows -
    SELECT count(*), sum(T0.[DocTotal]-T0.[VatSum]) as "Order Value"
    FROM ODLN T0  INNER JOIN OCRD T1 ON T0.CardCode = T1.CardCode
    WHERE DateName(mm,T0.DocDate) = 'November'
    and DateName(yyyy,T0.DocDate) = '2011'
    and (T1.[GroupCode] = '102' or T1.[GroupCode] = '107')
    This returns the correct result of 1320 row numbers and the given sum.
    When I try to break this query down further by product using the query below, the values are doubled, tripled, quadrupled etc and summed up to give a number that is extremely high.
    The code is as follows:
    SELECT distinct count (*), sum(distinct T0.[DocTotal]-T0.[VatSum]) as "Order Value" from DLN1 T1
    inner join ODLN T0 on T0.DocEntry = T1.DocEntry
    Inner join OITM T2 on T2.ItemCode = T1.ItemCode
    inner join OCRD T3 on T0.CardCode = T3.CardCode
    WHERE DateName(mm,T0.DocDate) = 'November'
    and DateName(yyyy,T0.DocDate) = '2011'
    and (T3.[GroupCode] = '102' or T3.[GroupCode] = '107')
    and (T2.[ItmsGrpCod] = '108' or T2.[ItmsGrpCod] = '112' or T2.[ItmsGrpCod] = '115')
    This also returns 1819 rows where there should be less based on the product.
    Please let me know if I am not explaining myself well or need further clarification.
    Thanks!

    hi,
    try to run this code from your SQL management studio
    SELECT     SUM(T0.DocTotal - T0.VatSum) AS [Order Value], T0.DocTotal - T0.VatSum AS [Order Value], T0.DocNum, T0.DocDate, T0.CardCode, T0.CardName, T0.DocTotal,
                          T1.ItemCode, T1.Dscription, T1.Quantity, T2.GroupCode, T3.ItmsGrpCod
    FROM         ODLN AS T0 INNER JOIN
                          DLN1 AS T1 ON T0.DocEntry = T1.DocEntry INNER JOIN
                          OCRD AS T2 ON T0.CardCode = T2.CardCode INNER JOIN
                          OITM AS T3 ON T1.ItemCode = T3.ItemCode
    GROUP BY T0.DocTotal - T0.VatSum, T0.DocNum, T0.DocDate, T0.CardCode, T0.CardName, T0.DocTotal, T1.ItemCode, T1.Dscription, T1.Quantity, T2.GroupCode,
                          T3.ItmsGrpCod
    HAVING      (T2.GroupCode = 102 OR
                          T2.GroupCode = 107) AND (T3.ItmsGrpCod = 108 OR
                          T3.ItmsGrpCod = 112 OR
                          T3.ItmsGrpCod = 115) AND (T0.DocDate BETWEEN CONVERT(DATETIME, '2011-11-01 00:00:00', 102) AND CONVERT(DATETIME, '2011-11-17 00:00:00', 102))
    regards,
    Fidel

Maybe you are looking for