Empty string == NULL ???!?!?!?!??!

Hi SQlers ...
I'm using Oracle 8.1.7 ... and Oracle maps the literal empty
string value, to the NULL value ... it that the expected result?
simple example:
SELECT 1 from dual where ('' is null)
I've tried the same on others rdbms, and of course, the
result is not the same.
thanks in advance
saludos
dario estepario ...

Yup. In Oracle the empty string '' and NULL are identical, though they periodically threaten that this may change in the future.
Justin

Similar Messages

  • What is in the column, empty string, null or ....?

    I am using Oracle 11.2, have one table tb_class as following:
    TB_CLASS (id number(3), nm varchar2(32), seqNum number(3));
    1, ,212
    2,'as', 12
    3, 'qq', 12
    select * from TB_CLASS where id=1 and nm=null; ...no row selected
    select nvl(nm) from TB_CLASS where id=1; ...1 row selected
    Any one know what is in column nm for row id=1? I thought it is empty string, but why it returns no row in the first query?
    Thanks!

    1) In Oracle there is no difference between NULL and the empty string.
    2) NULL is never equal to anything (including another NULL). NULL is never unequal to anything (including another NULL). You need to use the IS NULL and/ or IS NOT NULL operators in order to look for NULL values
    SELECT *
      FROM tb_class
    WHERE nm IS NULLor
    SELECT *
      FROM tb_class
    WHERE nm IS NOT NULLOf course, it is also possible that you are stating that the NM column contains one or more spaces or that it contains one or more non-printable characters rather than a NULL. That's why you were asked what dump(nm) returns
    Justin

  • 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.

  • [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

  • 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

  • Find out varchar2 string NULL columns and Empty columns

    Hi dev's ,
    my requiremnt is to find out the string columns Names of whose storing NULL values and EMPTY strings. for that i had written below code. it's getting some error.
    SET ECHO OFF;
    SET FEEDBACK OFF;
    SET SERVEROUTPUT ON;
    SET VERIFY OFF;
    SET PAGES 0;
    SET HEAD OFF;
    spool D:\stringnull.csv
    DECLARE
      v_tab_indent NUMBER(5);
      v_col_indent NUMBER(5);
      v_val1       VARCHAR2(20);
      v_val2       VARCHAR2(20);
      v_query1     VARCHAR(500);
      v_query2     VARCHAR(500);
    BEGIN
      --DBMS_OUTPUT.ENABLE(100000);
      SELECT MAX(LENGTH(table_name))+1,MAX(LENGTH(column_name))    +1
      INTO v_tab_indent,v_col_indent
      FROM user_tab_columns
      WHERE data_type='VARCHAR2';
    FOR i IN
      (SELECT table_name,
        column_name
      FROM user_tab_columns
      WHERE data_type IN ('NVARCHAR2', 'CHAR', 'NCHAR', 'VARCHAR2')
      ORDER BY table_name,
        column_name
      LOOP
        v_query1:='SELECT NVL('||i.column_name||',0) AS VAL    
                  FROM '||i.table_name||' where '||i.column_name||' IS NULL';
        v_query2:='SELECT '||i.column_name||' AS VAL    
                  FROM '||i.table_name||' where '||i.column_name||'=''''';
        --dbms_output.put_line(v_query1);
       -- dbms_output.put_line(v_query2);
        EXECUTE immediate v_query1 INTO v_val1;
        EXECUTE immediate v_query2 INTO v_val2;
        dbms_output.put_line (rpad(i.table_name,v_tab_indent,' ')||','||rpad(i.column_name,v_col_indent,' ')||' ,'||v_val1||','||v_val2);
      END LOOP;
    END;
    Spool OFF
    Set echo on
    Set feedback onERROR:
    Error report:
    ORA-01403: no data found
    ORA-06512: at line 31
    01403. 00000 -  "no data found"
    *Cause:   
    *Action:
    set feedback onpls help me on this issue..
    Thanks,

    Example:
    SQL> DECLARE
      2    v_val       VARCHAR2(20);
      3    v_query1     VARCHAR(32767);
      4  BEGIN
      5   FOR i IN (SELECT table_name, column_name FROM user_tab_columns
      6             WHERE data_type IN ('NVARCHAR2', 'CHAR', 'NCHAR', 'VARCHAR2')
      7             ORDER BY table_name, column_name
      8            )
      9   LOOP
    10     v_query1 := 'SELECT count(*) FROM '||i.table_name||' where '||i.column_name||' IS NULL';
    11     EXECUTE immediate v_query1 INTO v_val;
    12     dbms_output.put_line(rpad(i.table_name,30,' ')||' : '||rpad(i.column_name,30,' ')||' : '||v_val);
    13   END LOOP;
    14  END;
    15  /
    CHILD_TAB                      : DESCRIPTION                    : 0
    DEPT                           : DNAME                          : 0
    DEPT                           : LOC                            : 0
    EMP                            : ENAME                          : 0
    EMP                            : JOB                            : 0
    MYEMP_OLD                      : ENAME                          : 0
    MYEMP_OLD                      : JOB                            : 0
    MYNULLS                        : ENAME                          : 0
    MYNULLS                        : JOB                            : 4
    PARENT_TAB                     : DESCRIPTION                    : 0
    T                              : CHAR_VALUE                     : 0
    TABLE1                         : COL1_DESC                      : 0
    PL/SQL procedure successfully completed.

  • Distinguishing between empty string and null values

    hi all,
    I am using an ODBC connection to connect my java app to database using JDBCODBC driver. I have 2 columns 'aColumn' and 'bColumn' in my table, both allow null values. I have one row in it, which has null value in aColumn and empty string in bColumn. I retrieve this row's data and assign it to 2 columns : 'aColumnVar' and 'bColumnVar' respectively. I find out that both 'aColumnVar' and 'bColumnVar' variables has null values (although bColumnVar should has an empty string as its value). Now my ODBC connection Data Source has the option "Use ANSI nulls, paddings, and warnings" ON. I turn it off and try again. This time both 'aColumnVar' and 'bColumnVar' variables has empty string as values (although aColumnVar should has null as its value).
    How can I make sure that i can get the data exactly as it is in the database in my variables?
    Thanks

    there is a wasNull() method on ResultSet. After you
    have obtained the value of a column e.g. by calling a
    method like getString you can call wasNull and if it
    returns true then the value on the database is null.
    Check the java docs, it might explain it better
    http://java.sun.com/j2se/1.4.1/docs/api/java/sql/Result
    et.html#wasNull()I am using MS SQL Server 7.0 under Windows NT 4.0 with JDK 1.2. My ODBC connection Data Source has to have the option "Use ANSI nulls, paddings, and warnings" ON.
    I try the wasNull() method but it is doing the same thing i.e. telling me that a column is null when in database it is null (right); and a column is null when in database it is an empty string (wrong). I suspect it is something to do with the JDBC-ODBC driver I am using.

  • Empty string in NOT NULL column

    I'm migrating data to Oracle 9i from a database engine that supports emtpy strings in column with NOT NULL specified in the DDL. I would have thought Oracle would support this, but any attempt to put empty string data into a column created with NOT NULL is returning a 'column does not support nulls'-type error.
    Is there an option to allow this, or does Oracle simply not support this and assumes blank is null?
    Thanks

    I would have thought Oracle would support this, but any attempt to put empty string data into a column created with NOT NULL is returning a 'column does not support nulls'-type error.In Oracle Null means null nothing not even an empty String.
    Yes DB's like Ingress supports this. But I think Oracle is right.
    Is there an option to allow this, or does Oracle simply not support this and assumes blank is null?I am not aware of any options as it is against the basic principles.
    you can find work arounds to do the migration. But storing a blank NO.
    Good Luck
    Vij

  • NULL vs. Empty String

    I am new to ORACLE, moving over from MS SQL Server. Is it true that you cannot enter an empty string into a NOT NULL VARCHAR2?
    I am trying to convert data from an existing DB and I NEED to be able to have an empty string as much of the code base is using this to validate data (vs. a NULL). Is there any solution at all for this problem? I really do not want to keep my existing DB running but there is too much time involved converting code.
    Thanks, In Advance

    Bryna,
    In Oracle database, Oracle treats NULL and empty string
    column the same. Therefore, you cannot insert an empty string into a NOT NULL column.
    In OracleDataReader, if you want to find out if the column contains the NULL values, use the OracleDataReader.IsDBNull() function.
    Thanks
    Martha

  • The parameter 'token' cannot be a null or empty string sharepoint

    Hello ,
    I am trying to create SharePoint 2013 web app for office 365 using visual studio 2012. when i debug and run the SharePoint custom web app then it show the error ("the parameter 'token' cannot be a null or empty string") in the
    TokenHelper.cs file.
    Please help me on urgent basis.
    Mail me at : [email protected]
    Here is the screenshot in the TokenHelper.cs file.
            public static SharePointContextToken ReadAndValidateContextToken(string contextTokenString, string appHostName = null)
                JsonWebSecurityTokenHandler tokenHandler = CreateJsonWebSecurityTokenHandler();
                SecurityToken securityToken = tokenHandler.ReadToken(contextTokenString);
    In this section i get that error.
                JsonWebSecurityToken jsonToken = securityToken as JsonWebSecurityToken;

    you can go to <yoursiteurl>/_layouts/appregnew.aspx to create a new AppPrincipal, generating a client ID and client secret.  Once generated, copy the client ID from that page into your app manifest and web.config.
    http://msdn.microsoft.com/en-us/library/office/jj687469.aspx
    Check the below two links
    http://blogs.msdn.com/b/kaevans/archive/2013/04/05/inside-sharepoint-2013-oauth-context-tokens.aspx
    http://msdn.microsoft.com/en-us/library/fp179932.aspx
    My Blog- http://www.sharepoint-journey.com|
    If a post answers your question, please click Mark As Answer on that post and Vote as Helpful

  • Null or Empty string  in OracleXMLQuery -  XDK

    Dear all,
    I am using OracleXMLQuery of XDK to construct an XML File from the contents retrieved from the database.
    I see that for columns which have null values or empty string, the corresponding tag is not displayed in the XML File. Instead, even for columns that have empty string I need the tags to be displayed in the following format <tag1> </tag1>
    Kindly let me know if this is possible.

    Ya, I will try that. That seems to be a good idea. Thanks for the response.
    I have one more query. Whenever we add a new column to any table in Oracle, the column name is stored in Upper case. So when we generate XML File from the database, all the tags are either in upper case (or we can use qry.useLowerCaseTagNames() to retrieve the tag names in lower case). But the XSD contains tag names in mixed case. So when validating the XML Document against an XSD, it throws a validation error.
    Is there any way I can avoid this?

  • Empty Strings are converted to NULLs

    We are developing a Java application intended to work with multiple databases. We want to store empty strings but oracle converts this to NULL values. Is there a way to tell the Oracle Database not to convert the empty string to NULL and to store it as an empty string?
    Thanks
    Joaquim Franco <[email protected]>
    GEDI, SA

    Our project started with a MySQL database and the code is full of built queries like "Select Field from table where field = var" where var can be an empty string. It would be easier for us to turn a switch in the database then to look for every query in the application and add code to test is var is empty a change the query to "Select Field from table where field is NULL".
    Best Regards
    Joaquim Franco
    &gt; It is a quirk of Oracle that it regards empty strings
    &gt; and NULLs as being the same thing. This behaviour
    &gt; has been built into the database forever. Oracle
    &gt; keep threatening to change but I suspect they are
    &gt; scared of the impact, not least on their own code.
    &gt; As Oracle increasingly embrace Java they may decide
    &gt; to revisit this - I don't know whether the behaviour
    &gt; is changed in 10G.
    &gt;
    &gt; What sort of problems does it cause you?
    &gt;
    &gt; Cheers, APC

Maybe you are looking for

  • Run a Report from a Forms Menu

    I have a brain teaser, I am trying to run a report from a forms menu item. Here is my menu item code: RUN_PRODUCT(REPORTS, 'C:\Documents and Settings\Bradley\My Documents\A_THESIS\Reports\AUCTION_EVENT_REPORT',SYNCHRONOUS,RUNTIME,FILESYSTEM,'',NULL);

  • I want to refresh firefox on my android tablet

    I cannot play a video on a site I am using. Last Sunday it worked perfect and today there is a message on the screen where I watched the video before saying ( Video format or MIME type is not supported) Please help. Thank you.

  • How to add cursors on polar plot

    I want to add cursors on polar plot just like the XY graph has. I am new to LabVIEW and want to be able to move those cursors by mouse movements and get the respective Angle and Magnetude values. Since the polar plot is a picture I am unable to do th

  • ASR 9000 IOS-XR 5.22 BNG: PPPoE termination with PWHE

         I'm successfully using a classic BNG configuration for PPPoE clients using PW (xconnect). Now I'm trying in lab the pseudowire headend configuration but without success. Here is my configuration: l2vpn  pw-class gia1   encapsulation mpls    prot

  • Help with deleting multiple strings from file.......

    I am trying to delete the same string that may appear multiple times in the file. Here is the output to the screen. Here is the code. I have been researching the delete method it says that I have to start at an index position in the string but how wo