Empty strings

How can i effectively detect for empty strings, i'va tried "if (someString.length()==0) ... " and the expression "(someString=="")".
who can explain????
gr. Razorblade

I agree with levi_h,. It's a common mistake to compare a string object with a known (static) string in the wors of orders (s.equals("mystring") vs "mystring".equals(s))... The last one is safe, it will never throw a NullPointerException if s is null.
I usually implement a method in a utility class that looks like this.
public static final String isNullOrEmpty(final String s) {
  return s == null || s.length() == 0;
}Regards,
  //Håkan
PS. Checking the length of a string is much faster than comparing it with an empty string...
public class sequals {
  public static final long start() {
    return System.currentTimeMillis();
  public static final long stop(final long l) {
    return start() - l;
  public static final boolean test1(final String s) {
    return s.equals("");
  public static final void test1(final String s, final int n) {
    for (int i = 0; i < n; ++i) {
      test1(s);
  public static final boolean test2(final String s) {
    return s.length() == 0;
  public static final void test2(final String s, final int n) {
    for (int i = 0; i < n; ++i) {
      test2(s);
  public static final void main(final String[] args) {
    final int times = 1000000;
    long n1    = start();
    test1("Am I empty?", times);
    n1 = stop(n1);
    long n2    = start();
    test2("Am I empty?", times);
    n2 = stop(n2);
    System.out.println("Test1: " + n1 + " ms.");
    System.out.println("Test2: " + n2 + " ms.");
}

Similar Messages

  • Cannot assign an empty string to a parameter with JDBC type VARCHAR

    Hi,
    I am seeing the aforementioned error in the logs. I am guessing its happening whenever I am starting an agent instance in PCo. Can somebody explain whats going on?
    Regards,
    Chanti.
    Heres the complete detail from logs -
    Log Record Details   
    Message: Unable to retreive path for , com.sap.sql.log.OpenSQLException: Failed to set the parameter 1 of the statement >>SELECT ID, PARENTID, FULLPATH, CREATED, CREATEDBY, MODIFIED, MODIFIEDBY, REMOTEPATH, CHECKEDOUTBY FROM XMII_PATHS WHERE FULLPATH =  ?  <<: Cannot assign an empty string to a parameter with JDBC type >>VARCHAR<<.
    Date: 2010-03-12
    Time: 11:32:37:435
    Category: com.sap.xmii.system.FileManager
    Location: com.sap.xmii.system.FileManager
    Application: sap.com/xappsxmiiear

    Sounds like a UI browsing bug (when no path is selected from a catalog tree folder browser) - I would suggest logging a support ticket so that it can be addressed.

  • Oracle, Null and empty Strings

    Currently I'm facing problems with a class, which contains a String, which
    is set to "" (empty String).
    When the class is persistent, oracle writes null to the table column
    (which seems to be common oracle behaviour) and when retrieving the class,
    the field is set to null as well, giving me a lot of null-pointer
    exceptions.
    Anyway ... I can cope with that (just a lot of extra work)
    far worse is the problem, wenn searching objects, that have this field set
    to "" oder null.
    Oracle can't find the records because JDO creates Querys "where
    string=null" or "where string=''" , where oracle expects "where string is
    null" to find the records.
    Is there a workaround or solution ?

    Yeah, that would work as well, thx, but since I have to cope with
    null-Strings now everywhere in my program, it doesn't hurt just to forbid
    empty strings on the program side.
    In future times I'll test on Oracle first, then porting to DB/2 - this way
    I suppose work is far less to garant compability.
    Nevertheless ... having to set the bankcode into quotes is a kodo bug in
    my opinion.
    Kodo knows the type of classfields (in this case string) and shouldn't
    send the parameter as a BigDecimal to the database.
    Given that, and having only bankcodes of null (only neccesary when using
    Oracle), the method would look like:
    public Collection getAccounts (String bankCode)
    throws Exception
    return getAccounts (Account.class, "bankcode=="+bankcode);
    which is how a transparent persistent layer, um, should be , um , I mean
    ... just transparent ;-D
    Marc Prud'hommeaux wrote:
    Stefan-
    Couldn't you just do something like:
    public Collection getAccounts (String bankCode)
    throws Exception
    String filter;
    if (bankCode == null || bankCode.length () == 0)
    filter = "(bankCode == null || bankCode == "")";
    else
    filter = "bankCode == "" + bankCode + """;
    return getAccounts (Account.class, filter);
    If I understand the problem correctly, this should work for all the
    databases.
    In article <[email protected]>, Stefan wrote:
    What operations are you performing to cause this SQL to be issued? You
    say you are having trouble removing objects, but this is clearly not a
    DELETE statement. Is this the SQL that is issued when looking up
    objects by identity?I'm not removing objects, I was removing just quotes from parameters ;-)
    A string column... is it also represented as a string field in your class?Yeah ... just to give you an impression of the code:
    First we have a class, representing a bank account:
    public class Account {
    private AccountMgr myAccountMgr;
    private String bankCode;
    private String id;
    Note, that in nearly all cases bankCode will be a number or null.
    I have a second class "AccountMgr", which does all of the persistant stuff
    (seaching, making persistent etc.)
    This class has two methods, one versatile (protected) to retrieve accounts
    by a given filterString and one who just returns accounts by bankCode,
    building the expected filterstring. Here is my current working version:
    public class AccountMgr {
    public Collection getAccounts(String bankCode) throws Exception {
    if (bankCode!=null) {
    if (bankCode.equals("")) {
    throw new Exception("check code, bankCode='' not allowed to get
    same behavior from DB2 and Oracle");
    // if set, quote the bankCode
    bankCode="""+bankCode+""";
    return getAccounts(Account.class,"bankCode=="+bankCode);
    protected Collection getAccounts(Class accountClass, String filterAdd)
    throws Exception {
    PersistenceManager pm = MyHelper.getPersistenceManager();
    String filter="";
    if (filterAdd!=null && !filterAdd.trim().equals("")) {
    filter+=filterAdd + " && ";
    filter += "myAccountMgr==_accMgr";
    Query query = pm.newQuery(accountClass, filter);
    query.declareParameters("AccountMgr _accMgr");
    return (Collection) query.execute(this);
    As you can see, in the first method I have to set the bankCode into
    quotes, when it's not null.
    This is because otherwise a filter like "bankCode=1234" will be translated
    in a way, where 1234 is send as a BigDecimal to the database:
    [...] executing statement <4239745>: (SELECT [...] FROM JDO_ACCOUNT t0
    WHERE t0.BANKCODE = ? : [reused=1;params={(BigDecimal) 1234}]
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com

  • NULL and Empty String

    Hi There,
    As far as I know, Null is not the same as an empty string; however, when I try this out, I get some unexpected results (well, at least unexpected for my liking):
    SQL> CREATE TABLE TS (MID NUMBER,
      2  MDESC VARCHAR2(20) DEFAULT '' NOT NULL);
    Table created.
    SQL> INSERT INTO TS VALUES(1,'');
    INSERT INTO TS VALUES(1,'')
    ERROR at line 1:
    ORA-01400: cannot insert NULL into ("TT"."TS"."MDESC")So, according to the above scenario, I can't insert an empty string!! However, an empty string is a valid string that doesn't have tuples/data!!
    How come Oracle translates the null string '' as NULL?
    Thanks

    William Robertson wrote:
    There is a special case to do with CHAR values, whereby '' counts as a string and so gets blank-padded, whereas NULL does not.Are you referring to:
    SQL> DECLARE
      2      flag CHAR(2);
      3      PROCEDURE check_null (p_flag IN CHAR)
      4      IS
      5      BEGIN
      6        IF p_flag = '  '
      7        THEN
      8          dbms_output.put_line ('flag is equal to ''  ''');
      9        ELSIF p_flag IS NULL
    10        THEN
    11          dbms_output.put_line ('flag is null');
    12        ELSE
    13          dbms_output.put_line ('other');
    14        END IF;
    15      END;
    16    BEGIN
    17      flag := '';
    18      check_null (flag);
    19      flag := NULL;
    20      check_null (flag);
    21    end;
    22  /
    flag is equal to '  '
    flag is null
    PL/SQL procedure successfully completed.
    SQL> alter session set events '10932 trace name context forever, level 16384';
    Session altered.
    SQL> DECLARE
      2      flag CHAR(2);
      3      PROCEDURE check_null (p_flag IN CHAR)
      4      IS
      5      BEGIN
      6        IF p_flag = '  '
      7        THEN
      8          dbms_output.put_line ('flag is equal to ''  ''');
      9        ELSIF p_flag IS NULL
    10        THEN
    11          dbms_output.put_line ('flag is null');
    12        ELSE
    13          dbms_output.put_line ('other');
    14        END IF;
    15      END;
    16    BEGIN
    17      flag := '';
    18      check_null (flag);
    19      flag := NULL;
    20      check_null (flag);
    21    end;
    22  /
    flag is null
    flag is null
    PL/SQL procedure successfully completed.
    SQL> SY.
    P.S. Don't ask me why normal (or at least consistent) behavior is not the default.

  • Null and empty string not being the same in object?

    Hello,
    I know that null and empty string are interpreted the same in oracle.
    However I discovered the strange behaviour concerning user defined objects:
    create or replace
    TYPE object AS OBJECT (
    value VARCHAR2(2000)
    declare
    xml xmltype;
    obj object;
    begin
    obj := object('abcd');
    xml := xmltype(obj);
    dbms_output.put_line(xml.getStringVal());
    obj.value := '';
    xml := xmltype(obj);
    dbms_output.put_line(xml.getStringVal());
    obj.value := null;
    xml := xmltype(obj);
    dbms_output.put_line(xml.getStringVal());
    end;
    When creating xml from object, all not-null fields are transformed into xml tag.
    I supposed that obj.value being either '' or null will lead to the same result.
    However this is output from Oracle 9i:
    <OBJECT_ID><VALUE>abcd</VALUE></OBJECT_ID>
    <OBJECT_ID><VALUE></VALUE></OBJECT_ID>
    <OBJECT_ID/>
    Oracle 10g behaves as expected:
    <OBJECT><VALUE>abcd</VALUE></OBJECT>
    <OBJECT/>
    <OBJECT/>
    However Oracle 9i behaviour leads me to the conclusion that oracle
    must somehow distinguish between empty string and null in user defined objects...
    Can someone clarify this behaviour?
    Thus is it possible to test if object's field is empty or null?

    However Oracle 9i behaviour leads me to the conclusion that oracle
    must somehow distinguish between empty string and null in user defined objects...
    Can someone clarify this behaviour?
    Thus is it possible to test if object's field is empty or null?A lot of "fixes" were done, relating to XML in 10g and the XML functionality of 9i was known to be buggy.
    I think you can safely assume that null and empty strings are treated the same by Oracle regardless. If you're using anything less than 10g, it's not supported any more anyway, so upgrade. Don't rely on any assumptions that may appear due to bugs.

  • Difference in Null and Empty String

    Hi,
    I have been wondering about the difference between Null and Empty String in Java. So I wrote a small program like this:
    public class CompareEmptyAndNullString {
         public static void main(String args[]) {
              String sNull = null;
              String sEmpty = "";
              try {
                   if (sNull.equalsIgnoreCase(sEmpty)) {
                        System.out.println("Null and Empty Strings are Equal");
                   } else {
                        System.out.println("Null and Empty Strings are Equal");
              } catch (Exception e) {
                   e.printStackTrace();
    This program throws Exception: java.lang.NullPointerException
         at practice.programs.CompareEmptyAndNullString.main(CompareEmptyAndNullString.java:10)
    Now if I change the IF Clause to if (sEmpty.equalsIgnoreCase(sNull)) then the Program outputs this: Null and Empty Strings are Equal
    Can anyone explain why this would happen ?
    Thanks in Advance !!

    JavaProwler wrote:
    Saish,
    Whether you do any of the following code, the JUnit Test always passes: I mean he NOT Sign doesnt make a difference ...
    assert (! "".equals(null));
    assert ("".equals(null));
    You probably have assertions turned off. Note the the assert keyword has nothing to do with JUnit tests.
    I think that older versions of JUnit, before assert was a language keyword (which started in 1.4 or 1.5), had a method called assert. Thus, if you have old-style JUnit tests, they might still compile, but the behavior is completely different from what it was in JUnit, and has nothing to do with JUnit at all.
    If you turn assertions on (-ea flag in the JVM command line, I think), the second one will throw AssertionError.

  • Xmltype.getnumberval() Returns "0" when attribute is an empty string.

    Hi,
    At my workplace we have noticed that when retrieving the value of a numeric attribute of an XML element we are getting "0" when the attribute's value is an empty string (see below for an example script).
    We can't find a reference to this in the documentation but I assume this is expected behavior. Has anyone else experienced this and has anyone else used an alternative work around to the following solution that we are using (with the understanding that it is a third party that is sending us the XML so we cannot just do the sensible thing and make sure the XML doesn't contain attributes with no value)?
    Solution we are using:
    variable := to_number(xml.extract('node()/@numeric_attribute').getstringval());
    Example Script:
    SET serverout ON
    DECLARE
      i xmltype;
    BEGIN
      -- Test statements here
      i := xmltype('<element a="" b="1" c="" d="abc" />');
      -- Get Number Values
      dbms_output.put_line('a=[' || i.extract('node()/@a').getnumberval() || ']*');
      dbms_output.put_line('b=[' || i.extract('node()/@b').getnumberval() || ']');
      -- Get String Values
      dbms_output.put_line('c=[' || i.extract('node()/@c').getstringval() || ']');
      dbms_output.put_line('d=[' || i.extract('node()/@d').getstringval() || ']');
      -- Get String then perform to_number()
       dbms_output.put_line('a (using to_number() on getstringval()=[' || to_number(i.extract('node()/@a').getstringval()) || ']');
      dbms_output.put_line('');
      dbms_output.put_line('*Even though value of attribute in element is an empty string, the getnumberval() function converts this to a 0');
    END;
    Thanks.

    We can't find a reference to this in the documentation but I assume this is expected behavior. Has anyone else experienced this and has anyone else used an alternative work around to the following solution that we are using (with the understanding that it is a third party that is sending us the XML so we cannot just do the sensible thing and make sure the XML doesn't contain attributes with no value)?
    Yes, I remember seeing a thread or two about that in the past.
    Your workaround is probably the best you can come up with if you want to stick to this approach.
    Extractvalue() function works too but it is SQL only.
    However, bear in mind that those functions are deprecated in your version.
    Use XMLQuery to extract scalar values or XMLTable to extract multiple values as relational columns.

  • Select text from all_views returns an empty string

    My application allows the user to select between the Data Provider for ODBC and the Data Provider for Oracle. (ODP)
    When using the ODBC provider the statement:
    Select text from all_views where view_name='MYVIEW'
    returns the expected string.
    If I connect via ODP however it returns an empty string.
    (If I use 'Select *' it tells me the text_length is 154 in this specific case - so there is definately text available.)
    I'm thinking it has something to do with the fact that the data type is LONG.
    In both cases I retreive the data using rdr.GetChars(), which should work.
    If I use the dbms_metadata.get_ddl function instead, it does return the string (Probably because the return type is not LONG)
    Unfortunately that function only works for Views in the current schema, while the original Select works for any view.
    (And I dont know what version of Oracle this function was added in - I have to support older versions too.)
    Similarly, if I use one of the XML functions to retreive the text as XML it works fine.
    (Again it is probably returned as a VARCHAR2 instead of a LONG.)
    The strange thing is that when I created my own table containing a LONG column I was able to load and retreive data without any problems.
    The problem appears to be specific to this column in all_views.
    Anyone know a solution to this?
    Thanks
    Mike

    Thanks that was it.
    I had not seen those properties since I am working with the 'generic' objects (DbCommand rather than OracleCommand, etc.)
    What is strange is that I was able to retreive data from my own LONG column WITHOUT setting this value to -1.
    (It defaulted to 0 in both cases.)
    The only difference was that when I retreived data from my own column I specified CommandBehaviour.SequentialAccess.
    When I retreived the all_views.text column I did not specify a behaviour at all.
    However the Oracle docs said that SequentialAccess is not supported ... so I guess that is not correct.
    (Maybe it doesn't 'work', but it certainly seems to cause things to work differently)
    Thanks
    Mike

  • BaseFileName cannot be nothing or an empty String during Test Connection

    Dear All,
    I have FDM+Foundation+HSF 11.1.2 installed
    I have stacked with the following problem:
    when I try to Test Connection (Authentication Provider Window) during Load Balance Configuration I am getting
    +“BaseFileName cannot be nothing or an empty String+
    Parameter name: value”
    Can somebody help me with it?
    Best Regards,
    Siarhei

    same error i faced, i restarted the APP server and it worked then.

  • PHP Show if hides update fields, but they get overwritten with an empty string

    I have an issue with a page where some update fields are displayed depending on who is logged, for example:
    <?php if ($row_Users['UserID']=="101"){ ?>
    <input <?php if (!(strcmp($row_lodges['101_finalist'],"Yes"))) {echo "checked=\"checked\"";} ?> type="checkbox" name="101_finalist"  value="Yes"/>
    <input type="text" class="rankfield" name="101_rank" value="<?php echo($row_lodges['101_rank']); ?>" />
    <?php }  ?>
    <?php if ($row_Users['UserID']=="102"){ ?>
    <input <?php if (!(strcmp($row_lodges['102_finalist'],"Yes"))) {echo "checked=\"checked\"";} ?> type="checkbox" name="102_finalist"  value="Yes"/>
    <input type="text" class="rankfield" name="102_rank" value="<?php echo($row_lodges['102_rank']); ?>" />
    <?php }  ?>
    The issue I have is that if User101 is logged in and updates fields 101_finalist and 101_rank, it overwrites 102_finalist and 102_rank with an empty string.
    Is it possible to prevent each user from seeing the other fields for other users, and prevent the existing values for those other users not be overwritten?
    Hope that makes sense!
    Thank you.

    That would mean multiple nominations when really there only needs to be one nomination per category in any given country.
    It would be:
    1, 345, 101, Borana Lodge, 7, 2, Yes, 1
    1, 345, 102, Borana Lodge, 7, 2, Yes, 3
    1, 345, 103, Borana Lodge, 7, 2, No, NULL
    Instead of:
    1, 345, Borana Lodge, 7, 2, Yes, 1, Yes, 3, No, NULL
    Sorry, Lodge isn't in the nominations table, the list above is what is displayed on the site. Lodge gets looked up in the Ldoges table.
    At the moment it works like this:
    People can visit a website and vote for lodges in different categories, giving them a score out of 10 for each.
    If a lodge gets a vote in a particular category an admin person creates a nomination for that lodge, in that category.
    And the last bit is where judges login and tag the ones they think should be finalists.

  • Setting input fields to an empty string BIG PROBLEM

    Hi Rob, thanks for your rerply, It makes sense alright, but I am using 2 seperate input fields. I have discovered what is causing the problem .
    After the user types into the inputfield and moves on to a different frame, I have set the input field to an empty string and this is what is causing the problem.
    I have tried setting the input field to an empty string in a movie script and on individual sprites and the first right answer is not excepted.I have to type in the right answer twice to get get a right response. I am actually using three seperate input fields in total, each with a different name and behavior. Even If I use one input field I still have the same problem. Its driving me crazey. Any Ideas.
    Anne

    I believe that the FIM Service always does trims on string, so you may be out of luck.
    What is your scenario / what are you trying to accomplish by setting a space in an attribute? A space is not an empty string in my definition.
    Regards, Soren Granfeldt
    blog is at http://blog.goverco.com | facebook https://www.facebook.com/TheIdentityManagementExplorer | twitter at https://twitter.com/#!/MrGranfeldt

  • What happens when a OUT parameter of a web-service returns an empty string

    Hi,
    Any idea on how to deal with the situation when a web-service returns an empty string
    I get the following System Exception:-
    Caused by: java.lang.AssertionError: Attempt to set empty javaType to ticketResponse(out,0) :: fuego.type.FuegoClass$LazyRef@6770f2. It must be null or a valid java type.
    It therefore either expects a null value or a valid java type...
    Since it goes into a system exception, the activity is not completed and nothing is inserted into the web-service..
    How do we resolve this error inside of BPM?

    Thanks Ben for your replies.
    Before I attempt changing a VI that was written by a client and make a total mess of it, there's something I'd like to point out.
    I tried the re-entrant VI approach and that didn't go any further than the VIT approach, and probably for the same reason(s).
    The interesting part is that (with the VIT approach) the same VIT is called by another process and it works fine.  It is just for the process that has it appear within 2 sub-panels.  So the issue is related to having either having two instances spawn at once of the same VIT or it is related to the sub-panels.  I think it is the two instances (or copies of the VIT) that causes LV to caugh...
    So you are trying to tell me that the above description is accurate and it is because of the private methods...??...
    How would I "wrap" those private methods into public ones?  The seems to be a piece of this puzzle that I am not yet grasping..
    Thanks for your patience and help.
    RayR

  • SQLLDR - how to set a default value for an empty string

    I'm using SQLLDR to load data from a flat file on Oracle 10g 10.2.0.4 EE, Linux RHEL 4 update 6. Seems like my question is simple, but darned if I can't find the solution.
    My source file (comma delimited extracted form a different RDBMS) has some (not all) rows where the output for a string is "", and not NULL. How do I check for empty string and add a default value in the control file? The target column is non-nullable
    Here's my current control file - however, the column attributeName where sometimes the source record is "" does not get evaluated as NULL.
    load data
    infile 'mydata.del'
    badfile 'mydata.bad'
    discardfile 'mydata.dsc'
    into table mydata
    fields terminated by "," optionally enclosed by '"'
       TRAILING NULLCOLS           
    (l_metadata,
    company,
    className,
    attributeName "decode(:vc_attributeName,null, 'none')",
    attributeDefault)
    {code}
    When I tried decode with "", I received the following error:
    {code}SQL*Loader-350: Syntax error at line 11.
    Expecting "," or ")", found ", 'none')".
    attributeName "decode(:vc_attributeName,"", 'none')", {code}
    This does not work either:
    {code}
    load data
    infile 'mydata.del'
    badfile 'mydata.bad'
    discardfile 'mydata.dsc'
    into table mydata
    fields terminated by "," optionally enclosed by '"'
       TRAILING NULLCOLS           
    (l_metadata,
    company,
    className,
    attributeName NULLIF attributeName = BLANKS ,"decode(:vc_attributeName,null, 'none')",
    attributeDefault) I get the following in the log:
    Table COMPANYMETADATA, loaded from every logical record.
    Insert option in effect for this table: INSERT
    TRAILING NULLCOLS option in effect
       Column Name                  Position   Len  Term Encl Datatype
    L_METADATA                          FIRST     *   ,  O(") CHARACTER
    COMPANY                            NEXT     *   ,  O(") CHARACTER
    CLASSNAME                         NEXT     *   ,  O(") CHARACTER
    ATTRIBUTENAME                     NEXT     *   ,  O(") CHARACTER
        NULL if ATTRIBUTENAME = BLANKS
        SQL string for column : "decode(:attributeName,null, 'none')"
    ATTRIBUTEDEFAULT                  NEXT     *   ,  O(") CHARACTER
    Record 1: Rejected - Error on table COMPANYMETADATA, column ATTRIBUTENAME.
    ORA-01400: cannot insert NULL into ("SRV5"."COMPANYMETADATA"."ATTRIBUTENAME")
    {code}
    Any help is appreciated -
    Edited by: kpw on Feb 9, 2009 11:10 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Hello,
    I just loaded following data successfully in my_data table using the same control file I posted. Yes it will evaluate "" as null and replace with none, remember in control file you have this option, "optionally enclosed by '"'.
    #my_data.dat
    "myname1", "attribname1"
    "myname2", "attribname2"
    "myname3", "attribname3"
    "myname4", ""
    #my_data.ctl
    load data
    into table my_data
    fields terminated by "," optionally enclosed by '"'
    TRAILING NULLCOLS           
    my_name char(30),
    vc_attributeName "decode(:vc_attributeName,null, 'none', :vc_attributeName)"
    {code}
    Here is the output log file
    {code}
    Control File:   my_data.ctl
    Data File:      mydata.dat
      Bad File:     mydata.bad
      Discard File:  none specified
    (Allow all discards)
    Number to load: ALL
    Number to skip: 0
    Errors allowed: 50
    Bind array:     64 rows, maximum of 256000 bytes
    Continuation:    none specified
    Path used:      Conventional
    Table MY_DATA, loaded from every logical record.
    Insert option in effect for this table: INSERT
    TRAILING NULLCOLS option in effect
       Column Name                  Position   Len  Term Encl Datatype
    MY_NAME                             FIRST    30   ,  O(") CHARACTER           
    VC_ATTRIBUTENAME                     NEXT     *   ,  O(") CHARACTER           
        SQL string for column : "decode(:vc_attributeName,null, 'none', :vc_attributeName)"
    Table MY_DATA:
      4 Rows successfully loaded.
      0 Rows not loaded due to data errors.
      0 Rows not loaded because all WHEN clauses were failed.
      0 Rows not loaded because all fields were null.
    Space allocated for bind array:                  18560 bytes(64 rows)
    Read   buffer bytes: 1048576
    Total logical records skipped:          0
    Total logical records read:             4
    Total logical records rejected:         0
    Total logical records discarded:        0
    Run began on Mon Feb 09 18:17:35 2009
    Run ended on Mon Feb 09 18:17:36 2009
    Elapsed time was:     00:00:00.98
    CPU time was:         00:00:00.10
    {code}
    Hope this helps clearing your dobuts
    Regards                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • [svn:bz-trunk] 11030: Tweak the deserialization of ASObjects to treat an empty string for the type of an object as null .

    Revision: 11030
    Author:   [email protected]
    Date:     2009-10-20 11:35:02 -0700 (Tue, 20 Oct 2009)
    Log Message:
    Tweak the deserialization of ASObjects to treat an empty string for the type of an object as null. It appears that there is some logic in the LC remoting code that relies on a non-null class name to always exist. This change reverts to the old behavior of not allowing empty string as a value for the ASObject.namedType.
    This should fix bug 2448442 and its duplicates caused by the recent serialization changes.
    I don't think this is the perfect fix. Pending further investigation, a better fix would be either:
    a. If it's OK to assume that empty string should always mean null for the type of the ASObject, the code that enforces it should be in the setter/getter inside ASObject and not in the deserializer.
    b. ASObject doesn't guarantee that a named type exists or is valid. In that sense an empty string is as bad as some random characters that cannot be a valid class name in java, so depending on how disruptive it may be, the fix should be in any logic that uses ASObject.getType().
    Modified Paths:
        blazeds/trunk/modules/core/src/flex/messaging/io/amf/AbstractAmfInput.java

    Hi Pavan,
    "In your payload there is no namespace prefix for the elements under PayloadHeader element."
    Yes, you are right - but this message is standard AQ Adapter Header message - it's not defined by me. I just used message which was automatically added to my project when I have defined AQ Adapter.
    "In your process is the default namespace is same as namespace value of tns ??"
    Do you mean targetNamespace? If yes it's different as it points to process "targetNamespace="http://xmlns.oracle.com/PF_SOA_jws/PF_APPS/APPS_PROCESS" (names of application and process have changed as I try different ways to do that)
    ns1 is: xmlns:ns1="http://xmlns.oracle.com/pcbpel/adapter/aq/PF_SOA/PF_APPS/PO_AQ"
    "another thing is tns and ns1 should have same values.."
    When I create a variable of header type, namespace ns1 is automatically created for it. I set it as property of receive activity. When process is instantiated on the serwer I get the error in which you can see that namespace is tns.
    Maybe I'm doing something wrong but I don't see how I could fix this in my process.
    You can see that the message I get on the server has nothing in common with the application/project/process names. Is it possible to define such variable?
    Regards
    Pawel
    PS:
    In Transformation xsl file, both variables (source and target) has tns namespace for Header and PayloadHeader, and no namespace for subfields.
    Edited by: pawel.fidelus on 2010-01-05 02:37

  • Dealing with an empty string parameter

    I'd think this should be simple but is driving me nuts. I have a string parameter (lets call it Foo) that is being passed from my C# application to a CR subreport. For this parameter field I have a formula associated with "Display String" similar to this:
    if (IsNull({?Foo}) or (length({?Foo}) = 0)) then
        "Value is empty"
    else
        "Value is " + {?Foo}
    I can never get the "Value is empty" line to appear! I've tried lots of suggestions:
    1. trim and check result equal to '' (two single quotes)
    2. test if equal to "".
    3. Adding false to Suppress.
    It appears that if this parameter is the empty string CR simply does nothing with my formulas and the entire parameter field is skipped.
    If I pass "null" (or any other special string) instead of "" from my C# code and then change the above test to check for that value as shown below things work properly.
            if (IsNull({?Foo}) or ({?Foo} = "null") then
    However I really don't like testing for a special string as there is the remote possibility that it could be the actual value of the parameter.
    Any help most appreciated.
    Dick

    Not surprised and willing to bet there will be a simple answer to this!
    There is something most odd happening when the string value is empty.
    Let me answer your questions.
    1 - How are you setting your parameter value?
    Since I want to be able to pass parameters to the base report as well as its subreports I'm using this method:
            protected void setParameter(string parameterName, object value)
                ParameterFields fields = report.ParameterFields;
                for (int i = 0; i < fields.Count; i++)
                    if (fields<i>.Name.Equals(parameterName))
                        string reportName = fields<i>.ReportName;
                        if (string.IsNullOrEmpty(reportName))
                        {   // give to base report
                            report.SetParameterValue(parameterName, value);
                        else
                        {   // give to subreport
                            report.SetParameterValue(parameterName, value, reportName);
    2 - What OS and service pack are you on?
    Windows XP, SP 3. All updates from MS installed.
    My development environment is either of these two:
    a. VS 2008. Version 9.0.30729.1 SP. ,NET Framework 3.5 SP1
    b. VS 2010 Version 4.0.30319
    3 - What platform are you targeting?
    For now just running on my XP PC but have tested our app on XP, Win7, and Vista. 32 and 64-bit version of each.
    4 - Is this a win or web form application? Win app
    5 - What is the version of your CrystalDecisions.CrystalReports.Engine?
    Version: 12.2.0.290, Product Type: Full
    6 - What is the version of crpe32.dll do you have on your machine?
    I only have one instance of this file in this directory:
         C:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86
    7 - Did you have one of our betas on this machine? No
    Edited by: dcowan on Dec 7, 2010 2:10 AM
    I needed to finish this so I'm closing it.
    In my C# code I placed the following:
                        if (string.IsNullOrEmpty(value))
                            value = "!_Empty_!";
    and in the CR formula I used:
           (IsNull({?CoBrandName}) or ({?CoBrandName} = "!_Empty_!"))
    Everything is now working just as I want. Not an ideal solution but I gave up.

  • JDBC Receiver does not convert empty string to NULL

    Hello experts,
    I am facing a problem with an INSERT statement to ORACLE DB where some of the fields are empty, for example:
    - <STATEMENT_VLP_CONT_DETAILS>
    - <TABLE_VLP_CONT_DETAILS ACTION="INSERT">
      <TABLE>VLP_CONT_DETAILS</TABLE>
    - <ACCESS>
      <VLP_HDR_ID>43</VLP_HDR_ID>
      <VLP_CONT_LINE_ID>1</VLP_CONT_LINE_ID>
      <QUANTITY>1</QUANTITY>
      <OWNER>CBHU</OWNER>
      <SERIAL_NO>3372739</SERIAL_NO>
      <CONT_ISO_CODE>2300</CONT_ISO_CODE>
      <WEIGHT>6.44</WEIGHT>
      <POL>ILASH</POL>
      <POD>FRFOS</POD>
      <FD>FRFOS</FD>
      <OPER_CODE>COS</OPER_CODE>
      <CUR_STOW_LOC>150102</CUR_STOW_LOC>
      <PRV_STOW_LOC />
      <HAZARDOUS>N</HAZARDOUS>
    In the JDBC Receiver comm channel I selected: Interpretation of Empty String Values = NULL Value.
    It seems the empty strings are not converted to NULL values as can be seen in the reflected SQL statement in RWB:
    INSERT INTO  VLP_CONT_DETAILS (VLP_HDR_ID, VLP_CONT_LINE_ID, QUANTITY, OWNER, SERIAL_NO, CONT_ISO_CODE, WEIGHT, POL, POD, FD, OPER_CODE, CUR_STOW_LOC, PRV_STOW_LOC, HAZARDOUS, EMPTY, REFER, OOG, HAZARD_IMDG, TEMP_SET, TEMP_MIN, TEMP_MAX, FRONT_OVL, REAR_OVL, RIGHT_OVW, LEFT_OVW, OVERHEIGHT, COMMODITY, BOOKING_REF, ALLOTMENT, YARD_LOC, LD_SEQ_CRANEID, LD_SEQ_NUMBER, LD_STATUS, STACKABLE, OPT_PORT_CODE1, OPT_PORT_CODE2, OPT_PORT_CODE3) VALUES (44, 1, 1, CBHU, 3372739 , 2300,  6.44, ILASH, FRFOS, FRFOS, COS,   150102,         , N, N, N, N,      ,      ,      ,      ,    ,    ,    ,    ,    ,     ,             ,    ,           ,    ,    0,    64, N,      ,      ,      )
    So, I am getting the following error:
    Could not execute statement for table/stored proc. "VLP_CONT_DETAILS" (structure "STATEMENT_VLP_CONT_DETAILS") due to java.sql.SQLException: ORA-00936: missing expression
    Help would be appreciated.

    Hi Effi,
    There is a mismatch in the field and thier value.
    Here field id 37
    VLP_HDR_ID, VLP_CONT_LINE_ID, QUANTITY, OWNER, SERIAL_NO, CONT_ISO_CODE, WEIGHT, POL, POD, FD, OPER_CODE, CUR_STOW_LOC, PRV_STOW_LOC, HAZARDOUS, EMPTY, REFER, OOG, HAZARD_IMDG, TEMP_SET, TEMP_MIN, TEMP_MAX, FRONT_OVL, REAR_OVL, RIGHT_OVW, LEFT_OVW, OVERHEIGHT, COMMODITY, BOOKING_REF, ALLOTMENT, YARD_LOC, LD_SEQ_CRANEID, LD_SEQ_NUMBER, LD_STATUS, STACKABLE, OPT_PORT_CODE1, OPT_PORT_CODE2, OPT_PORT_CODE3
    And value is 35
    44, 1, 1, CBHU, 3372739 , 2300, 6.44, ILASH, FRFOS, FRFOS, COS, 150102, , N, N, N, N, , , , , , , , , , , , , , , 0, 64, N, , ,
    Give empty values for nuil fields so that they can be made NULL by jdbc adapter
    Regards
    Suraj

Maybe you are looking for

  • Getting boxes instead of text in documents.  IS THERE A WAY TO ACTUALLY SPEAK WITH SOMEONE AT ADOBE?

    This is ridiculous.  Navigating the website, looking for that elusive telephone number for help.  I don't know what wrong with Adobe's 10 flash player program and why it isn't working with my Windows 8 program.  The Windows 8 test says I'm good to go

  • By-product production and inventory

    Dear all, In standard business scenario we produce one item from one input and scrap is generated which goes to its respective storage location while given production order confirmation through CO15. Because of development in the production process,

  • Creative cloud invites not being sent

    We're having an issue with out corporate account where the invites does not seem to be sent out to users. We add users with their email address but they never receive them. We've checked in users spam folders in Outlook and also on our spam filter (s

  • Video layer on a 3D object

    I have creative suite 5.5 ext. How would I put a video on a layer of a 3d object (3ds file) in after effects and then move around it with the camera? For example, I have a 3d model of a flat screen tv that i can import into photoshop and save as a ps

  • ITunes freezes when playing any kind of video

    Up until a little while ago I was able to use iTunes to stream movie trailers, watch video podcasts, and watch movies saved in my library.  For some reason now I am unable to. I have uninstalled and reinstalled both Quicktime and iTunes, and I have e