Value exists

hi all
I need a favor.
I need a java udf : I will take values in a context function and if second value in array does not exist ,I return a blank ,else I return the second element within the array.
Thnx

Hi,
Try the UDF I have given below. I gues sthis is your requirement.
if(a.length < 2)
result.addValue("");
else if(a.length ==2)
result.addValue(a[1]);

Similar Messages

  • Unable to Enforce Unique Values, Duplicate Values Exist

    I have list in SP 2010, it contains roughly 1000 items.  I would like to enforce unique values on the title field.  I started by cleaning up the list, ensuring that all items already had a unique value.  To help with this, I used the export
    to excel action, then highlight duplicates within Excel.  So as far as I can tell, there are no duplicates within that list column.
    However, when I try to enable the option to Enforce Unique Values, I receive the error that duplicate values exist within the field and must be removed.
    Steps I've taken so far to identify / resolve duplicate values:
    - Multiple exports to Excel from an unfiltered list view, then using highlight duplicates feature > no duplicates found
    - deleted ALL versions of every item from the list (except current), ensured they were completely removed by deleting from both site and site collection recycle bins
    - Using the SP Powershell console, grabbed all list items and exported all of the "Title" type fields (Item object Title, LinkTitle, LinkTitleNoMenu, etc) to a csv and ran that through excel duplicate checking as well. 
    Unless there's some rediculous hidden field value that MS expects anyone capable of attempting to enforce unique values on a list (which is simple enough for anyone to figure out - if it doesn't throw an error), then I've exhausted anything I can think
    of that might cause the list to report duplicate values for that field.
    While I wait to see if someone else has an idea, I'm also going to see what happens if I wipe the Crawl Index and start it from scratch.
    - Jon

    First, I create index for a column in list settings, it works fine no matter duplicate value exists or not;
    then I set enforce unique values in the field, after click OK, I get duplicate values error message.
    With SQL Server profiler, I find the call to proc_CheckIfExistingFieldHasDuplicateValues and the parameters. After reviewing this stored procedure in content database,
    I create the following script in SQL Server management studio:
    declare @siteid
    uniqueidentifier
    declare @webid
    uniqueidentifier
    declare @listid
    uniqueidentifier
    declare @fieldid
    uniqueidentifier
    set @siteid='F7C40DC9-E5D3-42D7-BE60-09B94FD67BEF'
    set @webid='17F02240-CE04-4487-B961-0482B30DDA84'
    set @listid='B349AF8D-7238-419D-B6C4-D88194A57EA7'
    set @fieldid='195A78AC-FC52-4212-A72B-D03144DC1E24'
    SELECT
    * FROM TVF_UserData_List(@ListId)
    AS U1 INNER
    MERGE JOIN
                NameValuePair_Latin1_General_CI_AS
    AS NVP1 WITH (INDEX=NameValuePair_Latin1_General_CI_AS_MatchUserData)
    ON NVP1.ListId
    = @ListId AND NVP1.ItemId
    = U1.tp_Id
    AND ((NVP1.Level
    = 1 AND U1.tp_DraftOwnerId
    IS NULL)
    OR NVP1.Level
    = 2)
    AND NOT((DATALENGTH(ISNULL(NVP1.Value,
    = 0)) AND U1.tp_Level
    = NVP1.Level
    AND U1.tp_IsCurrentVersion
    = CONVERT(bit, 1)
    AND U1.tp_CalculatedVersion
    = 0 AND U1.tp_RowOrdinal
    = 0 INNER
    MERGE JOIN
                NameValuePair_Latin1_General_CI_AS
    AS NVP2 WITH (INDEX=NameValuePair_Latin1_General_CI_AS_CI)
    ON NVP2.SiteId
    = @SiteId AND NVP2.ListId
    = @ListId AND NVP2.FieldId
    = @FieldId AND NVP2.Value
    = NVP1.Value
    AND NVP2.ItemId <> NVP1.ItemId
    CROSS APPLY TVF_UserData_ListItemLevelRow(NVP2.ListId, NVP2.ItemId,
    NVP2.Level, 0)
    AS U2 WHERE ((NVP2.Level
    = 1 AND U2.tp_DraftOwnerId
    IS NULL)
    OR NVP2.Level
    = 2)
    AND NOT((DATALENGTH(ISNULL(NVP2.Value,
    = 0))      
    I can find the duplicate list items based on the result returned by the query above.
    Note that you need to change the parameter values accordingly, and change the name of NameValuePair_Latin1_General1_CI_AS table based on the last parameter of the
    proc_CheckIfExistingFieldHasDuplicateValues stored procedure. You can review the code of this stored procedure by yourself.
    Note that direct operation on the content database in production environment is not supported, please do all these in test environment.

  • SharePoint Designer Workflow to check if value exists in any item in SharePoint List

    Hi,
    I've two column in SharePoint List. I want to check using SharePoint Designer 2013, if value exists in any item in SharePoint List for these two columns "PR NO" and "Part No". Thanks
    Can you please help me in SharePoint Designer how to write condition / steps for this. Thanks.

    Why are you making things complicated for yourself by building a workflow via SharePoint designer 2013.
    I had a to do a similar task in the past and running powershells was an easier and faster approach.
    Take a look at this Microsoft technetarticle I wrote a while back.
    http://social.technet.microsoft.com/wiki/contents/articles/25125.sharepoint-2013-powershell-to-copy-or-update-list-items-across-sharepoint-sites-and-farms.aspx
    Even though the above article talks about updating an existing list, you can focus on the condition where the powershell will loop through the list to see if any change has been made. You can add a condition to this change.
    Daniel Christian (MCTS)

  • How to know if implementation with a filter value exist for a BAdI in code?

    Hi all,
    Scenario:
    I created a BAdI. There will be a button on the UI to call its implementation(s); while if there is no implementation with specified filter value, this button needs to be hidden. Thus I need to know if the implementation exist before calling it.
    Question:
    In the ABAP code, how to get whether implementation with specified filter value exists for a BAdI?
    If it's possible, please help provide code.
    Thanks and regards,
    Said

    Problem solved:
    data: r_badi type ref to YOUR_BADI,
              badi_impl_num type i.
      get badi r_badi
        filters
          flt_name = fit_val.
      badi_impl_num = cl_badi_query=>number_of_implementations( badi = r_badi ).
      if badi_impl_num > 0.
        "there are badi implementation(s)
      endif.

  • ORA-35563: Multiple values exist for an attribute of this dimension member

    After following the tutorial Building OLAP Cubes I was trying to make a cube with aggregation down to the day instead of down to the month.
    I created a times table pretty similar to the one used in the tutorial:
    CREATE TABLE EVENT_TIMES (
            HOUR_KEY        DATE NOT NULL,
            DAY_ID          VARCHAR2(10),
            DAY_NAME        VARCHAR2(10),
            DAY_END_DATE    DATE,
            DAY_TIME_SPAN   NUMBER,
            MONTH_ID        VARCHAR2(30) NOT NULL,
            MONTH_NAME      VARCHAR2(40),
            MONTH_END_DATE  DATE,
            MONTH_TIME_SPAN NUMBER,
            YEAR_ID         VARCHAR2(30) NOT NULL,
            YEAR_NAME       VARCHAR2(40),
            YEAR_END_DATE   DATE,
            YEAR_TIME_SPAN  NUMBER
    As you can see, instead of a DAY_KEY like in the tutorial, I now use an HOUR_KEY.
    This is a sample of the data I inserted in this table:
    select to_char(hour_key,'YYYYMMDDHH24MISS'),DAY_ID,DAY_NAME,DAY_END_DATE,DAY_TIME_SPAN,MONTH_ID,MONTH_NAME,MONTH_END_DATE,MONTH_TIME_SPAN,YEAR_ID,YEAR_NAME,YEAR_END_DATE,YEAR_TIME_SPAN from event_times;
    TO_CHAR(HOUR_KEY,'YYYYMMDDHH24MISS') DAY_ID     DAY_NAME   DAY_END_DATE DAY_TIME_SPAN MONTH_ID                       MONTH_NAME                               MONTH_END_DATE MONTH_TIME_SPAN YEAR_ID                        YEAR_NAME                                YEAR_END_DATE YEAR_TIME_SPAN
    20140104050000                       Y2014M1D4  Y2014M1D4  04-JAN-14                1 Y2014M1                        Y2014M1                                  31-JAN-14                   31 Y2014                          Y2014                                    31-DEC-14                365
    20140104060000                       Y2014M1D4  Y2014M1D4  04-JAN-14                1 Y2014M1                        Y2014M1                                  31-JAN-14                   31 Y2014                          Y2014                                    31-DEC-14                365
    I then created my TIME dimension with DAY as the lowest level.
    When I try the maintain cube option it fails at the 'LOAD NO SYNCH' step with the rejected records having an error message that says:
    ORA-35563: (XSRWLD17) Multiple values exist for an attribute of this dimension member.
    To me, this is a very cryptic message and the only explanation I find online is:
    Cause
    Multiple source table rows containing different values for a dimension attribute were found. Only the first of the multiple rows has been loaded.
    Action
    Fix the mapping or remove the rows with conflicting attribute values..
    This confuses me. In the tutorial the lowest level was day and the TIMES table contained 1 record for each day.
    In my example, the lowest level is hour and the TIMES table contains 1 record for each hour.
    Which attribute has multiple values? And which values?
    The rejected records (101) are not very clear:
    ALIAS_1 = 'MONTH_Y2014M1' AND ALIAS_3 = to_date('31JAN14') AND ALIAS_4 = 31 AND ALIAS_5 = 'Y2014M1' AND ALIAS_6 = 'Y2014M1' AND ALIAS_7 = 'YEAR_Y2014'
    If anyone can help point me in the right direction, it would be greatly appreciated.

    I have seen this recently. The issue is with the dimension load itself.  You have a hour level record table but the rules relating to hierarchy/attribute values etc are checked/reinforced during the load and this error comes up sometimes.
    I would guess that the issue seems to be with your month level information present in the higher level month columns. There are many records corresponding to a single month in ur case, month of Y2014M1. Information relating to Month level member Jan 2014 or member MONTH_Y2014M1 is present in these records: 31 (days) *24 (hours) = 744 records. The data in these 744 records for columns - MONTH_ID, MONTH_NAME, MONTH_END_DATE, MONTH_TIME_SPAN need to be exactly the same in order for the single member MONTH_Y2014M1 to have month attributes loaded with valid values.
    For e.g: if records #1 to #743 contain month_timespan=31 but for some unknown reason record #744 contains month_timespan=30 then this error will come up. OLAP does not know which value to load (31 or 30), and only 1 value can be loaded onto the month level member corresponding to month Y2014M1.
    A quick check of the data should give you the answer. Typically there may be some mistake/invalid assumptions made with the boundary records (in your case, check for values for records corresponding to hour=0 or hour=23/24) which is causing the issue.
    HTH
    Shankar

  • Inconsistent Behavior : error code 20 - attribute or value exists

         We are getting "error code 20 - attribute or value exists" randomly when we try to create a new user in the LDAP system. This error is thrown so randomly that it is really driving us crazy. With same values for all other mandatory fields and with just a different userId, this error is thrown for some cases and not for others. The entry is also NOT getting created in LDAP. We are able to create the same entry directly at the LDAP through jXxplorer.
    Stack Trace:
    Caused By: javax.naming.directory.AttributeInUseException: [LDAP: error code 20 - Attribute Or Value Exists]; remaining name 'cn=sdoc,cn=Users,dc=xxx,dc=xxx'
        at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3051)
        at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:3013)
        at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2820)
        at com.sun.jndi.ldap.LdapCtx.c_createSubcontext(LdapCtx.java:791)
        at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_createSubcontext(ComponentDirContext.java:319)
        at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.createSubcontext(PartialCompositeDirContext.java:248)
        at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.createSubcontext(PartialCompositeDirContext.java:236)
        at javax.naming.directory.InitialDirContext.createSubcontext(InitialDirContext.java:178)
    Is is a bug in rt.jar? We are using JRE1.6.45. Is there anyway we can increase the logging at the rt.jar?
    Is there anyway we can bypass this error?
    Your help is highly appreciated.

    I found out the reason already. The schema was not configured properly :)

  • Retrieving the row number where a certain value exists

    Hi,
    I wanted to find out if there is a way to retrieve the row number of a row where a certain value exists. For example, if I had a query
    Create or replace Procedure p1
    IS
    v_Stmt varchar2(100);
    BEGIN
    v_Stmt := 'Select * from emp where lname = 'Davis'';
    Execute Immediate v_Stmt;
    END;
    SQL> exec p1;
    Then, I would like to find out that this name is on row 3.
    Can anyone tell me how this can be done?
    Thanks in advance.
    Sincerely,
    Nikhil Kulkarni

    theres is no rownum related to a particular row. A rownum is a pseudocolumn which value may be different for the same row depending on the query you do. What you can use is the rowid which is the row's address.
    HTH
    Maurice

  • How we find that value exists in block or not??

    Hi All:
    I am building form in 10 g enviornment. I want to know that at execution time, that value exists in block or not. Beacuse I want to execute query only at this time when no value in block. its a tab sheet form. When I enter value in block. And then go to other block. then the previous block value disappears( query executes). Please every body know. Help me . Thanks
    Ali

    You could check the block query status?
    v_status := get_block_property(<block_name>,STATUS);
    From the help:
    STATUS Returns the VARCHAR2 value NEW if the block contains only new records, CHANGED if the block contains at least one changed record, and QUERY if the block contains only valid records that have been retrieved from the database.

  • System error occurred (RFC call),key value exists in duplicate

    hi bw expert ,
    i happen the error report.
    "system error occurred (RFC call).
    key value exists in duplicate (Not allowed by the ODS object type).
    Activation of data records from ODS object Z08TRFKP terminated.
    No confirmation for request odsr_80p13w4lqhnib3g9tiflvth56 when activating ODS object Z08TRFKP.
    Request REQU_EVZB7CK82H7YMS13X3G42GKQY , data package 000001 contains errors with status 5 .
    Request REQU_EVZB7CK82H7YMS13X3G42GKQY , data package 000001 not correct.
    Inserted records 1- ; Changed records 1- ; Deleted records 1-
    pls, help me .
    thanks.

    hi experts,
    the first, i initial update the data from r3 to bw ods, it is successful. the second, the system automatic touch off delta update from r3 to bw ods. it is false. now i have deleted the false delta update and repeat extractive. but it is also error.
    please help me again.
    thanks.

  • How to check node value exists or not?

    for example
    <Hi>1</Hi>
    here for Hi value exists or not need to check.

    SQL> create table MY_XML_TABLE of XMLTYPE
      2  /
    Table created.
    SQL> insert into MY_XML_TABLE values ( XMLTYPE('<FOO><H1>FOO</H1><H2/></FOO>') )
      2  /
    1 row created.
    SQL> commit
      2  /
    Commit complete.
    SQL> set feedback on
    SQL> select *
      2    from MY_XML_TABLE
      3   where XMLExists('$x/FOO/H1' passing OBJECT_VALUE as "x")
      4  /
    SYS_NC_ROWINFO$
    <FOO>
      <H1>FOO</H1>
      <H2/>
    </FOO>
    1 row selected.
    SQL> select *
      2    from MY_XML_TABLE
      3   where XMLExists('$x/FOO/H1/text()' passing OBJECT_VALUE as "x")
      4  /
    SYS_NC_ROWINFO$
    <FOO>
      <H1>FOO</H1>
      <H2/>
    </FOO>
    1 row selected.
    SQL> select *
      2    from MY_XML_TABLE
      3   where XMLExists('$x/FOO/H2' passing OBJECT_VALUE as "x")
      4  /
    SYS_NC_ROWINFO$
    <FOO>
      <H1>FOO</H1>
      <H2/>
    </FOO>
    1 row selected.
    SQL> select *
      2    from MY_XML_TABLE
      3   where XMLExists('$x/FOO/H2/text()' passing OBJECT_VALUE as "x")
      4  /
    no rows selected
    SQL>

  • MATKL missing in IDoc but value exist in PO

    Hi Experts,
    PO caught Runtime Exception in Message-Mapping transformation as it
    cannot produce target element because of the missing field IDoc material class (MATKL) in the segment E1EDP01.
    and when I checked the PO in R/3, it got the field with value (but not going to IDoc) and on clicking the Messages it shows Outtype ZALE ( PO for ALE) with status No communication data has been defined for transmission medium A.
    Is this the cause of error?
    Please suggest on how to rectify this issue.
    Thanks in advance,
    MK

    Please suggest on why the field is missing in the IDoc, when it exists in the PO.

  • Alert On UDF's when Duplicate value exists

    Hi Experts,
    I want an Alerts message on a UDF's Gate Entry Pass (G.E. No), when any duplicate value is entered in this UDF's.
    e.g.:-  a value is entered in this udf is 30.  when same value is entered it should give an alert that value already exists.
    Thanks & Regards,
    Pankaj Sharma.

    Hi Gordon,
    I am using this UDF's on the GRPO Form and the UDF's name is U_GE_NO(Gate Entry No). my client  uses this field when the material entered the company premises and entered the unique value. so to remove duplicacy in data the want the alert.

  • Trigger that checks if value exists in another table before insert

    Hi,
    Can any one help me with the correct code.
    I am trying to write a trigger that checks if the new value (:new.T1) does not exist in another table (T2) before entering it (in T1).
    Create or replace trigger T1
    BEFORE
    insert on T1
    for each row
    Declare
    x Number;
    begin
    SELECT Count (*) INTO x
    From T2 WHERE T2.Col1 = :new.T1;
    IF (x > 1 or x = 1) Then
    DBMS_OUTPUT.PUT_LINE('This value has been used before try another one.');
    END IF;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    INSERT INTO T2 (Col1) values (:new.T1);
    WHEN TOO_MANY_ROWS THEN
    DBMS_OUTPUT.PUT_LINE('This value has been used before try another one.');
    end;

    I think this question is suitable for the SQL and PL/SQL forum.

  • Add some values from array B into array A only if other values exist in both.

    Hi everyone,
    If I have reference array $Food that has 2 property names that I'm going to use to compare to another array.....
    Pie                 WasAte
    blueberry         no
    pecan               no
    raspberry           no
    And I collect another array called $HeAte.Pie that has values ( pie names ) I want to compare to the above $Food.Pie
    Plus I want to edit values of $Food.WasAte to "true" at the same row number or index of $Food where also $Food.Pie matches $HeAte.Pie  So In this way I'm adjusting my reference array to show which pies I ate after considering the
    comparison array.
    I'm stuck.  I was actually making progress but I realized I had almost 30 lines of code of something.  I must be doing this wrong. I realize this is an elementary question but if some pro could point me in the right direction ..... I'm trying
    my best this year to learn powershell and spread its power.

    Something like that?
    Compare-Object -ReferenceObject $Food -DifferenceObject $HeAte -Property pie -ExcludeDifferent -IncudeEqual | select pie | foreach { $food[$food.pie.IndexOf($_.pie)].wasat = 1 }
    Powershell include powershell cmdlet like Compare-Object, Select-Object, Sort-Object that can make code much more simpler by masking underlying complexity.
    Bruce Jourdain de Coutance - Consultant MVP Exchange http://blog.brucejdc.fr

  • Handling the case when no value exists

    Hello,
    I am reading in the documentation about the Context class and the lookup function, but it does not state clearly what it does when a value is not found in the naming service. Does it return null, throw an exception, or what?
    Thanks.

    Please do not re-post. It would be easier to follow up a single thread.

Maybe you are looking for

  • Upgrade to iPhone 5 and keep unlimited data.. will this work???

    Here is my situation.. The wife and I upgraded to the iPhone 4's right when Verizon got them, and got the unlimited data plan.  Now as I understand it, to upgrade to the iPhone 5 directly, I have to choose a new plan since unlimited is no longer offe

  • Sending vocal tracks to an Aux channel with reverb

    Sorry for this question that may have been answered somewhere else. I'm trying to add a single reverb plug-in to 6 vocal tracks. I've bussed all 6 to an Aux channel via bus 1, setting the input of the Aux channel to bus 1. No sound. I can't seem to f

  • What are the different ways in accessing the SQL server from NWDS ?

    Hi Experts, Can anyone suggest the different ways for accessing the SQL server from NWDS.I also want to know whether any tool is available for accessing SQL server from Webdynpro java application in Netweaver development studio. I am currently using

  • Transport and Program Relation Database table

    Hello, From which database table we can find program and its active transport request details? I need to check all Z programs requests from DEV to PRD. Thanks, Krishna.

  • How to eliminate darkened areas after applying flatten transparency?

    I just upgraded by CS to 5.5 here in the last couple of weeks (I had purchased it prior to 6 being launched). Any way, I've noticed on some ads I create, when I save as an EPS and then go to "flatten transparency" that sometimes it is taking elements