Assigning a Variable a Null Value

Hi all. I've got a loop that queries a query outside of the
loop. The problem is, the query may get defined, and it may not.
But if it gets defined, how do I undefine it for the next loop
iteration. Here's some code to wrap your head around it (edited for
brevity).
<cfloop>
<cfset queryValue = possibleEmptyString >
<cfif Len(queryValue)>
<cfquery name="queryName" dbtype="query">
select * from something
</cfquery>
</cfif>
<cfif IsDefined("queryName") AND
queryName.RecordCount>
error="some error message"
</cfif>
</cfloop>
So, is there not a Function that sets the var to Undefined,
or Null, or something? If not, what's the alternative?
Thanks all! ;)

<cfloop>
<cfset queryValue = possibleEmptyString >
<cfset queryName = QueryNew()> <!--- this ensures
that queryName is always defined, and is always a query --->
<cfif Len(queryValue)>
<cfquery name="queryName" dbtype="query">
select * from something
</cfquery>
</cfif>
<cfif queryName.RecordCount>
error="some error message"
</cfif>
</cfloop>

Similar Messages

  • Doubt about  a null value assigned to a String variable

    Hi,
    I have a doubt about a behavior when assigning a null value to a string variable and then seeing the output, the code is the next one:
    public static void main(String[] args) {
            String total = null;
            System.out.println(total);
            total = total+"one";
            System.out.println(total);
    }the doubt comes when i see the output, the output i get is this:
    null
    nulloneA variable with null value means it does not contains a reference to an object in memory, so the question is why the null is printed when i concatenate the total variable which has a null value with the string "one".
    Is the null value converted to string ??
    Please clarify
    Regards and thanks!
    Carlos

    null is a keyword to inform compiler that the reference contain nothingNo. 'null' is not a keyword, it is a literal. Beyond that the compiler doesn't care. It has a runtime value as well.
    total contains null value means it does not have memory,No, it means it refers to nothing, as opposed to referring to an object.
    for representation purpose it contain "null"No. println(String) has special behaviour if the argument is null. This is documented and has already been described above. Your handwaving about 'for representation purpose' is meaningless. The compiler and the JVM don't know the purpose of the code.
    e.g. this keyword shows a hash value instead of memory addressNo it doesn't: it depends entirely on the actual class of the object referred to by 'this', and specifically what its toString() method does.
    similarly "total" maps null as a literal.Completely meaningless. "total" doesn't 'map' anything, it is just a literal. The behaviour you describe is a property of the string concatenation operator, not of string literals.
    I hope you can understand this.Nobody could understand it. It is compete nonsense. The correct answer has already been given. Please read the thread before you contribute.

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

  • #(Not assigned) in variable search help

    Dear Team,
    Have created Characteristic value variable with processing type as user entry/default value for the char 0PLANT.
    Master data is having values #(Null Value);1001;1002;1003;1004:1005;1006
    Transactions are posted for only 1001 and 1002.
    When i try search help for the variable,displays Null Value(#),1001 and 1002 even though i selected posted values in the info object BEx tab,query designer and at info provider level also
    Please guide me how we can hide #(Null Value) in the search help as there is no transaction with plant value as " #  "
    Thanks,
    Sarasu

    Hi,
    Did you check these threads?
    # Not Assigned Value Help
    # Value in BW Query prompt

  • Unable to assign the variable value

    Hi,
    I am trying to capture the error message into a variable using statement in the Refreshing tab :
    Select '<%=odiRef.getPrevStepLog("MESSAGE")%>' from dual
    After getting the error log into variable, I am making a call to Scenario which will generate a file and email it stating the error log.
    Now the issue is when i assign this variable to the Scenario variable it throws the following error:
    com.sunopsis.tools.core.exception.SnpsSimpleMessageException: Invalid parameter
         at com.sunopsis.dwg.function.SnpsFunctionBase.getSunopsisApi(SnpsFunctionBase.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execIntegratedFunction(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlS.treatTaskTrt(SnpSessTaskSqlS.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.g.y(g.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Unknown Source)
    If i set the variable with any default value, it successfully makes a call to the scenario and generates the file.
    Please help!
    Thanks,
    Ritika

    Hi,
    i created a variable and assigned the value to another variable in a procedure, am getting the following error, as it says in the error i don't have any ";" that is causing the problem.
    the variable name is table_nm
    inside the procedure am assigning the value to lv_table_nm :=#SESSNAME.table_nm;
    If i change the variable name tos ome constant or any other value, the package is working fine. Any ideas why am getting error assigning the variable?
    6550 : 65000 : java.sql.SQLException: ORA-06550: line 1, column 294:
    PLS-00103: Encountered the symbol ";" when expecting one of the following:
    ( - + case mod new not null <an identifier>
    <a double-quoted delimited-identifier> <a bind variable>
    continue avg count current exists max min prior sql stddev
    sum variance execute forall merge time timestamp interval
    date <a string literal with character set specification>
    <a number> <a single-quoted SQL string> pipe
    <an alternatively-quoted string literal with character set specification>
    <an alternatively
    java.sql.SQLException: ORA-06550: line 1, column 294:
    PLS-00103: Encountered the symbol ";" when expecting one of the following:

  • How to assign to variable from XML type values with extract function?

    Hi ,
    I have XMLTYPE variable LeXml having below record
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <AddListing xmlns="http://www.christielites.com/">
    <sComCode>string</sComCode>
    <sLocCode>string</sLocCode>
    <dStart>dateTime</dStart>
    <dEnd>dateTime</dEnd>
    <sEcode>string</sEcode>
    <iAvail>int</iAvail>
    <iOwned>int</iOwned>
    <sPostTrans>string</sPostTrans>
    </AddListing>
    </soap:Body>
    </soap:Envelope>
    I want to get sEcode value string into one varialbe using extract function or alternate?
    can any one give me syntax fro it?
    I tried with Mstring:=LeXml.extract('AddListing/scomcode/text()').getStringval(); but iam getting error
    ERROR at line 1:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00601: Invalid token in: 'soap:Envelope/text()'
    ORA-06512: at "SYS.XMLTYPE", line 111
    ORA-06512: at "BLUEWATER.CREATELERESPONSELOG", line 12
    ORA-06512: at line 1
    Please guide Me..

    Hi Ravi kumar,
    I have similar type of problem like above . My xml file is like below:
    <doSingleRecordResponse xmlns="urn:mdWebService">
    <doSingleRecordResult xsi:type="ResponseRecord" id="1" version="2.30" action="Response" timeout="10" timestamp="12-17-2009" transmissionReference="ABCDEF" TimeToProcess="31.25" xmlns:xsi="http://www
    .w3.org/2001/XMLSchema-instance">
    <CustomerCredentials>
    <CustomerID>111111</CustomerID>
    </CustomerCredentials>
    <ServiceResult>
    <ErrorCode> </ErrorCode>
    <ErrorDesc>OK;</ErrorDesc>
    </ServiceResult>
    <Address version="2.30">
    <Faults count="0"/>
    <Result>
    <ErrorCode> </ErrorCode>
    <ErrorDesc>OK</ErrorDesc>
    <StatusCode>9</StatusCode>
    <StatusD
    esc>(U.S.) The address was fully coded.</StatusDesc>
    </Result>
    <Company/>
    <Urbanization>
    <Name/>
    <Code/>
    </Urbanization>
    <Type>
    <String>Highrise</String>
    <Code>H</Code>
    </Type>
    <Street>XXXXXXXXXXXXX</Street>
    <Street2/>
    <Suite/>
    <PrivateMailBox/>
    <CarrierRoute>C048</CarrierRoute>
    <Lacs> </Lacs>
    <LacsLink>
    <LacsStatusCode/>
    <LacsReturnCode/>
    </LacsLink>
    <DeliveryPointCode>99</DeliveryPointCode>
    <DeliveryPointCheckDigit>6</DeliveryPointCheckDigit>
    <DPV>
    <Footnotes/>
    <CMRA/>
    <AddressStatus/>
    </DPV>
    <DeliveryIndicator>
    <Code/>
    </DeliveryIndicator>
    <City>
    <Name>String</Na
    me>
    <Abbreviation>Memphis</Abbreviation>
    </City>
    <County>
    <Name>String</Name>
    <Fips>41111</Fips>
    </County>
    <State>
    <Name>Tennessee</Name>
    <Abbreviation>TN</Abbreviation>
    </State>
    <Zip>
    <Type> </Type>
    <Zip5>38111</Zip5>
    <Plus4>1111</Plus4>
    </Zip>
    <GeoCode>
    <Latitude/>
    <Longitude/>
    </GeoCode>
    <TimeZone>
    <Name/>
    <Code/>
    </TimeZone>
    <Msa>
    <Code/>
    </Msa>
    <Pmsa>
    <Code/>
    </Pmsa>
    <Census>
    <Block/>
    <Tract/>
    </Census>
    <CongressionalDistrict>
    <Code/>
    </CongressionalDistrict>
    <Parsed>
    <StreetName/>
    <AddressRange/>
    <Suffix/>
    <Direction>
    <Post/>
    <Pre/>
    </Direction>
    <Suite>
    <Name/>
    <Range/>
    </Suite>
    <PrivateMailBox>
    <Name/>
    <Range/>
    </PrivateMailBox>
    <Garbage/>
    </Parsed>
    <Country>
    <Abbreviation>US</Abbreviation>
    <Name>United St
    ates of America</Name>
    </Country>
    </Address>
    <Telephone version="" action="">
    <Result>
    <ErrorCode/>
    <ErrorDesc/>
    <StatusCode/>
    <StatusDesc/>
    </Result>
    <Number/>
    <PhoneAreaCode/>
    <NewAreaCode/>
    <Prefix/>
    <Suffix/>
    <Extension/>
    <City>
    <Name/>
    </City>
    <State>
    <Name/>
    <Abbreviation/>
    </State>
    <GeoCode>
    <Latitude/>
    <Longitude/>
    </GeoCode>
    <TimeZone>
    <Name/>
    <Code/>
    </TimeZone>
    <Msa>
    <Code/>
    </Msa>
    <Pmsa>
    <Code/>
    </Pmsa>
    <County>
    <Name/>
    <Fips/>
    </County>
    <Country>
    <Abbreviation/>
    <Name/>
    </Country>
    </Telephone>
    <Name version="" action="">
    <Result>
    <ErrorCode/>
    <ErrorDesc/>
    <StatusCode/>
    <StatusDesc/>
    </Result>
    <Company/>
    <Prefix/>
    <Suffix/>
    <Full/>
    <First/>
    <Middle/>
    <Last/>
    <Gender/>
    </Name>
    </doSingleRecordResult>
    </doSingleRecordResponse>
    This is the response i got from a webservice , from this i need to extract customer id .
    I tried like this :
    response := UTL_DBWS.invoke ( l_call,request);
    if RESPONSE.extract('/doSingleRecordResponse/doSingleRecordResult/CustomerCredentials/CustomerID/text()','xmlns:xsi="http://www
    .w3.org/2001/XMLSchema-instance" xmlns="urn:mdWebService"') is not NULL
    then
    errorcode :=RESPONSE.extract('/doSingleRecordResponse/doSingleRecordResult/CustomerCredentials/CustomerID/text()','xmlns:xsi="http://www
    .w3.org/2001/XMLSchema-instance" xmlns="urn:mdWebService"').getStringVal;
    end if;
    I am getting null value into errorcode,
    Can youplease let me know what i am doing wrong?
    Thanks

  • How to assign NULL value to an ITEM in Forms Personalization?

    Hi,
    how to assign NULL value to an ITEM in Forms Personalization?
    please suggest me.
    Thanks

    I don't know what your form personalization does and maybe I misunderstand you ...
    Try
    :item_name := null;

  • The type of the value being assigned to variable ... differs from the current variable type

    I am trying to load a variable on SSIS Execute SQL Task with a string value. I keep on getting an error message :-
    “The type of the value being assigned to variable “User::LegacyColumns” differs from the current variable type”.
    Below are the settings on my package:
    Execute SQL Task Result Set –
    Single Row
    Variable Data Type –
    String
    The data to be loaded on the variable is a single row shown below:
    FirstName,LastName,MiddleName,PatientType,Title
    Can someone kindly help me to solve this as I’m lost for ideas.
    Thanks,
    Mpumelelo

    Thank you Sorna. I think I have managed to solve it. After a long search I have found a solution which advises that I should use a Foreach Loop Container. The help is on this link:
    https://social.msdn.microsoft.com/Forums/en-US/f46dea91-c26b-4ffe-ab1c-ebeef57c90b6/error-0xc001f009-at-mypackage-the-type-of-the-value-being-assigned-to-variable?forum=sqlintegrationservices
    Mpumelelo

  • Garbage Collection facilitation by assigning variables to null

    Hello,
    I understand Garbage Collection (GC) can be facilitated by assigning variables to null. Is this true for all variables?
    I have a class and there are some member variables which are strings. Also i have some methods with some string variables declared and defined inside the method. I am assigning null to class member variables and also the string variables of the method.
    is it correct to assign null and faciliate GC for the string variables declared and defined inside the method?
    Class A {
    String t1;
    public void test() {
    String t2 = "test";
    // processing
    t2 = null; // Will this facilitate GC?
    public static void main (String[] args) {
    test();
    A obj = new A();
    A.t1 = "testclass";
    A.t1 = null; // Will this faciliate GC?
    Thanks, Aravinth

    In fact, the java heap is divided into a space for new allocations, and two survivor spaces. The algorithm for when collection occurs in each space is complex, and tuning GC is an interesting topic all its own. Follow the best advice you have been given ... chillax. The JVM has GC under control.
    <think/> Of course, having said this, you can have memory leaks if you create references that never go out of scope, even if they are no longer used. Avoid this.
    � {�                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Assigning a null value

    Hi ,
    I have a consuming web service. Initially while sending a request I have to pass null value to certain parameters. But the parameters are of type string and Im unable to do this. I tried the syntax clear var with null, but this supports only character not string. Please help in this.
    Thanks,
    Sarath.C

    Just to close the thread.

  • 'Show Null Values as' variables not replaced

    I need the null values to display as small as possible so there is an image in my image repository, 1x1px, transparent, that I wanted to display in these null places, but when I inserted something like <img src="&COMPANY_IMAGES.null.gif"> or <img src="#COMPANY_IMAGES#null.gif">, the COMPANY_IMAGES was not replaced with the usual long call, it was just like inserted in the 'Show Null Values as' field.
    I have workarounds
    1) use a static image, that is publicly available - making the app's appearance dependant on that publicly available image.
    2) select columns with nvl(NULLABLE_COL, '<img src="#COMPANY_IMAGES#null.gif">'), which is just a thing, that could be easily forgotten in some place and makes the query even more obscure than it already is.
    I really like neither of them. Is there some other way to call COMPANY_IMAGES in that field or is it just a place where isn't the substitution string available?

    wow. you're right about that substitution not being made in that "Show Null Values as" field. i'll log that issue in a sec. you can work around the issue for now by simply doing that substitution yourself. so if you run this...
    select :WORKSPACE_IMAGES FROM DUAL
    ...from your sqlWorkshop, you'll see that WORKSPACE_IMAGES is substituted with a call like...
    wwv_flow_file_mgr.get_file?p_security_group_id=123456&p_fname=
    ...(where 123456 is my :WORKSPACE_ID). if you wanted to call an image called my_image.jpg in that "Show Null Values as" field, you could just enter the string...
    wwv_flow_file_mgr.get_file?p_security_group_id=123456&p_fname=my_image.jpg
    ...right in there, and you'd find your images rendered correctly. the only thing to watch out for is the hard-coded :WORKSPACE_ID in your field. you'd have to mind at number if you deployed your app in a different workspace.
    hope this helps,
    raj

  • Null values in Numeric fields of Datasets

    I am wondering if anyone has run into this problem before and
    checking to see if anyone has an elegant solution.
    I have a rather large data set. (actually 5 of them on a
    single page) I am sorting certain columns in a table as numbers so
    i assign the variable " ds1.setColumnType("somenumbercolumn",
    "number")" In most cases Spry works great and it sorts by numbers
    properly. The problem is some of the fields in the XML file are
    null and I am trying to sort them as a number. Spry actually
    adjusts for this (as far as i can tell) and treats them like a 0
    which isn't exactly ideal considering there are real zero values in
    the data. I know spry doesn't currently format numbers:
    So here is my question. Does anyone one have a solution to
    fixing null values in a table so that it is still sortable but
    doesn't display a "0" and instead displays something like "--" or
    whatever. I have the option of editing the XML file as well, but I
    still need the table to sort by number.
    If not null values, how about non numeric fields which can
    still be sorted in a numeric column?

    Hi,
    We have an old post that raised a similar problem with yours.
    The post can be found
    here
    For you situation, you should add an if condition for the
    rows that have 0 and to add a custom string instead 0.
    for (var i = 0; i < numRows; i++)
    if(rows
    [ "field_name"] == 0)
    rows[ "field_name" ] = '--';
    Hope this helps you,
    Diana

  • GetParameter() null value

    Hi all,
    We are having a problem using the request.getParameter(String) method. We are using the method to define an argument for a Java Webstart (jnlp mime type) file we are creating with jsp. Other arguments have been successfully created using the request.getServerName() and request.getRequestURI() methods. The getParameter() return value looks fine if printed back to HTML. The jsp file creating the jnlp file is called using an HREF created inside another jsp file as follows:
    <a href="xmlfetch.jsp?filename=mti.xml""></a>
    The param value for filename in each HREF is filled using an String array entry (i.e. +names).
    The xmlfetch.jsp file uses StringBuffers to capture/store the servername, uri and param data as follows:
    StringBuffer svrname = new StringBuffer();
    svrname.append(request.getServerName());
    StringBuffer requri = new StringBuffer();
    requri.append(request.getRequestURI());
    StringBuffer fname = new StringBuffer();
    fname.append(request.getParameter("filename"));
    All 3 variables look ok if dumped in html as follows:
    out.println("svrname=" +svrname);
    out.println("requri=" +requri);
    out.println("fname=" +fname);
    But only the param value is null when the variables are passed as arguments in the jnlp stream as follows:
    <argument><%=svrname.toString()%></argument>
    <argument><%=requri.toString()%></argument>
    <argument><%=fname.toString()%></argument>
    So the question is ... why do the parameter values evaluate to non null when dumped to html but become null when used as an argument for jnlp? AND what is the difference between the strings returned by the 3 request methods we are using as arguments (i.e. why do 2/3 work?).
    ANY HELP APPRECIATED:)
    Greg Hock
    Software Engr
    Northrop Grumman Corp.
    (321) 726-7758
    [email protected]

    I have tried the parameter specification both with and without quotes but either case results in null value for argument going into the Java Webstart (.jnlp) file that I create in the second jsp file (xmlfetch.jsp). What I don't understand is why the parameter looks correct when sent out.println() but is null when not printed and only used for the jnlp app argument. Both the other variables assigned using request.getXXX() methods are ok as arguments...only the parameters passed from the first jsp page (mtiquery.jsp) to the second jsp page (xmlfetch.jsp) become null when used as the jnlp argument.
    Anyone ... please help. :)
    Here is the code for the first jsp page. This page creates a table of filenames each of which has a href link to the second jsp page and passes it's filename as the parameter.
    <%@ page
    language="java"
    import="java.util.*,java.text.*,java.io.*,javax.swing.filechooser.FileFilter"
    %>
    <html>
    <title>MTIX MTI Query Tool</title>
    <body>
    <p>
    <center>
    <h1>JSP MTI QueryTest</h1><br>
    <jsp:include page="copyright.jsp" flush="true"/>
    <br>
    <%=(new java.util.Date())%>
    <%
    String startPath = "../webapps/ATServlets/data/mti";
    File myDir = new File(startPath);
    String myPath = myDir.getCanonicalPath();
    out.println("<br><br><br>Results of Query Path: <br>" myPath "<br><br>");
    String[] filelist = myDir.list();
    out.println("<br>");
    out.println("<center>");
    out.println("<table BORDER COLS=1 width=400>");
    String urlPath = null;
    String hrefPath = null;
    for (int i=0; i<filelist.length; i++)
    urlPath = new String("\"http://judy:8080/ATServlets/jsp/xmlfetch.jsp?filename="+filelist[i]+ "\"");
    hrefPath = new String("<a href=" urlPath ">");
    out.println("<tr><td><center>");
    out.println(hrefPath + filelist[i] + "</a>");
    out.println("</center></td></tr>");
    out.println("</table>");
    out.println("</center>");
    %>
    </center>
    </body>
    </html>
    This first page resulted in source as follows:
    NOTICE that the second jsp page is the HREF and I am using "filename" as the parameter key and the value is assigned (without quotes) to be the filelist entry.
    <html>
    <title>MTIX MTI Query Tool</title>
    <body>
    <p>
    <center>
    <h1>JSP MTI QueryTest</h1><br>
    <html>
    <head>
    <title></title>
    </head>
    <body>
    <p>(c) 1999,2000,2001 Northrop-Grumman All Rights Reserved </p>
    </body>
    </html>
    <br>
    Wed Aug 08 10:01:34 EDT 2001
    <br><br><br>Results of Query Path: <br>/opt/mtix/data/mti<br><br>
    <br>
    <center>
    <table BORDER COLS=1 width=400>
    <tr><td><center>
    MtiOutput.xml
    </center></td></tr>
    <tr><td><center>
    KoreaMTI.xml
    </center></td></tr>
    <tr><td><center>
    testMti.xml
    </center></td></tr>
    <tr><td><center>
    testMti2.xml
    </center></td></tr>
    <tr><td><center>
    testMti4.xml
    </center></td></tr>
    </table>
    </center>
    </center>
    </body>
    </html>
    OK Now here is the second jsp file (xmlfetch.jsp) that is fired up after the table selection. This file creates a stream to the Java Webstart plugin and tries to use the passed parameter as 1 of 3 arguments to the application (see last few lines). The variable fname is used to hold the contents of the getParameter() method.
    <%@ page
    contentType="application/x-java-jnlp-file"
    info="myjnlp"
    import="java.lang.*,java.text.*,java.io.*"
    %>
    <%
    StringBuffer fname = new StringBuffer();
    fname.append(request.getParameter("filename"));
    //fname.append("MtiOutput.xml");
    //out.println("the fname var = " +fname);
    StringBuffer cBase = new StringBuffer();
    cBase.append(!request.isSecure() ? "http://" : "https://");
    cBase.append(request.getServerName());
    if(request.getServerPort() != (request.isSecure() ? 80 : 443))
    cBase.append(':');
    cBase.append(request.getServerPort());
    StringBuffer httpref = new StringBuffer();
    httpref = cBase;
    httpref.append(request.getRequestURI());
    StringBuffer cBase2 = new StringBuffer();
    cBase2.append(!request.isSecure() ? "http://" : "https://");
    cBase2.append(request.getServerName());
    if(request.getServerPort() != (request.isSecure() ? 80 : 443))
    cBase2.append(':');
    cBase2.append("80");
    cBase2.append('/');
    cBase2.append("ATJava");
    cBase2.append('/');
    %>
    <?xml version="1.0" encoding="utf-8"?>
    <!-- JNLP File for downloading xml from servlet -->
    <jnlp
    spec="1.0"
    codebase="<%=cBase2.toString()%>"
    href="<%=httpref.toString()%>">
    <information>
    <title>Catalog Download Application</title>
    <vendor>Northrop Grumman, Inc.</vendor>
    <homepage href="ATJava.init/documents/index.html"/>
    <description>XML Catalog Download Application>
    <description kind="short">A demo.</description>
    <icon href="ATJava.init/images/tomcat.gif"/>
    <offline-allowed/>
    </information>
    <security>
    <all-permissions/>
    </security>
    <resources>
    <j2se version="1.2" initial-heap-size="16m" max-heap-size="512m"/>
    <jar href="ATJava.build/ATJava.jars/ATSignedRuntime.jar" download="eager"/>
    </resources>
    <resources>
    <j2se version="1.3" initial-heap-size="16m" max-heap-size="512m"/>
    <jar href="ATJava.build/ATJava.jars/ATSignedRuntime.jar" download="eager"/>
    </resources>
    <application-desc main-class="mtix.XMLFetch">
    <argument><%=fname.toString()%></argument>
    <argument><%=cBase2.toString()%></argument>
    <argument><%=httpref.toString()%></argument>
    </application-desc>
    </jnlp>
    Please HELP/COMMENT if you can.... Gregg

  • Form displays NULL values

    A page is using PL/SQL script to display data. There are 2 display variables. Instead of bringing initial set of data, it displays NULL values. It "fixes" itself after changing variable values from a drop down menu. Why is that and how to fix it?

    If you plan on performing all of the work under the Click event, then you won't need to worry about assigning a Script scope to the variables, but if you are planning on using those variables outside of the Event, then David's answer is the way to go.
    Another option is to use a hash table as it also works around the issue with variable scope in a UI Event.
    #Define at beginning of script
    $hashtable = @{}
    $OKButton.Add_Click({$hashtable.SelectedTemplate=$Something})
    Boe Prox
    Blog |
    Twitter
    PoshWSUS |
    PoshPAIG | PoshChat |
    PoshEventUI
    PowerShell Deep Dives Book

  • Runtime error from null value

    I have a request to create a Function Module that will be assigned to an Action Box, which when executed will copy long text for Quality Notification tasks.  I have the module created and working, but after my code is executed a runtime error happens due to a null value being passed to a method in the SAP program QM07_UPDATE_ACTIONBOX.  It looks to me like it is trying to perform some kind of cleanup tasks, and is trying to delete a node tree that does not exist.  My code did nothing with any kind of node tree, so I am not sure how to avoid this runtime error.  My code works as desired, except for this error that occurs after my code is processed.  Any assistance would be greatly appreciated!  Below are more details from the error received...
    Error analysis
        An exception occurred that is explained in detail below.
        The exception, which is assigned to class 'CX_SY_REF_IS_INITIAL', was not caught in procedure "QM07_UPDATE_ACTIONBOX" "(FUNCTION)", nor was it propagated by a RAISING clause.  Since the caller of the procedure could not have anticipated that the exception would occur, the current program is terminated.
        The reason for the exception is:
        You attempted to use a 'NULL' object reference (points to 'nothing') access a component (variable: "TREE_ACTIONBOX").   An object reference must point to an object (an instance of a class) before it can be used to access components.  Either the reference was never set or it was set to 'NULL' using the CLEAR statement.
    Information on where terminated
        Termination occurred in the ABAP program "SAPLQM07" - in "QM07_UPDATE_ACTIONBOX".  The main program was "SAPLIQS0 ".
        In the source code you have the termination point in line 39 of the (Include) program "LQM07U12".  The termination is caused because exception "CX_SY_REF_IS_INITIAL" occurred in procedure "QM07_UPDATE_ACTIONBOX" "(FUNCTION)", but it was neither handled locally nor declared in the RAISING clause of its signature.
        The procedure is in program "SAPLQM07 "; its source code begins in line 1 of the (Include program "LQM07U12 ".
       28 * bei Tree werden Knoten und Items gelöscht bei Table Control wird
       29 * nur g_control_tab neu aufgebaut
       30   if g_tree = c_x.
       31 *---- Löschen der bestehenden Knoten und Items
       32
       33 * Tabelle der Knotenschlüssel erzeugen
       34     loop at g_node_tab into l_node.
       35       append l_node-node_key to l_dnodes_tab.
       36     endloop.
       37
       38 * Items
    >>>>>     call method tree_actionbox->delete_all_items_of_nodes
       40       EXPORTING
       41         node_key_table          = l_dnodes_tab
       42       EXCEPTIONS
       43         failed                  = 1
       44         cntl_system_error       = 2
       45         error_in_node_key_table = 3
       46         dp_error                = 4.

    Yes, I have searched the notes.  I used the keywords suggested in the dump...
    If the error occures in a non-modified SAP program, you may be able to find an interim solution in an SAP Note.
    If you have access to SAP Notes, carry out a search with the following keywords:
    "OBJECTS_OBJREF_NOT_ASSIGNED" "CX_SY_REF_IS_INITIAL"
    "SAPLQM07" or "LQM07U12"
    "QM07_UPDATE_ACTIONBOX"

Maybe you are looking for