NULL Value in OO Context

Hi ,
I want to set NULL Value in OO Context.
I cannot use clear with NuLL, SInce it is not allowed in OO Context.
Do anybody know Class xyz => NULL_Constant ?
Eg  cl_abap_char_utilities=>NEWLINE
Regards
Prasath

> Hi.
>
> Hmm, since I am from Java world these things gets
> confusing in ABAP. If you see the following example
> then the report will print both 1 and 2. So the
> variable is both "initial" as well as "space".
>
>
>
> DATA: lv_test TYPE flag.
> lv_test = '0'.
> CLEAR lv_test.
>
> IF lv_test EQ space.
>   WRITE '1'.
> DIF.
> IF lv_test IS INITIAL.
>   WRITE '2'.
> DIF.
>
> Best Regards
> Niklas
That's because the initial value of a character field is SPACE.  In the same way, the initial value of an integer field is 0.  Again, looking at the ABAP help:
Type    Initial Value
b       0
c       " " for every position
d       "00000000"
f       0
i       0
n       "0" for every position.
p       0
string  empty string of length 0
s       0
t       "000000"
x       hexadecimal 0
xstring empty string of length 0.
matt

Similar Messages

  • Null Value in PI 7.1

    Hi
    I am working on Proxy to SOAP Scenario, I receive null value at the first instance when I display the Queue, and values after the null,  and the values are coming from the different nodes, and mapping needs to be done at the different level too.
    Example I receive the state vale as
    1. null
    2.CA
    3.NV
    in order to avoid the null value while mapping what is the function to use it, I used Remove context but still I receive the null value at the begining
    Thanks
    PR

    Hi PR,
    In my case, because of this change in 7.1 a mapping which is working in 7.0 was resulting in wrong results in 7.1
    I doubt this change was done by SAP in 7.1 for ease of use in UDF.
    However, in your scenario try placing a remove contexts-split by value immediately after the condition it suppress the null.
    Else provide me your condition in MM I will replicate and help you.
    Also, try changing the context to a higher level
    Venkat.
    Edited by: Venkat Anusuri on Aug 5, 2009 3:43 PM

  • Using Convert to handle NULL values for empty Strings ""

    After having had the problem with null values not being returned as nulls and reading some suggestion solution I added a converter to my application.
      <converter>
        <converter-id>NullStringConverter</converter-id>
        <converter-for-class>java.lang.String</converter-for-class>
        <converter-class>com.j2anywhere.addressbookserver.web.NullStringConverter</converter-class>
      </converter>
    ...I then implemented it as follows:
      public String getAsString(FacesContext context, UIComponent component, Object object)
        System.out.println("Converting to String : "+object);
        if (object == null)
          System.out.println("READING null");
          return "NULL";
        else
          if (((String)object).equals(""))
            System.out.println("READING null (Second Check)");
            return null;       
          else
            return object.toString();
      public Object getAsObject(FacesContext context, UIComponent component, String value)
        System.out.println("Converting to Object: "+value+"-"+value.trim().length());
        if (value.trim().length()==0 || value.equals("NULL"))
          System.out.println("WRITING null");
          return null;
        else
          return value.toUpperCase();
    ...I can see that it is converting my values, however the object to which the inputText fields are bound are still set to empty strings ""
    <h:inputText size="50" value="#{addressBookController.contactDetails.information}" converter="NullStringConverter"/>Also when reading the object values any nulls are already converted to empty strings before ariving at the converter. It seems that there is a default converter handling string values.
    How can I resolve this problem as set nulls when the input value is an empty string other then checking every string in my class individually. I would really hate to pollute my object model with empty string tests.
    Thanks in advance
    Edited by: j2anywhere.com on Oct 19, 2008 9:06 AM

    I changed my converter as suggested :
      public Object getAsObject(FacesContext context, UIComponent component, String value)
        if (value == null || value.trim().length() == 0)
          if (component instanceof EditableValueHolder)
            System.out.println("SUBMITTED VALUE SET TO NULL");
            ((EditableValueHolder) component).setSubmittedValue(null);
          else
            System.out.println("COMPONENT :"+component.getClass().getName());
          System.out.println("Converting to Object: " + value + "< to " + null);
          return null;
        System.out.println("Converting to Object: " + value + "< to " + value);
        return value;
      }which produces the following output :
    SUBMITTED VALUE SET TO NULL
    Converting to Object: < to null
    Info : The INFO line however comes from my controller object where I print out the set value :
    package com.simple;
    import java.util.ArrayList;
    import java.util.List;
    public class Controller
      private String information;
      /** Creates a new instance of Controller */
      public Controller()
        System.out.println("Createing Controller");
        information = "Constructed";
      public String process()
        System.out.println("Info : "+getInformation());
        return "processed";
      public String reset()
        setInformation("Re-Constructed");
        System.out.println("Info : "+getInformation());
        return "processed";
      public String setNull()
        setInformation(null);
        System.out.println("Info : "+getInformation());
        return "processed";
      public String getInformation()
        return information;
      public void setInformation(String information)
        this.information = information;
    }I also changes my JSP / JSF page a little. Here is the updated version
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
    <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%--
        This file is an entry point for JavaServer Faces application.
    --%>
    <html>
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
      </head>
      <body>
        <f:view>
          <h:form>
            <h:inputText id="value" value="#{Controller.information}"/>
            <hr/>
            <h:commandLink action="#{Controller.process}">
              <h:outputText id="clicker" value="Process"/>
            </h:commandLink>             
            <hr/>
            <h:commandLink action="#{Controller.reset}">
              <h:outputText id="reset" value="Reset"/>
            </h:commandLink>             
            <hr/>
            <h:commandLink action="#{Controller.setNull}">
              <h:outputText id="setNull" value="Set Null"/>
            </h:commandLink>             
          </h:form>
        </f:view>
      </body>
    </html>The converter is declared for the String class in the faces configuration file. From the log message is appears to be invoked, however the object is not set to null.
    I tested this with JSF 1.2_04-b20-p03 as well as 1.2_09-b02-FCS.
    any other suggestions what could be causing this.

  • Reading User Profile Properties pragmatically in SharePoint 2010 Returns Null Values Although it has values returned from AD

    Reading User Profile Properties pragmatically in SharePoint 2010 Returns Null Values Although it has values returned from AD
    I configured the user profile service application and run Sync and user profiles and its properties returned from Active directory but when I want to read it pragmatically it returns null values.
    this is my code...
       void runQueryButton_Click(object sender, EventArgs e)
               // Get the My Sites site collection, ensuring proper disposal
                using (SPSite mySitesCollection = new SPSite("http://sp/my"))
                    //Get the user profile manager
                    SPServiceContext context = SPServiceContext.GetContext(mySitesCollection);
                    UserProfileManager profileManager = new UserProfileManager(context);
                    UserProfile profile = profileManager.GetUserProfile("Contoso\\user");
                    foreach (Property prop in profileManager.Properties)
                       // if (prop.Name == "Department")
                        resultsLabel.Text += prop.DisplayName + ":" + profile[prop.Name].Value + "<br />"; ;

     Hi,
    Please try with the following code
          PrincipalContext principalContext = new PrincipalContext(ContextType.Domain);
                                SPServiceContext context = SPServiceContext.GetContext(site);
                                UserProfileManager profileManager = new UserProfileManager(context);                        
      foreach (Property prop in profileManager.Properties)
                       // if (prop.Name == "Department")
                        resultsLabel.Text += prop.DisplayName
    + ":" + profile[prop.Name].Value + "<br />"; ;
    Thanks,
    Vivek
    Please vote or mark your question answered, if my reply helps you

  • How to post null values from h:inputText?

    Hello,
    I have a form made of h:inputText fields that map to an entity class as the backing bean. Whenever I post the form from a web page, all the fields that I did not fill out and that are mapped to String fields in the entity class are set to "" (empty string) instead of null.
    However, I would like to post null values to my entity, because that would indicate that the user did not fill out the field. In other contexts (outside of the web app) it is possible to set the fields to empty strings, but from the web app it should always be null. How can I get JSF to do this correctly?
    Also, when reading entitys with null values from the database, these are converted to empty h:inputText fields, so this direction works as expected.
    Ulrich

    I haven't seen a solution for this as far.
    This is how I do it:
    public void action() {
        if (isEmpty(inputValue)) {
            // do your thing
        } else {
            // do your thing
    public static boolean isEmpty(Object value) {
        if (value == null) {
            return true;
        if (value instanceof String && ((String) value).trim().length() == 0) {
            return true;
        if (value instanceof Collection && ((Collection) value).size() == 0) {
            return true;
        // And go so on .. make it an utility method.
        return false;
    }

  • N:1 mapping problem with incoming NULL value

    Dear experts,
    i have a problem mapping an incoming Idoc to XML file. Here's the situation:
    1) Structure of inbound Idoc
        ZTST00
        ZTST01 Structure: FIELDNAME, FIELDVALUE. Values: FIELDNAME = "Z1", FIELDVALUE = "4";
        ZTST01 Structure: FIELDNAME, FIELDVALUE. Values: FIELDNAME = "Z2", FIELDVALUE = null;
        ZTST01 Structure: FIELDNAME, FIELDVALUE, Values: FIELDNAME = "ZABC", FIELDVALUE = "5";
        ZTST01 Structure: FIELDNAME, FIELDVALUE. Values: FIELDNAME = "Z4", FIELDVALUE = "6";
        ZTST02
    2) Resulting XML:
        LINEHEADER (1 line)
        LINEDETAIL (1 line, Structure: VALUE)
        LINEFOOTER (1 line)
    3) I need to map ZTST01-FIELDVALUE to LINEDETAIL-VALUE, but only if the FIELDNAME equals "ZABC".
    In my message mapping, i put an IF FIELDNAME = 'ZABC' THEN FIELDVALUE->VALUE, on context ZTST00. But because of the null value in line 2 of the Idoc, the value that is returned to the XML is "6", as the null value is disregarded and not in the queue of FIELDVALUE.
    How can I put the correct value ("5") to LINEDETAIL-VALUE?
    Regards
    William

    Hi William,
    Simply go back to the default context ZTST01 (for both: FIELDNAME and FIELDVALUE fields) and it should be fine.
    Hope this helps,
    Greg

  • Issue with Results from Another Query (Error on Null value)

    Hi All,
    We have a WebI report using "Result from Another Query" option of BO XI R3.1. The report was running fine till recently the dimension object using result from another query had a null value. Report suddenly throwed error as the query filters are invalid.
    Is there a way to make this filter optional if no data/null value is there ? Because we need those null values in report as well.
    Thank you for your time.
    Thanks & Regards
    LN

    Hi Vivek,
    It was not directly solved but I applied alternate logic to over come the issue.
    Here's what I did to overcome:
    I used a sub query in place of the whole result from another query.
    For Ex:
    Dim1 inlist result from another query1
    I made it as
    Dim1 inlist (Dim0)
    where Conditions.
    Here Dim0 is the object which we use for Result from another query and Conditions will be the necessary filter conditions to arrive proper Dim0.  Make sure proper context is formed for the sub query.
    Even though it resolved my problem, It introduces an new issue. It causes increase in query run time when huge set of data is returned from sub query.
    Please let me know if i haven't explained clearly.
    Hi Aris_BO,
    Sorry for not responding earlier.  The logic would probably make more queries null & not null. Thats why I was not advised to use it.
    Thanks
    LN

  • Component binding return null value

    I'm migrating a JSF 1.2 application to JSF 2.1, specificly I'm currently using mojorra 2.1.24.
    The application consists of request scoped beans, and in order to pass data between requests, it embeds the data inside UI components.
    The following behaviour works well with JSF 1.2, but not with JSF 2.1.
    The application has the following configuration:
    <context-param>
      <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
      <param-value>client</param-value>
    </context-param>
    The page contains the following snippet:
    <h:form prependId="false">
         <h:inputHidden binding="#{bean.inputHidden}" />
         <h:panelGroup rendered="#{bean.rendered}">
          <h:commandLink value="onAction" action="#{bean.onAction}" />
         </h:panelGroup>
    </h:form>
    The bean is the following:
    @ManagedBean
    @RequestScoped
    public class Bean {
      private UIInput inputHidden;
      private AItem item;
      public setInputHidden(UIInput inputHidden){
        this.inputHidden = inputHidden;
        if(item != null){ this.inputHidden.setValue(item); }
      public AItem getItem(){
        return (AItem) getInputHidden().getValue();
      // other getter/setter
      public String onNavToPage(AItem item){ this.item = item; return "page"; }
      public String onAction(){ //... do something return ""; }
      public boolean isRendered(){ return getProcessItem() != null; }
    The steps are the following:
    to navigate to page page the method bean.onNavToPage is invoked from within another page;
    upon page rendering the bean.item is set as bean.inputHidden value;
    after the page is diplayed, the command link is pressed.
    At this point no command link is invoked, because the bean.inputHidden.getValue() returns null, and the command link is not processed.
    I noticed that the inputHidden parameter passed to the setInputHidden method during restore view phase has, inputHidden.getValue() == null, no value has been saved previously in the view.
    I would guess that something has changed in the component state management, but debugging the JSF code I didn't find what.
    Debugging JSF code I found that the component state has been masked before the state has been saved in the view, so the ComponentStateHelper.saveState saves the deltaMap and not the defaultMap, where all the state has been put.
    public Object saveState(FacesContext context) {
            if (context == null) {
                throw new NullPointerException();
            if(component.initialStateMarked()) {
                return saveMap(context, deltaMap);
            else {
                return saveMap(context, defaultMap);
    is this a bug?
    If not, how can I restore JSF 1.2 behaviuor and save the defaultMap?
    Thanks in advance for the help.

    0.10: Saved session state: 6385226710016200 "P327_OU_NAME" changedValue="test"
    0.10: ...P327_FK_ORGUNIT session state saving same value: "%null%"
    0.15: Saved session state: 6388922235040486 "P327_OU_DESC" changedValue=""
    0.15: Processing point: ON_SUBMIT_BEFORE_COMPUTATION
    0.15: Branch point: BEFORE_COMPUTATION
    0.15: Computation point: AFTER_SUBMIT
    0.15: Perform Branching for Tab Requests
    0.15: Branch point: BEFORE_VALIDATION
    0.15: Perform validations:
    0.16: Branch point: BEFORE_PROCESSING
    0.16: Processing point: AFTER_SUBMIT
    0.16: ...PLSQL (AFTER_SUBMIT) INSERT INTO INDIT_PS_ORGUNIT ( OU_ID, FK_ORGUNIT, OU_NAME, OU_DESC ) VALUES ( INDIT_PASS_SEQ_GENERIC_ID.NEXTVAL, :P327_FK_ORGUNIT, :P327_OU_NAME, :P327_OU_DESC )
    0.16: Show ERROR page...
    0.17: Processing point: AFTER_ERROR_HEADER
    0.18: Processing point: BEFORE_ERROR_FOOTER
    ORA-01722: invalid number
    the table was created with:
    CREATE TABLE INDIT_PS_ORGUNIT (
    OU_ID NUMBER(15) PRIMARY KEY,
    FK_ORGUNIT NUMBER(15) NULL,
    OU_NAME VARCHAR2(30) NOT NULL,
    OU_DESC VARCHAR2(30) NULL,
    OU_DELETED DATE NULL
    what i see is that the status is "%null%" and not really "" (NULL, nothing, ...).
    so what can i do to insert a null value from a select list?
    i gave up RTFM. because i found nothing (NULL) ?!?!

  • Hide Null Value in Drill Down KPI

    Dear Sir,
    I have Problem : i want to Hide the Null Value in SSM KPI. This is the link picture ( http://tinypic.com/r/aak9r6/5 ).
    Thanks for your answer.

    Por,
    Can't remember if you are on 7.5 or 10. On 7.5 , go to Administrator interface Scorecards > Set Scorecard Defaults > select the Context from the picklist and in the middle of the page KPIs - Set Missing or Null Data. The default is Display KPI, hide indicators, but you can also choose Hide KPI.
    In SSM 10 this same function is under Context Management > Scorecard Defaults. Contexts are listed in box instead of picklist.
    Regards,
    Bob

  • Geting null values from request

    hi!
    i m producing this code through out.println() method in my page and then using java script
    i am submiting this page to another page
    <td width="56%"><textarea name="question_no_1"></textarea></td>
    <input name="question_no_1_radio1" type="radio" value="radio"></td>
    <td width="59%"> <textarea name="question_no_1_ans1"></textarea></td>
    <input type="radio" name="question_no_1_radio2" value="radio"></td>
    <td><textarea name="question_no_1_ans2"></textarea></td>
    <input type="radio" name="question_no_1_radio3" value="radio"></td>
    <td><textarea name="question_no_1_ans3"></textarea></td>
    <input name="question_no_1_radio4" type="radio" value="radio"></td>
    <td><textarea name="question_no_1_ans4"></textarea></td>
    but when i submit it to the other page and try to retrieve value of parameter "question_no_1"
    through the bellow statement it shows a null value but i have given a value previously by
    typing a question in it
    System.out.println("the Body Of The First Question Is "+request.getParameter("question_no_1"));
    can anybody help me what is going on here.
    also if i try to normaly submit first page (ie <form="form1" method="post" action="other_jsp_page.jsp"> ) then the statement in the next page gives me the correct value but
    i have to submit the first paper through java script.
    if u want to see full detail of my code then go to the following link
    http://forum.java.sun.com/thread.jsp?thread=309254&forum=45&message=1237097
    thanx in advance

    OK, your problem is that you are not submmiting the values to the other page. When you do the
    --> document.forms[0].submit();
    in JavaScript, the form has to action defined
    --> <form name="form1" method="" action="">
    So, the page does nothing. The line following the submit just changes the location of the page, IT DOES NOT POST the values.
    One solutions is the following:
    1.- define an action for your form:
    <form name="form1" method="POST" action="'save_paper.jsp">
    2.- Then create a JavaScript function that validates the fields and simply return "true" if the form is correct, and false if there is a problem (just a little modification of the one you have).
    3.- Then modify your submit button:
    Instead of:
    <input type="button" name="Save" value="Save" onClick="validateField()">
    Try:
    <input type="SUBMIT" value="Save" onclick="validateField();">

  • Not to display the null values from data base

    Hiiii.
    In a jsp file i have ten check boxes.The jsp file is mapped to a servlet file for parameter requesting and to
    store it in DB.
    The unchecked box values has null values.All the values are store in a Mysql DB table.
    Again i have to display it in a jsp page from table.
    The problem am facing was,how can i display only the values in a row.it must not display the null values and the crresponding column name.
    Or any other way is their like below
    How i can retrieve only the selected check boxes from tht jsp file.and store in backend.
    Thanks in Advance
    regards,
    satheesh kannan

    Here is a rough example that may give you some ideas:
    On the JSP page:
    <%if(myData.getFirstName()!=null){%>
    Your First Name'
    <input type="text" name="firstName" value="<%=myData.getFirstName()%>">
    <%}%>
    In the servlet:
    String firstName= request.getParameter("firstName");
    if(firstName!=null){
    //write it to the database
    }

  • JDBC MS Access--- cannot extract entry with null value with data type Meta

    I'm trying to extract a data entry with null value by using JDBC. The database is MS Access.
    The question is how to extract null entry with data type memo? The following code works when the label has data type Text, but it throws sqlException when the data type is memo.
    Any advice will be appreciated! thanks!
    Following are the table description and JDBC code:
    test table has the following attributes:
    Field name Data Type
    name Text
    label Memo
    table contents:
    name label
    me null
    you gates
    Code:
    String query = "SELECT name, label FROM test where name like 'me' ";
    ResultSet rs = stmt.executeQuery(query);
    while (rs.next())
    String name = rs.getString("name");
    rs.getString("val");
    String label = rs.getString("label");
    System.out.println("\t"+name+"\t"+label);
    catch (SQLException ex)
    System.out.println(ex.getSQLState());
    System.out.println(ex.getErrorCode());
    System.out.println("in sqlexception");
    output:
    C:\Temp\SEFormExtractor>java DBTest
    yet SELECT name, label FROM test
    null
    0
    in sqlexception

    The question is how to extract null entry with data type memo?Okay, what you need to do is this:
    if (rs.getString("val") == null)
      // do something
    }This way, when it's a null value, you can check it first, and then handle it how you want, rather than getting an exception.

  • Index (or not) for excluding NULL values in a query

    Hello,
    I have table that can become very large. The table has a varchar2 column (let's call it TEXT) that can contain NULL values. I want to process only the records that have a value (NOT NULL). Also, the table is continuously expanded with newly inserted records. The inserts should suffer as little performance loss as possible.
    My question: should I use an index on the column and if so, what kind of index?
    I have done a little test with a function based index (inspired by this Tom Kyte article: http://tkyte.blogspot.com/2006/01/something-about-nothing.html):
    create index text_isnull_idx on my_table(text,0);
    I notice that if I use the clause WHERE TEXT IS NULL, the index is used. But if I use a clause WHERE TEXT IS NOT NULL (which is the clause I want to use), a full table scan is performed. Is this bad? Can I somehow improve the speed of this selection?
    Thanks in advance,
    Frans

    I build a test case with very simple table with 2 columns and it shows that FTS is better than index access even when above ratio is <= 0.01 (1%):
    DROP TABLE T1;
    CREATE TABLE T1
               C1 VARCHAR2(100)
              ,C2 NUMBER
    INSERT INTO T1 (SELECT TO_CHAR(OBJECT_ID), ROWNUM FROM USER_OBJECTS);
    BEGIN
         FOR I IN 1..100 LOOP
              INSERT INTO T1 (SELECT NULL, ROWNUM FROM USER_OBJECTS);
         END LOOP;
    END;
    CREATE INDEX T1_IDX ON T1(C1);
    ANALYZE TABLE T1 COMPUTE STATISTICS
         FOR TABLE
         FOR ALL INDEXES
         FOR ALL INDEXED COLUMNS
    SET AUTOTRACE TRACEONLY
    SELECT
              C1, C2
         FROM T1 WHERE C1 IS NOT NULL;
    3864 rows selected.
    real: 1344
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=59 Card=3864 Bytes=30912)
       1    0   TABLE ACCESS (FULL) OF 'T1' (Cost=59 Card=3864 Bytes=30912)
    Statistics
              0  recursive calls
              0  db block gets
           2527 consistent gets
           3864 rows processed
    BUT
    SELECT
         --+ FIRST_ROWS
              C1, C2
         FROM T1 WHERE C1 IS NOT NULL;
    3864 rows selected.
    real: 1296
    Execution Plan
       0      SELECT STATEMENT Optimizer=HINT: FIRST_ROWS (Cost=35 Card=3864 Bytes=30912)
       1    0   TABLE ACCESS (BY INDEX ROWID) OF 'T1' (Cost=35 Card=3864 Bytes=30912)
       2    1     INDEX (FULL SCAN) OF 'T1_IDX' (NON-UNIQUE) (Cost=11 Card=3864)
    Statistics
              0  recursive calls
              0  db block gets
           5052 consistent gets
           3864 rows processed
    and just for comparison:
    SELECT * FROM T1 WHERE C1 IS NULL;
    386501 rows selected.
    real: 117878
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=59 Card=386501 Bytes=3092008)
       1    0   TABLE ACCESS (FULL) OF 'T1' (Cost=59 Card=386501 Bytes=3092008)
    Statistics
              0  recursive calls
              0  db block gets
         193850 consistent gets
         386501 rows processedHence you have to benchmark you queries with and w/o index[es]

  • Null values passed into the servlet

    Hi all,
    I keep getting null values for all the params that I pass into the servlet i.e. sqltype, producttype, process, instance etc....I have attempted to print some of them out on the screen but I keep getting the 'NullPointerException' error message...can anyone tell me what it is that I have down wrong in the below code?
    If I run the servlet with method calls that have hardcoded arguments in them it works but not when I pass in the params from the URL...I am absolutley puzzled!
    Help!
    package blotter;
    import java.io.IOException;
    import java.io.PrintWriter;
    import java.util.Date;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import com.db.util.WriteToLogFile;
    import blotter.cache.*;
    Servlet to extract an object that has already been placed
    in the cache by GetBondPrices servlet from the cache.
    public class ExtractSecurityObject extends HttpServlet
         String sqlType = "";
         String productType = "";
         String instance = "";
         String process = "";
         String asOfDate = "";
         String currencyCode = "";
         String curveId = "";
         String results = "";
         private String debug;
    private PrintWriter out;
         private WriteToLogFile logFile;
         // called when servlet first initialised
         public void init(ServletConfig config) throws ServletException
              super.init(config);
         // method called for each get request
         public void doGet( HttpServletRequest request, HttpServletResponse response )
                   throws ServletException, IOException
              String toWrite = " ";
    // Get the object identifier from the parameters passed in
              sqlType = request.getParameter("sqltype");
    productType = request.getParameter("producttype").toUpperCase();
              instance = request.getParameter("instance");
              process = request.getParameter("process");
              asOfDate = request.getParameter("asofdate");
              curveId = request.getParameter("curveid");
              currencyCode = request.getParameter("ccy").toUpperCase();
              out.println(currencyCode);
              if ( request.getParameter("debug") !=null)
                   debug = request.getParameter("debug");
              else
                   debug ="";
              // set the mime type to html
    response.setContentType( "text/html" );
    out = response.getWriter();
    out.println("<HTML>");
              try
              // write some parameters to a log file
              toWrite = toWrite + "<li>" + getServletInfo() + " at " + new Date() + " " + sqlType + " " +
                        productType + " " + instance + " " + process + " " + asOfDate + " " + curveId + " " +
                        currencyCode;
         CachedObject o1 = (CachedObject)CacheManager.getCache("EB_" + currencyCode + productType + asOfDate);
    if(o1 == null){
              CacheSecurityObject cso = new CacheSecurityObject();
                   if((request.getParameter("sqltype") == null) && (request.getParameter("instance") != null)){
    results = (String)cso.putSecurityinCache(null, request.getParameter("producttype"), request.getParameter("instance"), request.getParameter("process"), request.getParameter("asOfDate"), request.getParameter("curveId"), request.getParameter("currencyCode"));
    //results = (String)cso.putSecurityinCache(null, "yc", "frafu", "official", "20011105", "baceod", "sek");
    out.println(results);
                   } else {
    //results = (String)cso.putSecurityinCache("bondtypes", "bond", null, "official", "20011105", "baceod", "eur");
    results = (String)cso.putSecurityinCache(request.getParameter("sqltype"), request.getParameter("producttype"), null, request.getParameter("process"), request.getParameter("asOfDate"), request.getParameter("curveId"), request.getParameter("currencyCode"));
    out.println(results);
              else{
                   out.println(((String)o1.object).toString());
    // general catch for all exceptions
              catch(Exception exception)
                   out.println( "Exception: The item that you requested was not found in the cache" + "<BR>" );
                   toWrite = toWrite + "Exception : " + exception.getMessage() + "\n" ;
              finally
    // write to logfile
              logFile = new WriteToLogFile();
              logFile.setSourceDirName("blotter");
              logFile.setQuery(request.getQueryString());
              logFile.setServletPath(request.getServletPath());
              if (toWrite!=null)
              logFile.writeLog(getServletInfo(),toWrite);
    out.println("</HTML>");
              out.close();
         // need the class name for log file
         public String getServletInfo()
         return this.getClass().getName();
    }

    That section of the code references a cache to extract an item that has been requested by the user. If the item is not in the cache i.e. if(o1 == null) then it will call a class that generates that object and places that object into the cache. The second time the user makes the same call then they will be handed a cached copy of that object which is aimed to make the whole servlet call faster.
    That section of the code works fine coz I have tested that separately. It is the reading in of the arguments that is causing the problem.

  • How to validate if a column have NULL value, dont show a row with MDX

    Hello,
    I have this situation, I have a Result from MDX that return rows with values NULL on columns, I tried with NON EMPTY and NONEMPTY but the result is the same. That I want to do is validate if a column have a Null value discard the row, but I dont know how
    to implement it, could somebody help me?, please.
    Thanks a lot.
    Sukey Nakasima
    Sukey Nakasima

    Hello,
    I found the answer in this link https://social.technet.microsoft.com/Forums/sqlserver/en-US/f9c02ce3-96b2-4cd6-921f-3679eb22d790/dont-want-to-cross-join-with-null-values-in-mdx?forum=sqlanalysisservices
    Thanks a lot.
    Sukey Nakasima
    Sukey Nakasima

Maybe you are looking for