Stuck with search query

I am trying to search the whole record if any of the word matches with existing data in the rows of columns.
First I was trying the following code:
SQL> select prod from prod where prod like '%chromium ore%'
  2  /
PROD
chromium ore andconcentrates, ferro-chrome, silico-chrome
chromium ore andconcentrates, ferro-chrome, silica-chrome, metal
chromium ore andconcentrates, ferro-chrome, silica-chrome
chromium ore andconcentrates, ferro-chrome, silico-chrome
chromium ore andconcentrates, ferro-chrome, silico-chrome, metal
chromium ore andconcentrates, ferro-chrome, silico-chrome
6 rows selected.
SQL> select prod from prod where prod like '%what is chromium ore%';
no rows selected
SQL> select count(unique(co_id)) from prod where (prod like upper('%ferro%') or prod like lower('%ferro%') or prod like initcap('%ferro%'));
COUNT(UNIQUE(CO_ID))
                3153
SQL> select count(unique(co_id)) from prod where (prod like upper('%What is ferro') or prod like lower('%What is ferro') or prod like initcap('%What is ferro'));
COUNT(UNIQUE(CO_ID))
                0
SQL> select count(unique(co_id)) from prod where (prod like upper('%What is ferro%') or prod like lower('%What is ferro%') or prod like initcap('%What is ferro%'));
COUNT(UNIQUE(CO_ID))
                0
Then I advised to try "Oracle Text". I did the following steps
create user test identified by test;
grant connect, resource, dba, ctxapp to test;
SQL> GRANT ctxapp, dba TO test;
Grant succeeded.
SQL> GRANT EXECUTE ON CTX_CLS TO test;
Grant succeeded.
SQL> GRANT EXECUTE ON CTX_DDL TO test;
Grant succeeded.
SQL> GRANT EXECUTE ON CTX_DOC TO test;
Grant succeeded.
SQL> GRANT EXECUTE ON CTX_OUTPUT TO test;
Grant succeeded.
SQL> GRANT EXECUTE ON CTX_QUERY TO test;
Grant succeeded.
SQL> GRANT EXECUTE ON CTX_REPORT TO test;
Grant succeeded.
SQL> GRANT EXECUTE ON CTX_THES TO test;
Grant succeeded.
SQL> connect test/test
Connected.
SQL> CREATE TABLE test (id NUMBER PRIMARY KEY, text VARCHAR2(200));
Table created.
SQL>
SQL> INSERT INTO test VALUES(1, '<HTML>California is a state in the US.</HTML>');
1 row created.
SQL> INSERT INTO test VALUES(2, '<HTML>Paris is a city in France.</HTML>');
1 row created.
SQL> INSERT INTO test VALUES(3, '<HTML>France is in Europe.</HTML>');
1 row created.
SQL>
SQL> CREATE INDEX idx_test ON test(text)
  2       INDEXTYPE IS CTXSYS.CONTEXT PARAMETERS
  3       ('FILTER CTXSYS.NULL_FILTER SECTION GROUP CTXSYS.HTML_SECTION_GROUP');
Index created.
SQL>  SELECT SCORE(1), id, text FROM test WHERE CONTAINS(text, 'paris', 1) > 0;
  SCORE(1)         ID TEXT
         4          2 <HTML>Paris is a city in France.</HTML>
SQL> SELECT SCORE(1), id, text FROM test WHERE CONTAINS(text, 'Where is Paris', 1) > 0;
no rows selected
SQL> select text  from test where (upper(text) like '%where is paris%' or lower(text) like '%where is paris%' or initcap(text) like '%where is paris%');
no rows selected Still I stuck with searching technique. Please help me
Thanks & best regards

Hi,
Whenever you have a question, it helps to post:
(1) The version of Oracle (and any other relevant software) you're using
(2) A little sample data (just enough to show what the problem is) from all the relevant tables
(3) The results you want from that data
(4) Your best attempt so far (formatted)
Executable SQL statements (like "CREATE TABLE AS ..." or "INSERT ..." statements) are best for (2).
If you can present your problem using commonly available tables (for example, tables in scott schema, or views in the data dictionary), then you can omit (2).
Formatted tabular output is okay for (3).
This does what you requested in Oracle 10 (and up):
SELECT  prod
FROM     prod
WHERE     REGEXP_LIKE ( ' ' || prod || ' '
              , '([^[:alnum:]]'
                || REPLACE ( 'what is chromium ore'
                     , '[^[:alnum:]])|([^[:alnum:]]'
                || '[^[:alnum:]])'
             );If the string containing all the target words ('what is chromium ore' in the example above) contains some special characters (such as '.' or '*') the results might not be what you expect.

Similar Messages

  • Stuck with this query

    i have stuck in this query. it is giving compile error that v_customerloop invalid identifier. this does not make sense because if i comment the sql, it runs fine and i can actually see the count in the dbms output. i tried commenting out some of the where clauses but cannot pinpoint where i am making a mistake.
    can some one see if i am doing something out of ordinary.
    declare
      -- Local variables here
    o_errorcode     NUMBER;
           o_errortext     VARCHAR2(1000);
    o_LoopId      NUMBER;
    i_CustomerLoop      Kroner.Pkgsldcommon.T_CUSTOMERLOOPTYPE;
    To_CustomerLoop Kroner.Pkgsldcommon.T_CUSTOMERLOOPTYPE;
      v_sql        VARCHAR2(3000);
    v_CustomerLoop Kroner.t_CustomerLoopElement := Kroner.t_CustomerLoopElement();
    begin
        i_CustomerLoop(1).Cable := '138-2';
      i_CustomerLoop(1).coup := '501';
      i_CustomerLoop(1).TermSysID := 1178050;
      i_CustomerLoop(1).CentralOfficeName := 'TOROON45';
         i_CustomerLoop(2).Cable := '138-2';
      i_CustomerLoop(2).coup := '503';
      i_CustomerLoop(2).TermSysID := 1178052;
      i_CustomerLoop(2).CentralOfficeName := 'TOROON45';
       FOR i IN 1..i_CustomerLoop.COUNT -- Create a instance of Kroner.o_CustomerLoopElement
       LOOP 
               v_CustomerLoop.Extend();
               v_CustomerLoop(i) := Kroner.o_CustomerLoopElement(co_clli => i_CustomerLoop(i).CentralOfficeName,
                                                cable => i_CustomerLoop(i).Cable,
                                                coup => i_CustomerLoop(i).coup,
                                                termsysid => i_CustomerLoop(i).TermSysID,
                                                landing_number => i
       END LOOP;
       dbms_output.put_line('v_CustomerLoop length' || v_CustomerLoop.Count);
    v_sql:= 'select loop_f1.loopid
                 from nrms_interface.wdn_landing seg_f1, nrms_interface.wdn_loop_landing_association assoc_f1, nrms_interface.wdn_potential_loop_makeup loop_f1,
                 nrms_interface.wdn_landing seg_fx, nrms_interface.wdn_loop_landing_association assoc_fx,
                 table(cast( v_CustomerLoop as Kroner.t_CustomerLoopElement)) input_loop
            where loop_f1.CO_CLLI =  v_CustomerLoop(1).co_clli
            and loop_f1.LOOPID = assoc_f1.LOOPID
            and assoc_f1.landing_NUMBER = v_CustomerLoop(1).landing_number
            and assoc_f1.landing_ID = seg_f1.landing_ID
            and seg_f1.CABLE = v_CustomerLoop(1).cable
            and (seg_f1.low_coup <= v_CustomerLoop(1).coup and seg_f1.high_coup >= v_CustomerLoop(1).coup)
            and seg_f1.TERMSYSID = v_CustomerLoop(1).termsysid
            and assoc_f1.landing_number = 1
            and loop_f1.loopid = assoc_fx.loopid
            and assoc_fx.landing_ID = seg_fx.landing_id
            and assoc_fx.landing_number = input_loop.landing_number
            and seg_fx.CABLE = input_loop.cable
            and (seg_fx.low_coup <= input_loop.coup and seg_fx.high_coup >= input_loop.coup)
            and seg_fx.termsysid = input_loop.termsysid
            group by loop_f1.loopid
            having max(assoc_fx.landing_NUMBER) = :noOflandings
            and count(case when assoc_fx.landing_number = input_loop.landing_number then 1 else 0 end) = :noOflandings';
    EXECUTE IMMEDIATE v_sql  INTO o_LoopId
    USING  v_CustomerLoop.count,v_CustomerLoop.count;

    Hi,
    I don't know much about object types, but I think that the error is due to the usage of v_CustomerLoop variable in a different context.
    Imagine that using the EXECUTE IMMEDIATE you spawn a different process that communicates with the caller using prameters (USING) and return values (INTO).
    In this case, the variable is not visible by the new environement (it is not the same behaviour of nesting a BEGIN/END block in a procedure and referencing a parent variable)
    Hope this helps
    Max

  • Reduce the size of Input box comingby  default with search query

    Hi,
    I have created one EO and VO and one jsp for that . Inside that VO , there is one option Named Criteria, which is having All Queriable Attributes option , on drag and drop of this option i have got default search page for all the attributes which i had in my form , But with every dropdown am getting one input box to specify the value of my search, i want to reduce the size of that input box . there is no code in the jsp for those attributes.
    Please help
    Regards
    shadab

    Filed bug# 6501297 to track this issue. Thanks for reporting it.
    For now you'll need to manually add an additional facet to the content of the query component's "valueStamp" facet with the id of the same name as the attribute and manually set the properties on an <af:inputText> to the desired width.
    Between Tech Preview 2 and production the Query form component is being simplified to be more metadata driven, so this temporary workaround is applicable only to the TP2 release.

  • Send an alert with search query word if nothing return on search result??

    Hi All,
    is it possible to send an alerts to specific person, when end-users will not find any results on specific query? i know sharepoint has Search alerts, but i am looking to send an alert, if they dont find anything in search results.
    Thanks in advanced!

    Not possible out-of-the-box.
    There are search usage reports for reviewing and optimizing the results... but nothing like what you're asking for... Nor do I think such a feature would ever be added... too much potential for misuse (no results found for "JaneDoe should be fired") or overwhelming
    amounts of useless information (2000 emails indicating that "NotARealWord" returned no results).
    As a developer, it is POSSIBLE with custom development... but I'd still advise against it.
    Scott Brickey
    MCTS, MCPD, MCITP
    www.sbrickey.com
    Strategic Data Systems - for all your SharePoint needs

  • Transformation in combination with a search query

    Using DPS 6.3 I have merged an Active Directory and Domino Directory. This all seems to work fine. The only issue I still have is that for some reason the transformations are not applied when performing a search query. An example: In AD groups can be found by performing a search for the objectclass "group". In Domino the objectclass is called "dominoGroup". To make the objectclasses match I made a transformation that removes "domino" from the Domino objectclass. I expected that searching for the objectclass "group" would now result in both groups from AD and Domino. But this is not the case.
    Is there a solution for this?

    Sorry for the late response, but I have not been able to work on this issue for the last few weeks. But I appreciate when you can have a look. It's the first time I have ever worked with DPS. The space was insufficient to post the complete conf.ldif file. I have now taken out my configuration. When you need something else just let me know.
    dn: cn=DSP_DOMINO,cn=datasource pools
    cn: DSP_DOMINO
    dn: cn=DS_DOMINO,cn=DSP_DOMINO,cn=datasource pools
    ldapServer: cn=DS_DOMINO,cn=data sources
    cn: DS_DOMINO
    dn: cn=DSP_AD,cn=datasource pools
    cn: DSP_AD
    dn: cn=DS_AD,cn=DSP_AD,cn=datasource pools
    ldapServer: cn=DS_AD,cn=data sources
    cn: DS_AD
    dn: cn=DS_AD,cn=data sources
    clientCredentialsForwarding: noForwarding
    cn: DS_AD
    useTCPNoDelay: true
    enabled: true
    useV1ProxiedAuthControl: false
    readOnly: true
    dn: cn=DS_DOMINO,cn=data sources
    clientCredentialsForwarding: noForwarding
    cn: DS_DOMINO
    useTCPNoDelay: true
    enabled: true
    useV1ProxiedAuthControl: false
    readOnly: false
    dn: cn=root data view, cn=Data Views
    cn: root data view
    viewBase: ""
    dataSourcePool: defaultDataSourcePool
    viewExclusionBase: cn=proxy manager
    viewExclusionBase: dc=interaccess,dc=nl
    viewExclusionBase: ""
    enabled: true
    dn: cn=DV_INTERACCESS,cn=data views
    readOnly: true
    dataSourcePool: DSP_AD
    viewBase: dc=interaccess,dc=nl
    description: Inter Access - AD
    cn: DV_INTERACCESS
    viewExclusionBase: ou=domino,ou=inter access,dc=interaccess,dc=nl
    viewAlternateSearchBase: ""
    viewAlternateSearchBase: dc=nl
    dn: cn=DV_DOMINO,cn=data views
    readOnly: false
    dataSourcePool: DSP_DOMINO
    viewBase: ou=domino,ou=inter access,dc=interaccess,dc=nl
    cn: DV_DOMINO
    attributeMapping: streetaddress#officestreetaddress
    attributeMapping: assistant#secretary
    attributeMapping: company#companyname
    DNSyntaxAttribute: distinguishedname
    DNSyntaxAttribute: dominoaccessgroups
    DNSyntaxAttribute: creatorsname
    DNSyntaxAttribute: member
    DNSyntaxAttribute: modifiersname
    DNSyntaxAttribute: secretary
    dataSourceBase: o=hpwibm
    attributeRule: DV_DOMINO_mapping_add-attr_otherMobile
    attributeRule: DV_DOMINO_mapping_add-attr_distinguishedName
    attributeRule: DV_DOMINO_read_add-attr_displayName
    attributeRule: DV_DOMINO_read_attr-value-mapping_displayname
    attributeRule: DV_DOMINO_read_remove-attr-value_objectclass
    attributeRule: DV_DOMINO_mapping_attr-value-mapping_objectclass
    attributeRule: DV_DOMINO_read_attr-value-mapping_objectclass
    attributeRule: DV_DOMINO_mapping_remove-attr-value_objectclass
    viewAlternateSearchBase: dc=interaccess,dc=nl
    viewAlternateSearchBase: ou=inter access,dc=interaccess,dc=nl
    viewAlternateSearchBase: ""
    viewAlternateSearchBase: dc=nl
    dn: cn=DV_DOMINO_mapping_add-attr_otherMobile,cn=attribute rules
    model: mapping
    viewAttributeValue: ${mobile}
    attributeName: otherMobile
    transformation: add
    cn: DV_DOMINO_mapping_add-attr_otherMobile
    dn: cn=DV_DOMINO_mapping_add-attr_distinguishedName,cn=attribute rules
    model: mapping
    viewAttributeValue: ${dn}
    attributeName: distinguishedName
    transformation: add
    cn: DV_DOMINO_mapping_add-attr_distinguishedName
    dn: cn=DV_DOMINO_read_add-attr_displayName,cn=attribute rules
    model: virtual
    viewAttributeValue: \${cn}
    attributeName: displayName
    transformation: add
    cn: DV_DOMINO_read_add-attr_displayName
    dn: cn=DV_DOMINO_read_attr-value-mapping_displayname,cn=attribute rules
    model: virtual
    viewAttributeValue: ${cn}
    attributeName: displayname
    transformation: replace value
    internalAttributeValue: ${displayName}
    cn: DV_DOMINO_read_attr-value-mapping_displayname
    dn: cn=DV_DOMINO_read_remove-attr-value_objectclass,cn=attribute rules
    model: virtual
    attributeName: objectclass
    transformation: delete value
    internalAttributeValue: inetOrgPerson
    cn: DV_DOMINO_read_remove-attr-value_objectclass
    dn: cn=DV_DOMINO_mapping_attr-value-mapping_objectclass,cn=attribute rules
    model: mapping
    viewAttributeValue: user
    attributeName: objectclass
    transformation: replace value
    internalAttributeValue: dominoPerson
    cn: DV_DOMINO_mapping_attr-value-mapping_objectclass
    dn: cn=DV_DOMINO_read_attr-value-mapping_objectclass,cn=attribute rules
    model: mapping
    viewAttributeValue: group
    attributeName: objectclass
    transformation: replace value
    internalAttributeValue: dominoGroup
    cn: DV_DOMINO_read_attr-value-mapping_objectclass
    dn: cn=DV_DOMINO_mapping_remove-attr-value_objectclass,cn=attribute rules
    model: virtual
    attributeName: objectclass
    transformation: delete value
    internalAttributeValue: groupofnames
    cn: DV_DOMINO_mapping_remove-attr-value_objectclass
    dn: cn=CHND_INTERACCESS,cn=connection handlers
    dataViewPolicy: DATA_VIEW_LIST
    useDataViewAffinity: false
    enabled: true
    cn: CHND_INTERACCESS
    sslCriteria: false
    dataViewList: DV_INTERACCESS
    dataViewList: DV_DOMINO
    dn: cn=PL_REFERRALS,cn=policies
    searchMaxSizeLimit: -1
    searchFilterMinSubstring: -1
    cn: PL_REFERRALS
    referralPolicy: forward

  • Error during search !!! Associate Search Query with Indexes !!!

    We are trying to implement a simple index with Trex Search .
    We have done the following tasks :
    1. Created my index
    2. Assigned data to the the indexes
    3. Created taxonomies for classification indexes
    4. Created my search query  asociated to the index
    When we  try to search with the iview search , we got this error  :  <i><b>"Error during search occurred - com.sapportals.wcm.WcmException: A received argument has an invalid value (Errorcode 18)"</b></i> .
    We think that something is missing and for that we need to know how can we
    associate the search query with the index ?
    After the step 4), what we have to do in order to get this implementation (search working)
    Please send us  any ideas ..
    THANKS !!!

    Dear Ato
    Check in IMG Path - Enterprise Structure --> Assignment --> Logistis Execution --> Assign warehouse number to plant/storage location.
    Here check whether the warehouse number is assigned to your plant and storage location.
    thanks
    G. Lakshmipathi

  • Problem with select query in search

    Hi,
    Here i am using MYSQL database and when i am insertind date to database it is saving like  '2009-11-10 00:00:00'  and when i used to dispaly this in dateformat as '11/10/2009' .
    here is the problem occurs , when i write a search query as
    select recruitername,interviewdate ,skillset
                 from details
                  where interviewdate = #form.interviewdate#
    i am getting problem with date . would u please help me how to solve this issue .

    Try to use DateFormat
    select recruitername,interviewdate ,skillset
                 from details
                  where interviewdate = #DateFormat(form.interviewdate, "yyyy-dd-mm")#

  • Help with Search Result Query Builder (CSWP)

    Greetings,
    Is there a way to limit the number of search results returned based on each property value?  Hard to phrase my question, so I'll give my example.
    I have a Content Search Web Part that is returning results from a specific list that has a column called Category with 6 options (ex, A, B, C, D, E, F).  I want my query to return the newest 4 items by date that are tagged from each category value.
     So, latest 4 items tagged with A, latest 4 tagged with B, etc.  My CSWP would return 24 items from the query.
    Hope that makes sense.  So, is this possible through the Search query?
    Thanks!
    -B

    Hi Brian,
    Per my knowledge, it is impossible to do via Search Query in Content Search web part.
    As a workaround, you can add a Refinement Web part into the page, then click the refiner to filter each options to display the latest associated four items.
    You can do as the steps(assuming I create a list with a column called “testCategory”, like your Category column ):
    Do a full crawl for the content source.
    Create a managed property called “testCategory” to map it to the crawled property
    ows_ testCategory.
    Then do a crawl again for the content source.
    Go to a page, add a Refinement web part and a Content Search web part into the page.
    Edit the Refinement web part->Choose Refiners, add testCategory under
    Available refiners into Selected refiners.
    Remove other refiners except testCategory, click OK and OK.
    Edit the Content Search web part->Change query.
    Select a query: Local SharePoint Results, and the Query text is : Path:<the URL of the list>
    Click SORTING tab, and Sort by: LastModifiedTime(Descending), click OK.
    Under Change query, Number of items to show: 4.
    Click OK, and save the page.
    The result is like:
    After Clicking A, we can see the latest 4 items related to A:
    Best Regards,
    Wendy
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Wendy Li
    TechNet Community Support

  • SP2013 Search - Query documents only in a library with a specific property bag value

    Hi,
    I am hoping someone might be able to help me as I am struggling to figure out how to get the following scenario to work using query variables. 
    I have configured a property bag value against document libraries and made it indexable and turned it into a managed property. I have checked to ensure i can search specifically against this managed property and it works correctly and returns document libraries
    which have a  property bag key with a value that I specify in a search query e.g. classification:internal.
    I have also configured a managed property for a piece of metadata i collect against every document e.g. colour. I can successfully search against this manged property and return documents whereby colour is equal to red e.g. colour:red
    What I would like to do is take this one step further and say search across only libraries where the property bag value equals internal and return documents within those libraries which have a metadata value of something e.g. colour = red.
    Does anyone have any suggestions on how i can achieve this.
    Thanks in advance
    Mark

    That or in some way get the container metadata to be present in the item itself as well.
    Thanks,
    Mikael Svenson - Search Enthusiast
    SharePoint MVP/MCPD/P-TSP - If you find an answer useful, please up-vote it.
    http://techmikael.blogspot.com/
    Author of
    SharePoint Search Queries Explained and
    Working with FAST Search Server 2010 for SharePoint

  • Stuck with query on dba_tab_partitions because of long .

    Hi,
    I'm trying to dynamically generate split partition sql but stuck with error ORA-00932: inconsistent datatypes: expected NUMBER got LONG.
    Here is my code.
    select 'alter table ' || table_owner || '.' || table_name || ' split partition P_MAX at ' || high_value
    from (
    select rownum rnum, t.* from (
        select t.* from dba_tab_partitions t where t.table_owner = 'TEK' and t.table_name = 'TAB' order by t.partition_position desc
                    ) t 
    where rnum between 2 and 5 and (num_rows != 0 or empty_blocks != 16383);Basically I'm trying to generate new partition with high_value = high_value + 3000 .
    That long is really annoying .
    My DB is 9.2.0.8 .
    Regards.
    Greg

    Not sure if this is the best way, but I think it'll work:
    create a dummy table that holds the data of dba_tab_partitions but using to_lob(high_value) as high_value.
    then issue your select from this dummy table using to_number(high_value)
    Hope this helps.

  • Loop with WMI Query taking too long, need to break out if time exceeds 5 min

    I've written a script that will loop through a list of computers and run a WMI query using the Win32_Product class. I am pinging the host first to ensure its online which eliminates wasting time but the issue I'm facing is that some of the machines
    are online but the WMI Query takes too long and holds up the script. I wanted to add a timeout to the WMI query so if a particular host will not respond to the query or gets stuck the loop will break out an go to the next computer object. I've added my code
    below:
    $Computers = @()
    $computers += "BES10-BH"
    $computers += "AUTSUP-VSUS"
    $computers += "AppClus06-BH"
    $computers += "Aut01-BH"
    $computers += "AutLH-VSUS"
    $computers += "AW-MGMT01-VSUS"
    $computers += "BAMBOOAGT-VSUS"
    ## Loop through all computer objects found in $Computes Array
    $JavaInfo = @()
    FOREACH($Client in $Computers)
    ## Gather WMI installed Software info from each client queried
    Clear-Host
    Write-Host "Querying: $Client" -foregroundcolor "yellow"
    $HostCount++
    $Online = (test-connection -ComputerName ADRAP-VSUS -Count 1 -Quiet)
    IF($Online -eq "True")
    $ColItem = Get-WmiObject -Class Win32_Product -ComputerName $Client -ErrorAction SilentlyContinue | `
    Where {(($_.name -match "Java") -and (!($_.name -match "Auto|Visual")))} | `
    Select-Object Name,Version
    FOREACH($Item in $ColItem)
    ## Write Host Name as variable
    $HostNm = ($Client).ToUpper()
    ## Query Named Version of Java, if Java is not installed fill variable as "No Java Installed
    $JavaVerName = $Item.name
    IF([string]::IsNullOrEmpty($JavaVerName))
    {$JavaVerName = "No Installed"}
    ## Query Version of Java, if Java is not installed fill variable as "No Java Installed
    $JavaVer = $Item.Version
    IF([string]::IsNullOrEmpty($JavaVer))
    {$JavaVer = "Not Installed"}
    ## Create new object to organize Host,JavaName & Version
    $JavaProp = New-Object -TypeName PSObject -Property @{
    "HostName" = $HostNm
    "JavaVerName" = $JavaVerName
    "JavaVer" = $JavaVer
    ## Add new object data "JavaProp" from loop into array "JavaInfo"
    $JavaInfo += $JavaProp
    Else
    {Write-Host "$Client didn't respond, Skipping..." -foregroundcolor "Red"}

    Let me give you a bigger picture of the script. I've included the emailed table the script produces and the actual script. While running the script certain hosts get hung up when running the WMI query which causes the script to never complete. From one of
    the posts I was able to use the Get-WmiCustom function to add a timeout 0f 15 seconds and then the script will continue if it is stuck. The problem is when a host is skipped I am not aware of it because my script is not reporting the server that timed out.
    If you look at ZLBH02-VSUS highlighted in the report you can see that its reporting not installed when it should say something to the effect query hung.
    How can I add a variable in the function that will be available outside the function that I can key off of to differentiate between a host that does not have the software installed and one that failed to query?
    Script Output:
    Script:
    ## Name: JavaReportWMI.ps1 ##
    ## Requires: Power Shell 2.0 ##
    ## Created: January 06, 2015 ##
    <##> $Version = "Script Version: 1.0" <##>
    <##> $LastUpdate = "Updated: January 06, 2015" <##>
    ## Configure Compliant Java Versions Below ##
    <##> $java6 = "6.0.430" <##>
    <##> $javaSEDEVKit6 = "1.6.0.430" <##>
    <##> $java7 = "7.0.710" <##>
    <##> $javaSEDEVKit7 = "1.7.0.710" <##>
    <##> $java8 = "8.0.250" <##>
    <##> $javaSEDDEVKit8 = "1.8.0.250" <##>
    ## Import Active Directory Module
    Import-Module ActiveDirectory
    $Timeout = "False"
    Function Get-WmiCustom([string]$computername,[string]$namespace,[string]$class,[int]$timeout=15)
    $ConnectionOptions = new-object System.Management.ConnectionOptions
    $EnumerationOptions = new-object System.Management.EnumerationOptions
    $timeoutseconds = new-timespan -seconds $timeout
    $EnumerationOptions.set_timeout($timeoutseconds)
    $assembledpath = "\\" + $computername + "\" + $namespace
    #write-host $assembledpath -foregroundcolor yellow
    $Scope = new-object System.Management.ManagementScope $assembledpath, $ConnectionOptions
    $Scope.Connect()
    $querystring = "SELECT * FROM " + $class
    #write-host $querystring
    $query = new-object System.Management.ObjectQuery $querystring
    $searcher = new-object System.Management.ManagementObjectSearcher
    $searcher.set_options($EnumerationOptions)
    $searcher.Query = $querystring
    $searcher.Scope = $Scope
    trap { $_ } $result = $searcher.get()
    return $result
    ## Log time for duration clock
    $Start = Get-Date
    $StartTime = "StartTime: " + $Start.ToShortTimeString()
    ## Environmental Variables
    $QueryMode = $Args #parameter for either "Desktops" / "Servers"
    $CsvPath = "C:\Scripts\JavaReport\JavaReport" + "$QueryMode" + ".csv"
    $Date = Get-Date
    $Domain = $env:UserDomain
    $HostName = ($env:ComputerName).ToLower()
    ## Regional Settings
    ## Used for testing
    IF ($Domain -eq "abc") {$Region = "US"; $SMTPDomain = "abc.com"; `
    $ToAddress = "[email protected]"; `
    $ReplyDomain = "abc.com"; $smtpServer = "relay.abc.com"}
    ## Control Variables
    $FromAddress = "JavaReport@$Hostname.na.$SMTPDomain"
    $EmailSubject = "Java Report - $Region"
    $computers = @()
    $computers += "ZLBH02-VSUS"
    $computers += "AUTSUP-VSUS"
    $computers += "AppClus06-BH"
    $computers += "Aut01-BH"
    $computers += "AutLH-VSUS"
    $computers += "AW-MGMT01-VSUS"
    $computers += "BAMBOOAGT-VSUS"
    #>
    ## Loop through all computer objects found in $Computes Array
    $JavaInfo = @()
    FOREACH($Client in $Computers)
    ## Gather WMI installed Software info from each client queried
    Clear-Host
    Write-Host "Querying: $Client" -foregroundcolor "yellow"
    $HostCount++
    $Online = (test-connection -ComputerName ADRAP-VSUS -Count 1 -Quiet)
    IF($Online -eq "True")
    $ColItem = Get-WmiCustom -Class Win32_Product -Namespace "root\cimv2" -ComputerName $Client -ErrorAction SilentlyContinue | `
    Where {(($_.name -match "Java") -and (!($_.name -match "Auto|Visual")))} | `
    Select-Object Name,Version
    FOREACH($Item in $ColItem)
    ## Write Host Name as variable
    $HostNm = ($Client).ToUpper()
    ## Query Named Version of Java, if Java is not installed fill variable as "No Java Installed
    $JavaVerName = $Item.name
    IF([string]::IsNullOrEmpty($JavaVerName))
    {$JavaVerName = "No Installed"}
    ## Query Version of Java, if Java is not installed fill variable as "No Java Installed
    $JavaVer = $Item.Version
    IF([string]::IsNullOrEmpty($JavaVer))
    {$JavaVer = "Not Installed"}
    ## Create new object to organize Host,JavaName & Version
    $JavaProp = New-Object -TypeName PSObject -Property @{
    "HostName" = $HostNm
    "JavaVerName" = $JavaVerName
    "JavaVer" = $JavaVer
    ## Add new object data "JavaProp" from loop into array "JavaInfo"
    $JavaInfo += $JavaProp
    Else
    {Write-Host "$Client didn't respond, Skipping..." -foregroundcolor "Red"}
    #Write-Host "Host Query Count: $LoopCount" -foregroundcolor "yellow"
    ## Sort Array
    Write-Host "Starting Array" -foregroundcolor "yellow"
    $JavaInfoSorted = $JavaInfo | Sort-object HostName
    Write-Host "Starting Export CSV" -foregroundcolor "yellow"
    ## Export CSV file
    $JavaInfoSorted | export-csv -NoType $CsvPath -Force
    $Att = new-object Net.Mail.Attachment($CsvPath)
    Write-Host "Building Table Header" -foregroundcolor "yellow"
    ## Table Header
    $list = "<table border=1><font size=1.5 face=verdana color=black>"
    $list += "<tr><th><b>Host Name</b></th><th><b>Java Ver Name</b></th><th><b>Ver Number</b></th></tr>"
    Write-Host "Building HTML Table" -foregroundcolor "yellow"
    FOREACH($Item in $JavaInfoSorted)
    Write-Host "$UniqueHost" -foregroundcolor "Yellow"
    ## Alternate Table Shading between Green and White
    IF($LoopCount++ % 2 -eq 0)
    {$BK = "bgcolor='E5F5D7'"}
    ELSE
    {$BK = "bgcolor='FFFFFF'"}
    ## Set Variables
    $JVer = $Item.JavaVer
    $Jname = $Item.JavaVerName
    ## Change Non-Compliant Java Versions to red in table
    IF((($jVer -like "6.0*") -and (!($jVer -match $java6))) -or `
    (($jName -like "*Java(TM) SE Development Kit 6*") -and (!($jName -match $javaSEDEVKit6))) -or `
    (($jVer -like "7.0*") -and (!($jVer -match $java7))) -or `
    (($jName -like "*Java SE Development Kit 7*") -and (!($jName -match $javaSEDEVKit7))))
    $list += "<tr $BK style='color: #ff0000'>"
    ## Compliant Java version are displayed in black
    ELSE
    $list += "<tr $BK style='color: #000000'>"
    ## Populate table with host name variable
    $list += "<td>" + $Item."HostName" + "</td>"
    ## Populate table with Java Version Name variable
    $list += "<td>" + $Item."JavaVerName" + "</td>"
    ## Populate table with Java Versionvariable
    $list += "<td>" + $Item."JavaVer" + "</td>"
    $list += "</tr>"
    $list += "</table></font>"
    $End = Get-Date
    $EndTime = "EndTime: " + $End.ToShortTimeString()
    #$TimeDiff = New-TimeSpan -Start $StartTime -End $EndTime
    $StartTime
    $EndTime
    $TimeDiff
    Write-Host "Total Hosts:$HostCount"
    ## Email Function
    Function SendEmail
    $msg = new-object Net.Mail.MailMessage
    $smtp = new-object Net.Mail.SmtpClient($smtpServer)
    $msg.From = ($FromAddress)
    $msg.ReplyTo =($ToAddress)
    $msg.To.Add($ToAddress)
    #$msg.BCC.Add($BCCAddress)
    $msg.Attachments.Add($Att)
    $msg.Subject = ($EmailSubject)
    $msg.Body = $Body
    $msg.IsBodyHTML = $true
    $smtp.Send($msg)
    $msg.Dispose()
    ## Email Body
    $Body = $Body + @"
    <html><body><font face="verdana" size="2.5" color="black">
    <p><b>Java Report - $Region</b></p>
    <p>$list</p>
    </html></body></font>
    <html><body><font face="verdana" size="1.0" color="red">
    <p><b> Note: Items in red do not have the latest version of Java installed. Please open a ticket to have an engineer address the issue.</b></p>
    </html></body></font>
    <html><body><font face="verdana" size="2.5" color="black">
    <p>
    $StartTime<br>
    $EndTime<br>
    $TimeDiff<br>
    $HostCount<br>
    </p>
    <p>
    Run date: $Date<br>
    $Version<br>
    $LastUpdate<br>
    </p>
    </html></body></font>
    ## Send Email
    SendEmail

  • How to get all properties for an item with search?

    How can I get all crawled / managed properties back of an item with the search API (REST, client, or server)?
    Currently I am only aware of specifying the applicable properties specifcally by using the selectproperties parameters via REST:
    http://host/site/_api/search/query?querytext='terms'&selectproperties='Path,Url,Title,Author'
    (taken from http://blogs.msdn.com/b/nadeemis/archive/2012/08/24/sharepoint-2013-search-rest-api.aspx)
    I don't want to do this. I just want to get all properties back that
    are associated with the search results.

    Its my understanding that standard managed properties will be returned, like: Created Date, Last Date Modified, Author, Title, etc.  However, if you need more than that you will need to specify the properties to return.
    This blog post also has a similar thought process:
    http://www.blendmaster.net/blog/2012/09/view-managed-property-value-in-sharepoint-2013-using-search-rest-api/
    Brandon Atkinson
    Blog: http://brandonatkinson.blogspot.com

  • App will not download to iPad when purchased from App Store - stuck with Cloud icon

    Device : iPad Air 32gb wi-fi model (not cellular data)
    OS version : 7.1.1 (up to date)
    Location : UK
    Problem : App will not download to iPad when purchased from App Store - stuck with Cloud icon
    Last night I tried to download an app over wi-fi onto my iPad Air, but the app did not install.
    I have plenty of space (the app is 24.1mb, I have 3.4gb free space) and there are no restrictions whatsoever on my iPad - no blocks on App store purchases, no age-related restrictions, no country restrictions etc.
    Normally from the App Store page you would tap the price (in this case the app was free), enter your iTunes password, and the app would download.
    Also a new icon appears on the home screen and a circle shows the progress of the download.
    However this did not happen.
    Instead I have the Cloud icon (the one that shows when you have bought an app but it is not currently installed on your device) and a message that says "You've already purchased this, so it will be downloaded now at no additional cost".
    If I press OK I am then prompted to enter my iTunes password, the Cloud symbol briefly changes to a circle (and I mean for a split-second, like the blink of an eye) and then the Cloud symbol appears again.
    The app does not download - in fact it does not even *attempt* to download.
    I have tried this >20 times now and it always occurs excatly like this.
    After Googling this problem (which seems common) and reading over a dozen threads on this forum plus Apple's own official support pages, this is what I've tried:
    I can re-download other apps that I have previously purchased on this iPad, with no problems.
    I purchased another app on my iPhone 5 and was then able to download onto my iPad with no problems.
    I have reset my iPad >5 times - both by pressing/holding the home/power buttons, and also a full switch off and restart.
    I have logged out of my iTunes account on the iPad, and logged back in.
    The wi-fi is Virgin Media fibre optic broadband with a verified speed of 20 meg (confirmed by Speedtest) plus an 802.11-n Belkin router and my iPad will happily load web pages, stream videos on YouTube, download other apps etc.
    I have reset/rebooted my internet connection
    In an attempt to eliminate by broadband connection from the possible causes, I have switched off my router, linked my iPad to the hotspot feature on my iPhone and tried to download the app over cellular data, but still cannot download the app.
    I have tried on 2 other wi-fi networks but still cannot download this one app.
    My iTunes account has a cerdit balance from an iTunes card, but the app was free anyway
    Nothing I try will download the app in question.
    The app is iPad only, so I cannot install on my iPhone to try and kick-start the process.
    I guess I could install the app on my computer and then sync the iPad, but that's *working around* the problem - it's not *fixing* the problem.
    (Since getting the iPad I use almost never use my computer. And anyway what if I did not have a computer? Didn't iOS go "PC-free" with version 5?)
    I would like to call Apple but my 90-day telephone support has expired (the iPad is around 6 months old) and I don't want to buy Apple Care for this one problem.
    I can't make it to an Apple Store to speak to a Genius.
    Bearing in mind the list of things I've already tried, what do I do next?
    Thanks in advance for any support.

    Hi there.
    Thank you very much for your quick reply, it's really appreciated.
    No need to apologize, I actually found the phrase "If your iPad ever craps the bed" amusing under the circumstances
    I checked the list of installed apps like you suggested (Settings>General>Usage>Storage>Show all apps) but this problem app is not in the list. I have also swiped down on the home screen to search for it, but again it does not show.
    While it has not let me download the app (and I just tried it again) it has helped me to eliminate a few things from the list of what to try, and I can definitely conclude that it has not downloaded.
    I guess I need to fire up my PC and download it / sync my iPad.
    Thanks again for your help

  • How do I use "Search Query" for nontrivial searches?

    After a few years in the community, this is my _first_ question to the boards ;-)
    In speaking with a colleague today, I learned about an NI forum feature that would be useful for me. When I tried to configure it, I then learned that I didn't know how to use it. When I tried to learn how to use it, I further learned that it wasn't fully documented. So, I'd like some clarification :-)
    The feature in question is "Search Query" which will send you an email when a forum search matches your query. What I don't know is:
    What are the rules (syntax) for search queries? For example, I would like to search for single words, all the words that I specify, as well as exact phrases. How do I differentiate between multiword queries and exact phrase queries?
    Is it possible to have more than one Search Query?
    If so, how do you delineate them? Would I use commas, a new line, something else?
    I'm asking because the available (and discoverable) documentation doesn't mention what to do when you want more than one Search Query. The help text on the subscription page [1] makes me think that only one query is possible, and says a Search Query:
    Sends you mail every time a message matching your query is submitted. Search queries take up to 15 minutes to take effect. Saving a blank query will disable this feature and will stop any mail from being sent.
    The other place I tried was the NI Forum FAQ [2], which makes me think that more than one query is possible:
    If you add a board, thread, message, or search term to your subscriptions, the system will send you an e-mail every time someone posts to the board, or replies to the message or thread. If you prefer not to receive an e-mail for your subscriptions, you can subscribe to the RSS feed of a board, thread, user, or search term.
    The FAQ goes on about what to do with board, thread, and message subscriptions, but doesn't say anything more about search subscriptions.
    The last place I looked was on the search results page itself. In the blue header that precedes the results, there's a link on the far left that says "Search Options" with a single option that says "Subscribe to this search's RSS Feed". While I could subscribe and use an RSS reader, I really would prefer email. I suppose if only one Search Query is possible, then this will be my workaround.
    As a comment, why does the Search Options menu not also have a "Subscribe to this search" option, which would add another entry in the Search Query box? This is a noticeably different interface than the Thread Options menu.
    [1] Subscriptions & Bookmarks
    http://forums.ni.com/ni/user_subscriptions
    [2] Frequently Asked Questions
    http://forums.ni.com/ni/help_faq
    Joe Friedchicken
    NI VirtualBench Application Software
    Get with your fellow hardware users :: [ NI's VirtualBench User Group ]
    Get with your fellow OS users :: [ NI's Linux User Group ] [ NI's OS X User Group ]
    Get with your fellow developers :: [ NI's DAQmx Base User Group ] [ NI's DDK User Group ]
    Senior Software Engineer :: Multifunction Instruments Applications Group
    Software Engineer :: Measurements RLP Group (until Mar 2014)
    Applications Engineer :: High Speed Product Group (until Sep 2008)
    Solved!
    Go to Solution.

    Hi Joe,
    Thanks for all of the questions and congrats on posting your first question!
    Unfortunately I think all of your questions come from the valid assumption that the search query functionality is more robust than it actually is.  The search query functionality really only serves a single purpose and that is to email you when your phrase has been posted to the forums.  For me, I use it to email me when my name is mentioned in the forums.  It serves this purpose well since I have it set up to work off just a single search term.  However I find that multiple word phrases are combined with an OR which is not as useful.  The search query does not adhere to any common search syntax that you would expect (I believe we are the only community that uses this feature so it has not been improved upon).
    The best way to set up both multiple word queries and multiple different queries is to use the RSS feed as you mentioned.  This way you can tailor your search very specifically using different advanced search options and subscribe to them all in one feed reader without constantly getting emails.  The search query emails do not adhere to the digest subscription settings.  I find that the RSS feeds work very well for searches and I am fond of using them, but I do use an RSS Reader for many things so it is not out of my normal workflow.
    Thank you for reading the Forum FAQ.  I've done some work to improve it but I think it has a long way to go and it's good to know that people read it
    Regards,
    Laura
    Web Support & Operations
    National Instruments

  • How to modify search query based on new FE

    Hi,
    As per a requirement, in All Accounts search (advanced search section), I had to replace 5 checkboxes (e.g. Role1, Role2, Role3, Role4, Role5) by a single dropdown (codelist) name= "Account_Roles" containing same values (Role1, Role2, Role3, Role4, Role5). I created Customer's XBO and declared field of the codelist type, name= "Account_Roles". So, the XBO now has below 6 fields :
    Role1, Role2, Role3, Role4, Role5 (type = Indicator)
    Account_Roles                            (type = codelist)
    Existing search on All Accounts worked on the 5 checboxes and fetched those accounts for which the values matched.
    E.g.
    If in search parameters, I check Role1 & Role2, and for Account1, these values are stored as "true", then Account1 will be shown in the result list.
    Now the search UI doesn't have the checkboxes, but codelist ('Account_Roles') which can have value 'Role1'/'Role2'/'Role3'/'Role4'/'Role5' or combinations are also possible like 'Role1' OR 'Role2', etc..
    My question here is -
    Will the old search query that worked on indicator fields earlier, handle the new FE "Account_Roles" automatically ?
    If not, then will modification be required to existing search query ?
    If modification is required, what steps I need to follow to handle this new field instead of checkboxes.
    I need exact steps to modify a search query, as I tried several things in the PDI but was not able to confirm if this requirement can be implemented by modifying search query or it is not feasible from PDI perspective.
    Appreciate all your inputs.
    Thanks,
    Sachin.

    Hi,
    you can create a link between the vendor objects itself, means link 0vendor with 0ven_compc and 0ven_purorg. This should give you a list of all vendors multiplied with the comp codes multiplied with the purch. org. May be here it is possible to create another link between a attribute (eg. comp_code of 0ven_purorg with comp_code of 0ven_compc). In case it is not possible you need to add this link information somehow. Another option might be to create 2 queries. One on a infoset of 0vendor and 0ven_purorg and another one on 0vendor and 0ven_compc.
    regards
    Siggi

Maybe you are looking for

  • Custom worklist decorator class not working

    hi , i was trying out the worklist customization as described in http://download.oracle.com/docs/cd/E13154_01/bpm/docs65/workspace_customization/index.html. however it is not working. any ideas as to what might be wrong... my custom mworklist decorat

  • Bought music on ipad not showing up in computer

    I bought an album on my ipad.  It downloaded completely.  I cannot find it on my computer though.  It does not show up in purchased items.  Please help.

  • How can I see how often and where an image is used in the site?

    Just realized the post appeared twice as at first sending I got an error page (contains no data...). So, please do all answer to the other post, so that all replies get collected at one post only. Hello, please excuse my maybe dumb question but conve

  • Billing Document cancellation error

    Hi Expert, Good morning. Due to the wrong posting CST figure 3% instead of 2%, I wanted to cancel billing document. When I am trying VF11 to cancel billing document, System is throwing error " Billing date should be current date always" can you pleas

  • Transform from Business Process Expert to Value Scenario Experts !!!!

    Hi Business Process Experts, Its time to think ahead for all of us to be in line with SAP Business Suite 7.0 SAP Business Suite 7: Establish Process Excellence, Lower Costs, And Capture Opportunities SAP Business Suite software provides best industry