Is it possible to pass a null value to a method?

is it possible to pass a null value to a method?
like this
public String getParameterXX(String testvalue)
String strX = "whatever";
if(testvalue!=null)
strX = strX + " man " ;
Is this possible ?
is this legal
String i = getParameterXX(null);

I also ran a similar code using null in a method, it just considers null as another string and concatenates it so
public String getParameterXX(String testvalue)
String strX = testvalue+"whatever";
return strX;
public static void main(String [] args)
Test tt = new Test();
String i = tt.getParameterXX(null);
System.out.println(i);
Gives me "nullwhatever"

Similar Messages

  • Pass a null value to a JDBC stored procedure call?

    pass a null value to a JDBC stored procedure call? Is this even possible? My DBA gave me a procedure to call that sometimes requires a null value. I don't think this is even possible.

    do you mind tell me how to resolve your problem?i using the setnull method,but it doesn't work.

  • Is it possible to pass the property value dynamically to composite.xml

    Hi,
    Is it possible to pass the property value dynamically to composite.xml from bpel?
    For ex:
    <property name="bpel.config.auditLevel">$variable</property>
    I will get a different $variable value every time to bpel.
    Also, when I included the following code inside .bpel
    invoke name="InvokeListFileFTPAdapter-ListFiles"
    partnerLink="ListFilesFTPAdapter"
    portType="ns3:FileListing_ptt" operation="FileListing"
    inputVariable="listfilesRequest"
    outputVariable="listfilesResponse" bpelx:invokeAsDetail="no">
    <bpelx:toProperties>
    <bpelx:toProperty name="bpel.auditLevel"
    variable="AuditVariable"/>
    </bpelx:toProperties>
    </invoke>
    where auditvariable='Off'
    I don't see any change in em. The invoke activity is showing full payload, Can't we turn off the audit level from .bpel not from composite.xml

    Hi,
    You can use bpel preferences for that:
    1.
    In the composite add a property, for ex:
    <component name="test">
    <implementation.bpel src="test.bpel"/>
    <property name="bpel.preference.exam">abc</property>
    </component>
    2.
    To get the value within your bpel process use: ora:getPreference(exam)
    3.
    Then, you can change the value in the EM:
    Under Farm_soa_domain>weblogic domain>your_domain>soa_server1
    Right click on menu>system Mbean browser>oracle.soa.config>server:soa_server1>SCAComposite>your project>SCAComposite.SCAComponent>processName>
    Now, click on the properties attribute : you can see the exam property and change the value.
    Arik

  • Is it possible to pass table type values as input parameter for con prg?

    Hi All,
    Could you please confirm that is it possible to pass table type value as input to concurrent program?
    If possible how to achive this?
    If not possible whether we have any ora doc which is confirming this.
    Any hel will be great.
    Thanks,

    Hi student;
    Please check (http://apps2fusion.com/at/45-as/241-enablingdisabling-concurrent-program-parameters)
    Hope it helps
    Regard
    Helios

  • How do I pass a null value to the reportDocument?

    I'm using CR 2008 and VS 2005. 
    I am using a stored procedure as the datasource for one of my report, which we run using the C# API.   The stored procedure is expecting a NULL in certain cases and I find I cannot pass a NULL with my current code:
    // Here I get the parameter
    // If we are dealing with an empty string or a NULL value, let's give it
                            // a value of a space so that Crystal's DLLs don't choke.
                            if ((value.Length == 0) || (value == "NULL"))
                                value = " ";
                            arrParams.Add(value);
    Object strParam = arrParams<i>;
    this.reportDocument1.SetParameterValue(num, strParam);
    The stored procedure parameter type is INT so in the report it shows up as NUMBER.
    How do I get a NULL value to the stored procedure?
    Thanks.

    See if this does the trick:
    Dim crParameterDiscreteValue As New CrystalDecisions.Shared.ParameterDiscreteValue()
    crParameterDiscreteValue.Value = Nothing
    C# would look something like;
    CrystalDecisions.Shared.ParameterDiscreteValue crParameterDiscreteValue;
    crParameterDiscreteValue = new CrystalDecisions.Shared.ParameterDiscreteValue();
    crParameterDiscreteValue.Value = null;
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup

  • Is it possible to pass a null Input Oracle parameter to a stored procedure

    I have a stored procedure that take 3 inputs and gives 1 output.I'm using Oracle parameter to add all 3 input parameters as follows :
    OracleParameter inobj = cmd.Parameters.Add("wid", OracleDbType.Int32,50);
    inobj.Direction = ParameterDirection.Input;
    inobj.Value = _employeeID;
    and added the output parameter as follows:
    OracleParameter outobj = _cmd.Parameters.Add("w_first", OracleDbType.Varchar2, 50);
    outobj.Direction = ParameterDirection.Output;
    On the UI end , the user has a choice to provide 1 input or all inputs or any 2 inputs based on his interest. Stored Proc looks as follows:
    SP( inp1 in parameter, inp2 in parameter, inp3 in parameter, output1 out parameter)
    If i just get 1 input or 2 inputs from the user, is it fine to query the data for output using same stored procedure or should i have individual stored procedures for each scenario(combination of different inputs)?
    Will i get any pl/sql error that says invalid number of arguements?

    This means if i have 1 input , i need to have a different method to pass 1 parameter value and other input parameters as null and if there are 2 inputs will need different method to handle. So 5 different methods all together?
    What if the stored procedure is as follows ,will its make things easier so that only one method is used for all scenarios?(optional parameters is set default value as null in the stored proc)
    Create or Replace
    Procedure GetFoo
    (cur_z OUT sys_refcursor,
    pub_date IN varchar2,
    fname IN varchar2 default null,
    lname IN varchar2 default null,
    phone IN varchar2 default null
    IS
    BEGIN
    ---get some data
    END;
    *actually i can test this but, all the database servers are down today. So, i need to have idea if this thing works before i confirm with someone. Thanks.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • BODI: Is it possible to pass parameter/variable value out of a data flow?

    Hi All,
    Is it possible to pass parameter value out of a data flow?
    I've created a custom function in my query transform to get row count, this value would be used outside the data flow to perform another logic. It looks like I'm unable to modify the output schema at the function in the query transform to explicitly map it to a particular global/local variable.
    Any ideas?
    Thanks.

    Any ideas?

  • Is it possible to pass a formula value from a sub-report to a main report

    Hi there,
    Im trying to pass a formula value from a Sub-report back upto into my Main report but the value doesnt seem to be getting passed up. Ive tried it the other way around, that is, passing a value from the main report to the sub-report and that works fine.
    Below is an example of what I am trying to do but it is not working. In my sub-report Ive declared a formula variable as,
    formula name=main_subIntRatePageCount
    Shared NumberVar subIntRatePageCount := TotalPageCount;
    and in the Main report Ive declared the formula variable as,
    formula name=subIntRatePageCount
    Shared NumberVar subIntRatePageCount;
    subIntRatePageCount;
    I want the value assigned to "subIntRatePageCount" in my Sub-Report to be available to my Main report.
    The problem I am trying to solve is that the sub-report is spilling over onto two pages, and I need a way of updating the page display on the main report to reflect this. The page display is of format, "displaying page 1 of  3", but its not taking into account the extra page produced by the sub-report, so it should say "displaying page 1 of 4".

    Also thanks Raghavendra, Asha,
    I've tried adding the "whileprintingrecords" statement but that doesnt seem to make any difference.
    I notice that the subReport is being called from my the GroupFooter section of the main report, and I am trying to reference the variable in the main repot in the Page Footer section. Could it be that the variable hasnt been calculated in the Page Footer by the time I calculate it in sub-Report? I thought Crystal Reports does at least 5 passes over the report evaluating all the formulas before it prints the report?
    The problem Im trying to solve is I need to know how many pages my report will have before its completed, so that i can print the statement "displaying page 1 of X", and X is currently not being calculated correctly because the sub-report is printing onto 2 pages and not 1 so the report thinks I have 1 of X pages and not X+1.
    Regards
    Robert.

  • NULL Value in CLOB

    Hi,
    I am calling a stored procedure with CLOB parameter and I need to pass NULL value to CLOB paramter through ADO in VC++.
    My problem is when I send CLOB value as NULL a single Digit Binary value is inserted.I am using SAFEARRAY and AppendChunk mechanism to create CommandParameters for Storedprocedure.
    Any suggestion where i am going wrong...
    SDG

    I've never worked with CLOB's before. But, I've put a great deal of effort into trying to pass a null value to Oracle from ADO. Finally, I just gave up and simply specified other fields but not the one I wanted to be null. The end result is that the field contains null after the row is inserted. I realize you'd like a better answer, but, I thought I'd throw in my $0.02 anyhow.
    Good luck.

  • Passing CPM variable value to BW report/query

    Is it possible to pass CPM variable values from SEM scorecard to BW supporting reports.

    Not sure if this is what you are looking for, but it's my first thought of what I would try:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/3.0b report-report interface.pdf

  • How do I set a NULL value for the parameter field

    Hi
    I've another question. I'm going to set single values for parameter fields.
    // e.g. set today for StartDate parameter field
    fc.setCurrentValue("", "StartDate", new Date());
    It should be possible to set a NULL value for date parameter fields.
    fc.setCurrentValue("", "StartDate", (Date)null);
    But this do not work. How do I set a NULL value correctly?
    Thank you in advance.
    Best regards,
    Thomas

    First question - is it a stored procedure parameter?
    You can't set a regular parameter field value to a null value.
    There was an issue with old version of the JRC, where it was allowing null to go through, but had unexpected behavior at times.
    Sincerely,
    Ted Ueda

  • Display xml- tags with NULL - value

    Hello
    is there a way to display a tag while the value is null in this matter :
    select
    xmlforest(AFRAGNR_1, AFRAGNR_2 , AFRAGNR_3 ,AFRAGNR_4 )
    AS XML
    FROM VIEW_ABC WHERE x = v1 and y = v2
    -- result: :AFRAGNR_3 and AFRAGNR_4 is null and not displayed:
    XML
    &lt;AFRAGNR_1&gt;J&lt;/AFRAGNR_1&gt;&lt;AFRAGNR_2&gt;J&lt;/AFRAGNR_2&gt;
    -- by using this, its not the result I want to get,
    select
    xmlelement( "AFRAGNR_1" , AFRAGNR_1 ) AFRAGNR_1
    ,xmlelement( "AFRAGNR_2" , AFRAGNR_2 ) AFRAGNR_2
    ,xmlelement( "AFRAGNR_3" , AFRAGNR_3 ) AFRAGNR_3
    ,xmlelement( "AFRAGNR_4" , AFRAGNR_4 ) AFRAGNR_4
    FROM VIEW_ABC WHERE x = v1 and y = v2
    another way ?
    regards Norbert
    Edited by: astramare on Nov 20, 2008 12:32 PM

    I have the same problem:
    - I need to generate XML in format <element id="1" />
    - I need to pass some null values:
    SELECT XMLElement ( "ShipToAddress"
    , XMLAttributes ( customer_id as "CustomerNo"
    , '' as "Code"
    , substr(name,1,30) as "Name"
    , '' as "Name2"
    , substr(street||' '||house_nr,1,30) as "Address"
    , '' as "Address2"
    , city as "City"
    , last_name ||' '|| first_name as "Contact"
    , phone as "PhoneNo"
    , '' as "CountryCode"
    , fax as "FaxNo"
    , zip_cd||' '||postal_code_extention as "PostCode"
    , '' as "County"
    , email as "EMail"
    , website as "HomePage")) customer
    FROM customers;
    result should be:
    <ShipToAddress CustomerNo="100001004" Code="3" Name="4C
    Cons" Name2="" Address="Metrologielaan" Address2="" City="BRUSSEL" Contact="" PhoneNo="" CountryCode="BE" FaxNo="" PostCode="1130" County="" EMail="" HomePage="" />
    and NOT (this is my result at the moment):
    <ShipToAddress CustomerNo="100001004" Code="3" Name="4C
    Cons" Address="Metrologielaan" City="BRUSSEL" CountryCode="BE" PostCode="1130"></ShipToAddress>;
    Can someone help me with this please?
    Edited by: willeha on Mar 5, 2009 7:18 AM

  • 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 pass NULL value in SSRS

    Hi All,
    I have a parameter called Division,Region and State.While loading these parameter I am replacing NULL value as "NO Division","NO Region" and "NO State".Note all parameters are multi valued.
    Now In my dataset query If I put the condition like (division=@Division or Division is null) and (region=@region or Region is null) and (state=@State
    or State is null).
    In this scenario if I want to exclude null values need only specific Division which is not allowing me to do that with above condition.If  I need all it works fine but not with specifice division,region and  sate.
    Any thought on this.
    thanks
    Chandan
    Thanks Chandan

    Thats because of or conditions
    As per your explanation since you replace NULL value as No division etc what you need to do is just this
    (division=@Division or @Division = 'All') and (region=@region or @Region = 'All') and (state=@State or @State = 'All').
    this will make sure it will bring all values including NULLs when you pass All and will only give you specific division/region etc records when you pass a specific value.
    To get NULL valued records alone you need to pass value as No Division,No region etc
    Also you should change dataset query for parameter combo to make prompt as No Division etc for NULL values so that it can be selected as an option inside multi valued combo box to see NULL valued records
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Passing  null values to the attributes of a CAF operation

    Hi,
    In CAF I am trying to fetch data through Web Service. For this I need to pass null value for the attributes of the operation.If I set the value to null it gives me missing parameter as the error.
    Can anyone tell me how to pass null values to the attributes of a CAF operation?

    Hi Xavier,
    Declare the two variables of type if_wd_contex_node for e.g. lv_node and if_wd_context_element for e.g. lv_element. Now in the first one lets say lv_node get the refrence of dynamically created node like:
    lv_node = wd_context->get_child_node('<node name>').
    Then get the refrence of element like:
    lv_element = lv_node->get_element( ). (You can also pass index as parameter check the method API)
    then just set the value of attribute you want like:
    lv_element->set_attribute( exporting name = '<attribute name>' value = '<your value>').
    Regards,
    Neha

Maybe you are looking for

  • After iOS 8 update, iPad lost 3G connection

    Hi After iOS 8.0 update my iPad (iPad2 Wi-Fi + 3G 32GBModel A1396 MC983KS/A) looses 3G connection. When I restart iPad it has good 3G connection. After few hours, when I have closed my cover and check IPad again 3G/2G connection has lost. Connection

  • Automating a link and Updating pages in Acrobat

    I've a report created in Microsoft Access and exported as a PDF file. I've also created several links in the PDF document to make it user friendly. There are 5 pages that are updated on a daily basis (Exported from Access and appended to the existing

  • Call BI Publisher report from PL/SQL

    Hi, I was looking for a solution to "download" a PDF report from BI Publisher in a PL/SQL procedure. After the download, I need to insert it into a table. I can't believe noone ever done this, but I can't find a good solution. Thanks, Jan

  • Interface Mapping  creation

    Hi,    I'm doing File -to -File scenario.. but in the sender side i have two files.. and Receiver side i have a single file.. that means. i need to merge this two files into a single file... for this i'm using BPM ..    for this i created two Message

  • Which ethernet cable for TC

    Sorry for the stupid question: I have a bunch of old ethernet cables lying around, but want to make sure I have the fastest one to connect my MacPro Quad 2.66 to my TC. It's only a 6 foot run. What do I need to look for when buying? Cat 5e? A certain