Search with multiple words not returning expected results

I am using RoboHelp 9 and was performing my search on published WebHelp.
In the Help there is a topic named "Port and Path Connection States" which references a status of "port not started".
When I search for "port not started" (with quotes) the topic is returned.
When I search for "port not started" (without quotes), I get this message: "The words you typed is not a valid expression.".
I thought this search would be treated as an OR search, and I would get results for all topics that contained the word "port" or "not" or "started", but instead the expression is not valid. Can anyone tell me why? 

Check your list of Stop words. It may include NOT.
See www.grainge.org for RoboHelp and Authoring tips
@petergrainge

Similar Messages

  • Ctxrule - match does not return expected result

    v.11.1.07 - I have created a ctxrule index as detailed below. However, although a query should match on the given document, it does not return. Any ideas?
    begin
    ctx_ddl.create_preference('ot_lexer', 'basic_lexer');
    ctx_ddl.set_attribute('ot_lexer', 'index_stems', 'ENGLOSH');
    end;
    begin
    ctx_ddl.create_section_group('ot_sec_group', 'auto_section_group');
    end;
    create table ot_profile_test
    (profile_id number,
    query clob);
    create index ot_profile_rule_ndx on ot_profile_test(query)
    indextype is ctxsys.ctxrule parameters
    ('stoplist ctxsys.empty_stoplist
    section group ot_sec_group
    lexer ot_lexer');
    insert into ot_profile_test values(1, '($apple and $pear) and (1 within food)');
    commit;
    exec ctxsys.ctx_adm.set_parameter('log_directory', '/yourdir');
    exec ctx_output.start_log('ot');
    exec ctx_output.add_event(ctx_output.event_index_print_rowid);
    exec ctx_output.add_event(ctx_output.event_index_print_token);
    exec ctx_ddl.sync_index('ot_profile_rule_ndx', '2040M', null, 1, null, ctx_ddl.lock_nowait_error);
    exec ctx_output.end_log;Then, run a query:
    declare
    a clob := 'apple orange pears banana
    <metadata>
    <indicators>
       <food>1</food>
    </indicators>
    </metadata>
    vn_profile_id number;
    begin
    select profile_id into vn_profile_id
    from ot_profile_test
    where matches(query, a) > 0;
    dbms_output.put_line(vn_profile_id);
    end;
    ERROR at line 1:
    ORA-01403: no data found
    ORA-06512: at line 8Shouldn't profile_id = 1 be returned?
    Also, shouldn't the logfile have 2 rows written to $I?
    WRITING TOKEN APPLE:((PEAR) = (PEARS)) * ((1) WITHIN FOOD),0
    WRITING TOKEN APPLES:((PEAR) = (PEARS)) * ((1) WITHIN FOOD),0

    You need to use a basic_wordlist instead of a basic_lexer and ENGLISH instead of ENGLOSH in order to use stemming and your clob (variable a) must be valid html or xml in order to search within sections. Please see the simplified demonstration below.
    SCOTT@orcl_11gR2> begin
      2    ctx_ddl.create_preference ('ot_wordlist', 'basic_wordlist');
      3    ctx_ddl.set_attribute ('ot_wordlist', 'stemmer', 'ENGLISH');
      4    ctx_ddl.create_section_group ('ot_sec_group', 'auto_section_group');
      5  end;
      6  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> create table ot_profile_test
      2    (profile_id  number,
      3       query         clob)
      4  /
    Table created.
    SCOTT@orcl_11gR2> create index ot_profile_rule_ndx
      2  on ot_profile_test (query)
      3  indextype is ctxsys.ctxrule
      4  parameters
      5    ('stoplist     ctxsys.empty_stoplist
      6        wordlist     ot_wordlist
      7        section group     ot_sec_group')
      8  /
    Index created.
    SCOTT@orcl_11gR2> insert into ot_profile_test values
      2    (1, '($apple and $pear) and (1 within food)')
      3  /
    1 row created.
    SCOTT@orcl_11gR2> commit
      2  /
    Commit complete.
    SCOTT@orcl_11gR2> exec ctx_ddl.sync_index ('ot_profile_rule_ndx')
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> declare
      2    a clob :=
      3        '<table>
      4           <fruits>apple orange pears banana</fruits>
      5           <metadata>
      6             <indicators>
      7            <food>1</food>
      8             </indicators>
      9           </metadata>
    10         </table>';
    11  begin
    12    for r in
    13        (select profile_id
    14         from      ot_profile_test
    15         where  matches (query, a) > 0
    16         order  by profile_id)
    17    loop
    18        dbms_output.put_line (r.profile_id);
    19    end loop;
    20  end;
    21  /
    1
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2>

  • BAPI_ALM_ORDERHEAD_GET_LIST by CREATE_DATE does not return expected result.

    Hi,
    I am trying to retrieve an Order I have manually created on an ECC6.0 system with Order ID 816149.
    I can retrive the order fine using BAPI_ALM_ORDER_GET_DETAIL passig in the Order ID.
    However, if I use BAPI_ALM_ORDERHEAD_GET_LIST with IT_RANGE set on the ENTER_DATE criteria, I get a bunch of Orders back from the search but not mine. However, the creation date of my Order is within the search range. I suspect the problem might be the System Status of my order (but I am just guessing) which is CRTD MANC NMAT NTUP. The User Status is CRTD though, so I am a bit puzzled as to why my order is not in the returned result set. For instance Order 816148 (created by someone else) is returned and it looks very similar to mine (except for the status).
    If any help from SAP people, I am using an ICC Test system so maybe you can have a look for yourself. My system is CF5 / cpcf501 / 05 client 800.
    Cheers.
    JR

    Please pass
    Exporting
    DISPLAY_PARAMETERS
    CALL FUNCTION 'BAPI_ALM_ORDERHEAD_GET_LIST'
    EXPORTING
       DISPLAY_PARAMETERS       =
    " IMPORTING
    "   NAVIGATION_DATA          =
      TABLES
        IT_RANGES                =
        ET_RESULT                =
    "   ET_TEMPLATE              =
        RETURN                   =
    Regards,
    Lalit Mohan Gupta.

  • REGEXP_LIKE not returning expected results

    My first attempt at REGEXP_LIKE and I'm obviously missing something. I've tried several suggestions I found in the forum but cannot get the correct results. I need the following query to return only those rows containing only alphabetic characters (no numbers). What I get are rows containing letters and numbers.
    Any help will be greatly appreciated!
    Randy
    SELECT order_number
    FROM order_table
    where REGEXP_LIKE(order_number,'[a-z A-Z]')

    check below the various options which you can use to search different elements
    Character Class   Syntax Meaning
    [:alnum:]             All alphanumeric characters
    [:alpha:]              All alphabetic characters
    [:blank:]              All blank space characters
    [:cntrl:]                All control characters (nonprinting)
    [:digit:]                All numeric digits
    [:graph:]             All [:punct:], [:upper:], [:lower:], and [:digit:] characters
    [:lower:]              All lowercase alphabetic characters
    [:print:]               All printable characters
    [:punct:]              All punctuation characters
    [:space:]             All space characters (nonprinting)
    [:upper:]             All uppercase alphabetic characters
    [:xdigit:]              All valid hexadecimal characters

  • Refresh using alias table not returning expected results

    I am getting some unexpected results in SmartView and can't figure out the cause. I have an Essbase cube that has two alias tables: the "default" and one that I call "Short Descr". I can consistently bring back data using "none" and "default", but not "Short Descr". When I use "Short Descr" data will come back for some of the members, but not for others.
    Here is an example of a query using "none" as the alias table:
         Net Income      
         RD10078      
         Y-T-D(MAR)      
    PRJG939306      20,372.05      
    PRJLG921508      (26.42)     
    Project      (1,179,752.36)     
    If I change the alias table to "Short Descr", I get the following results:
         Net Income      
         ITA (RD10078)      
         Y-T-D(MAR)      
    PRJG939306 (PRJG939306)      20,372.05      
    PRJLG921508 (PRJLG921508)      (26.42)     
    Project      (1,179,752.36)     
    But then if I just clear the amounts, and do a refresh, I get the following:
         Net Income      
         ITA (RD10078)      
         Y-T-D(MAR)      
    PRJG939306 (PRJG939306)           
    PRJLG921508 (PRJLG921508)      (26.42)     
    Project      (1,179,752.36)     
    And if I pivot Net Income, I get a message that "Any comments/ functions/ formulas on the sheet will be lost.", and the PRJG939306 member is lost.
              ITA (RD10078)      
              Y-T-D(MAR)      
    Net Income      PRJLG921508 (PRJLG921508)      (26.42)     
    Net Income      Project      (1,179,752.36)     
    I can't figure out why it would start treating it as a comment. It looks to be a valid member name and I don't see anything strange if I look at the member properties in EAS. And what I really don't understand is why it would bring back the member name (with alias) and a data value when I change the alias table from "none" to "Short Descr", but not bring back a value when I just clear the amounts and do a Refresh. And why is it only doing it for some of the members and not all of them?
    What could cause this type of behavior?

    lets see if I can say this clearly. Smartview will noit convert from one alias to another. Before switching alias tables, try changing back to no alias and do a retrieve, then switch to the new alias table and retrieve. I think the problem is Smartview is not interpeting what is on the one line so it leave it blank as an unknown member.

  • How can I search for multiple words (not a phrase, but different words) all at once?

    Hello everyone,
    I have a job that includes looking for many different words in large paragraphs. I would make things much faster for me if - instead of typing in "word 1", and then clearing it, and then typing in "word 2" - but rather, I could somehow search for a few words at once. Is there a way to do this? An add-on? Something built in?
    Thanks for the help.

    Try this add-on [https://addons.mozilla.org/it/firefox/addon/find-all/ Find All]

  • cm:search is not returning any result when logical operator '!' is used.

    <cm:search is not returning any result when logical operator '!' is used.
    I am using BEA 9.1 content management services API. When I run the following query I am not receiving any results. Also no error or exceptions are seen in the weblogic or cmspi log.
    The query is <cm:search id="docs" query="!(object_name like 'Sport*')" />

    HI cam 
    Thanks for your reply, but i found the problem it was because my server administrator password has changed by network guys... and because of it crawler unable to access the content 
    I wrote my solution here i hope it will help other people 
    http://bvs-sharepoint.blogspot.com/2015/03/sharepoint-search-is-not-returning.html
    RB

  • Search for multiple words in a field?

    is there a way to search for multiple words in a field? for example, if i have a metadata field called NOTES that contains the string "Joe and Bob created this version on Sunday" is there a way to search for "Sunday, Joe, Bob" and have it return the asset?

    Search using the "Matches Word" option instead of "Contains". That will limit your results to only assets that have a field value that includes all three of those terms. If they are not all included in the same field value, it will not return a hit. So if "Sunday" were in Keywords and "Joe" & "Bob" are in Notes, you would not get a hit for that search with "Matches Word".
    "Contains" searches for the contiguous string in any field on the assets.
    Further, if you add your Notes field to the Metadata Group "Asset Filter", it will appear in your advanced search options, asset subscription filters, and search expired responses. Then you can specifically limit the search to that field and choose from "Matches Word', "Contains", and several other search filters. Note that when you use "Matches Word" this way, you need to eliminate spaces from your comma delimited list of words or you will not get the search hits you want.

  • How to search with multiple constraints in the new java API?

    I'm having a problem using the new MDM API to do searches with multiple constraints.  Here are the classes I'm trying to use, and the scenario I'm trying to implement:
    Classes:
    SearchItem: Interface
    SearchGroup: implements SearchItem, empty constructor,
                 addSearchItem (requires SearchDimension and SearchConstraint, or just a SearchItem),
                 setComparisonOperator
    SearchParameter: implements SearchItem, constructor requires SearchDimension and SearchConstraint objects
    Search: extends SearchGroup, constructor requires TableId object
    RetrieveLimitedRecordsCommand: setSearch method requires Search object
    FieldDimension: constructor requires FieldId object or FieldIds[] fieldPath
    TextSearchConstraint: constructor requires string value and int comparisonOperator(enum)
    BooleanSearchConstraint: constructor requires boolean value
    Scenario:
    Okay, so say we have a main table, Products.  We want to search the table for the following:
    field IsActive = true
    field ProductColor = red or blue or green
    So the question is how to build this search with the above classes?  Everything I've tried so far results in the following error:
    Exception in thread "main" java.lang.UnsupportedOperationException: Search group nesting is currently not supported.
         at com.sap.mdm.search.SearchGroup.addSearchItem(Unknown Source)
    I can do just the ProductColor search like this:
    Search mySearch = new Search(<Products TableId>);
    mySearch.setComparisonOperator(Search.OR_OPERATOR);
    FieldDimension myColorFieldDim = new FieldDimension(<ProductColor FieldId>);
    TextSearchConstraint myTextConRed = new TextSearchConstraint("red",TextSearchConstraint.EQUALS);
    TextSearchConstraint myTextConBlue = new TextSearchConstraint("blue",TextSearchConstraint.EQUALS);
    TextSearchConstraint myTextConGreen = new TextSearchConstraint("green",TextSearchConstraint.EQUALS);
    mySearch.addSearchItem(myColorFieldDim,myTextConRed);
    mySearch.addSearchItem(myColorFieldDim,myTextConBlue);
    mySearch.addSearchItem(myColorFieldDim,myTextConGreen);
    the question is how do I add the AND of the BooleanSearchConstraint?
    FieldDimension myActiveFieldDim = new FieldDimension(<IsActive FieldId>);
    BooleanSearchConstraint myBoolCon = new BooleanSearchConstraint(true);
    I can't just add it to mySearch because mySearch is using OR operator, so it would return ALL of the Products records that match IsActive = true.  I tried creating a higher level Search object like this:
    Search topSearch = new Search(<Products TableId>);
    topSearch.setComparisonOperator(Search.AND_OPERATOR);
    topSearch.addSearchItem(mySearch);
    topSearch.addSearchItem(myActiveFieldDim,myBoolCon);
    But when I do this I get the above "Search group nesting is currently not supported" error.  Does that mean this kind of search cannot be done with the new MDM API?

    I'm actually testing a pre-release of SP05 right now, and it still is not functional.  The best that can be done is to use a PickListSearchConstraint to act as an OR within a field.  But PickList is limited to lookup Id values, text attribute values, numeric attribute values and coupled attribute values.  It works for me in some cases where I have lookup Id values, but not in other cases where the users want to search on multiple text values within a single field.

  • Bing based federated result sources not returning any results for non-English languages

    I have a result source with this query:
    http://www.bing.com/search?q={?searchterms}  language:fr site:msdn.microsoft.com&format=rss&count=50&first={startIndex}
    This used to give me 40-50 results for common terms like download, blog etc.
    From today (7/14) IST, this source does not return any results. There are no results if I execute this query directly in IE either.
    Same behavior observed for: language:es, language:de etc.
    I do however get results as expected for language:en.
    Any idea what the issue might be?

    Hi Swapnil,
    According to your description, my understanding is that no results returned when searching with non-English in the Result Source query.
    I tested the same scenario per your post and I got the same results as you got.
    I recommend to change the language:fr in the Result Source query to be lang=fr to see if the issue still occurs.
    More references:
    http://kbdump.com/sharepoint-2013-opensearch-search-twitter-facebook-wikipedia-page/
    http://richardstk.com/2013/11/08/sharepoint-2013-federated-search-to-bing/
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • Avoid JDBC sender error: Execute statement did not return a result set

    Hi!
    My JDBC sender adapter towards MS SQL server works fine, with an Execute statement calling a stored procedure that returns the source data needed. The stored procedure itself updates the status of database table records, so that only the unread records are returned each time the stored procedure is called.
    However, the communication channel monitoring sets a red flag for the JDBC sender adapter, when there are no values to fetch from the database table (using the stored procedure). Message says: "Database-level error reported by JDBC driver while executing statement 'EXECUTE FetchMessage 1, 9000'. The JDBC driver returned the following error message: 'com.microsoft.sqlserver.jdbc.SQLServerException: The statement did not return a result set.'. For details, contact your database server vendor."
    This is not an error situation, as I do not expect there to be any values to fetch from the database at all times.
    I do not see how to change the stored procedure to avoid this error.
    Is there a parameter to be set on the JDBC adapter that I can use, so the red flag is avoided?
    Thanks for any input!
    Regards,
    Oeystein Emhjellen

    Hi Oeystein Emhjellen.
    The problem is Store Procedure that has to generate always a ResultSet (or cursor). If it doesn't have a output, you have to generate an Empty ResultSet.
    Like a SELECT Statement:
    If there are data, SELECT get an output result but if it get nothing the SELECT Statement get a empty ResultSet.
    Ask to your database team.
    I hope it helps you.
    Bruno.

  • Xquery does not return any results on 10.2.0.4, does work on 10.2.0.5

    I have a Xquery statement that works as expected on Oracle 10.2.0.5 but does not return any results on Oracle 10.2.0.4.
    Is this the result of a badly written query? A bug in 10.2.0.4?
    Is there a way to rewrite the query so that is does work on 10.2.0.4?
    Testcode:
    declare
       l_xml xmltype;
       -- Select layers with TileMatrixSet EPSG:28992
       cursor c_layer(p_xml xmltype) is
          select t.*
            from xmltable(xmlnamespaces(default 'http://www.opengis.net/wmts/1.0'
                                       ,'http://www.opengis.net/ows/1.1' as "ows"
                                        ,'http://schemas.opengis.net/gml' as "gml"
                                        ,'http://www.w3.org/1999/xlink' as "xlink"
                                        ,'http://www.w3.org/2001/XMLSchema-instance' as "xsi")
                          ,'for $d in //Layer[TileMatrixSetLink/TileMatrixSet="EPSG:28992"] return $d' passing
                          p_xml columns title varchar2(100) path 'ows:Title'
                          ,format varchar2(100) path 'Format'
                          ,style xmltype path 'Style') as t;
    begin
       l_xml := xmltype.createxml('<?xml version="1.0" encoding="UTF-8"?>
    <Capabilities xmlns="http://www.opengis.net/wmts/1.0"
    xmlns:ows="http://www.opengis.net/ows/1.1"
    xmlns:xlink="http://www.w3.org/1999/xlink"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:gml="http://www.opengis.net/gml" xsi:schemaLocation="http://www.opengis.net/wmts/1.0 http://schemas.opengis.net/wmts/1.0/wmtsGetCapabilities_response.xsd"
    version="1.0.0">
    <Contents>
      <Layer>
        <ows:Title>brtachtergrondkaart</ows:Title>
        <ows:Identifier>brtachtergrondkaart</ows:Identifier>
        <Style isDefault="true">
          <ows:Identifier>_null</ows:Identifier>
        </Style>
        <Format>image/png8</Format>
        <TileMatrixSetLink>      <TileMatrixSet>EPSG:28992</TileMatrixSet>
        </TileMatrixSetLink>  </Layer>
      <Layer>
        <ows:Title>top10nl</ows:Title>
        <ows:Identifier>top10nl</ows:Identifier>
        <Style isDefault="true">
          <ows:Identifier>_null</ows:Identifier>
        </Style>
        <Format>image/png8</Format>
        <TileMatrixSetLink>      <TileMatrixSet>EPSG:28992</TileMatrixSet>
        </TileMatrixSetLink>  </Layer>
      <Layer>
        <ows:Title>bgt</ows:Title>
        <ows:Identifier>bgt</ows:Identifier>
        <Style isDefault="true">
          <ows:Identifier>_null</ows:Identifier>
        </Style>
        <Format>image/png8</Format>
        <TileMatrixSetLink>      <TileMatrixSet>EPSG:28992</TileMatrixSet>
        </TileMatrixSetLink>  </Layer>
    </Contents>
    </Capabilities>');
       for r_layer in c_layer(l_xml)
       loop
          dbms_output.put_line(r_layer.title);
       end loop;
    end;Result on 10.2.0.5:
    brtachtergrondkaart
    top10nl
    bgt

    This one's strange indeed.
    I can reproduce on 10.2.0.4 and one of the following seems to fix it :
    1) Specifying the column list in the SELECT, instead of t.* :
       -- Select layers with TileMatrixSet EPSG:28992
       cursor c_layer(p_xml xmltype) is
          select t.title, t.format, t.style
            from xmltable(or,
    2) Using an extended FLWOR expression :
    for $d in //Layer
    where $d/TileMatrixSetLink/TileMatrixSet = "EPSG:28992"
    return $dMaybe you've already noticed but the problem only occurs within a PL/SQL context.
    The same query run from SQL is OK.

  • SDO_RELATE does not return expected points

    Hi,
    I have a problem with a query which does not return the results I am expecting. I think it may be to do with geodetic data v projected data but fail to see how.
    the table points2 contains point data stored in Lat Long (SRID 8307)
    Here is my query:
    SELECT mdsys.sdo_cs.transform(points2.assetextent,26943) FROM points2
    WHERE SDO_RELATE (points2.ASSETEXTENT, MDSYS.SDO_GEOMETRY(2003,26943 ,NULL, mdsys.SDO_ELEM_INFO_ARRAY(1,1003,3), mdsys.SDO_ORDINATE_ARRAY(1831679.1743184,644380.053168771,1831699.1743184,645000.053168677)),'mask=anyinteract') = 'TRUE';
    This query returns 0 results. if perform the same query with SDO_FILTER rather than SDO_RELATE then I get 1 result (which is what I expect). the result is this:
    MDSYS.SDO_CS.TRANSFORM(POINTS2.ASSETEXTENT,26943)(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINATES)
    SDO_GEOMETRY(3001, 26943, NULL, SDO_ELEM_INFO_ARRAY(1, 1, 1), SDO_ORDINATE_ARRAY(1831689.17, 644440.053, 0))
    1 row selected.
    As can clearly be seen from this result the point is 10m from the both vertical edges of the optimised rectangle and at least 60m from the horizontal edges.
    The sdo_geom_metadata_table entry for this table is:
    SDO_OWNER SDO_TABLE_NAME
    SDO_COLUMN_NAME
    SDO_DIMINFO(SDO_DIMNAME, SDO_LB, SDO_UB, SDO_TOLERANCE)
    SDO_SRID
    VST POINTS2
    ASSETEXTENT
    SDO_DIM_ARRAY(SDO_DIM_ELEMENT('X', -180, 180, .005), SDO_DIM_ELEMENT('Y', -90, 90, .005), SDO_DIM_ELEMENT('Z', -999, 5000, .005))
    8307
    Anyone got any pointers? If you need more info just let me know
    Sam

    hi,
    can you try this query and let us know what you get ?
    Transform the geometry to 8307 and pass it into the sdo_relate
    operator.
    SELECT mdsys.sdo_cs.transform(points2.assetextent,26943) FROM points2
    WHERE SDO_RELATE (points2.ASSETEXTENT,
    sdo_cs.transform(MDSYS.SDO_GEOMETRY(2003,26943 ,NULL, mdsys.SDO_ELEM_INFO_ARRAY(1,1003,3), mdsys.SDO_ORDINATE_ARRAY(1831679.1743184,644380.053168771,
    1831699.1743184,645000.053168677)), 8307), 'mask=anyinteract') = 'TRUE';

  • Basic NOT EXISTS query not returning any results

    DB Version: 10gR2
    One of our tables in the test schema is having less number of columns than the PROD shema.
    To determine which are missing columns in this table in Test schema i did the following.
    -----In Test Schema
    CREATE TABLE XYZ2
    (COL1 NUMBER);        ----------only one column
    SQL > CREATE TABLE tables_test_list AS SELECT TABLE_NAME,COLUMN_NAME FROM USER_TAB_COLS;
    Table created.--- In the prod schema
    SQL> CREATE TABLE XYZ2
      2  (COL1 NUMBER,
      3  COL2 NUMBER       ----------- same table name with an extra column
      4  );
    Table createdAnd from the PROD schema i execute the following SQL to determine what are the columns that are missing in the TEST schema
    select column_name from User_Tab_Cols  outer
    where table_name='XYZ2'
    and not exists (select 1 from TEST_SCHEMA.tables_test_list inner where outer.TABLE_NAME=inner.TABLE_NAME )But the above query is not returning any results. Any idea why?

    Actually, the example from the link I posted earlier:
    [email protected]> (
      2  select 'IN T1, NOT T2', column_name,data_type,data_length
      3    from user_tab_columns
      4   where table_name = 'T1'
      5  MINUS
      6  select 'IN T1, NOT T2', column_name,data_type,data_length
      7    from user_tab_columns
      8   where table_name = 'T2'
      9  )
    10  UNION ALL
    11  (
    12  select 'IN T2, NOT T1', column_name,data_type,data_length
    13    from user_tab_columns
    14   where table_name = 'T2'
    15  MINUS
    16  select 'IN T2, NOT T1', column_name,data_type,data_length
    17    from user_tab_columns
    18   where table_name = 'T1'
    19  )
    20  /

  • Table-Valued Function not returning any results

    ALTER FUNCTION [dbo].[fGetVendorInfo]
    @VendorAddr char(30),
    @RemitAddr char(100),
    @PmntAddr char(100)
    RETURNS
    @VendorInfo TABLE
    vengroup char(25),
    vendnum char(9),
    remit char(10),
    payment char(10)
    AS
    BEGIN
    insert into @VendorInfo (vengroup,vendnum)
    select ks183, ks178
    from hsi.keysetdata115
    where ks184 like ltrim(@VendorAddr) + '%'
    update @VendorInfo
    set remit = r.remit
    from
    @VendorInfo ven
    INNER JOIN
    (Select ksd.ks188 as remit, ksd.ks183 as vengroup, ksd.ks178 as vendnum
    from hsi.keysetdata117 ksd
    inner join @VendorInfo ven
    on ven.vengroup = ksd.ks183 and ven.vendnum = ksd.ks178
    where ksd.ks192 like ltrim(@RemitAddr) + '%'
    and ks189 = 'R') r
    on ven.vengroup = r.vengroup and ven.vendnum = r.vendnum
    update @VendorInfo
    set payment = p.payment
    from
    @VendorInfo ven
    INNER JOIN
    (Select ksd.ks188 as payment, ksd.ks183 as vengroup, ksd.ks178 as vendnum
    from hsi.keysetdata117 ksd
    inner join @VendorInfo ven
    on ven.vengroup = ksd.ks183 and ven.vendnum = ksd.ks178
    where ksd.ks192 like ltrim(@PmntAddr) + '%'
    and ks189 = 'P') p
    on ven.vengroup = p.vengroup and ven.vendnum = p.vendnum
    RETURN
    END
    GO
    Hi all,
    I'm having an issue where my Table-Valued Function is not returning any results.
    When I break it out into a select statement (creating a table, and replacing the passed in parameters with the actual values) it works fine, but with passing in the same exact values (copy and pasted them) it just retuns an empty table.
    The odd thing is I could have SWORN this worked on Friday, but not 100% sure.
    The attached code is my function.
    Here is how I'm calling it:
    SELECT * from dbo.fGetVendorInfo('AUDIO DIGEST', '123 SESAME ST', 'TOP OF OAK MOUNTAIN')
    I tried removing the "+ '%'" and passing it in, but it doesn't work.
    Like I said if I break it out and run it as T-SQL, it works just fine.
    Any assistance would be appreciated.

    Why did you use a proprietary user function instead of a VIEW?  I know the answer is that your mindset does not use sets. You want procedural code. In fact, I see you use an “f-” prefix to mimic the old FORTRAN II convention for in-line functions! 
    Did you know that the old Sybase UPDATE.. FROM.. syntax does not work? It gives the wrong answers! Google it. 
    Your data element names make no sense. What is “KSD.ks188”?? Well, it is a “payment_<something>”, “KSD.ks183” is “vendor_group” and “KSD.ks178” is “vendor_nbr” in your magical world where names mean different things from table to table! 
    An SQL programmer might have a VIEW with the information, something like:
    CREATE VIEW Vendor_Addresses
    AS
    SELECT vendor_group, vendor_nbr, vendor_addr, remit_addr, pmnt_addr
      FROM ..
     WHERE ..;
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

Maybe you are looking for