Variable "not defined"?  It's being set and incremented..

Hello, everyone.
I've got a real confusing issue.  I have one page that grabs some data from the database, then loops through seven included files in the CFOUTPUT.  One of the seven includes is setting a variable at the top of the page called "confirmed" to zero (0), has its own loop where it increments the value by one under certain conditions, then displays the value after its own loop is done.
The problem is that I am occasionally getting an error message that says "confirmed" is undefined (it happens 3 out of 5 times.)  How can this be?  Is there any way that anyone can think of that would cause this variable to disappear during processing?
Thanks,
^_^

I know variables don't disappear on their own.  Something is affecting it, I just don't know what; that's why I'm asking if anyone else knows of something that might cause this.
It's a short file, I'll include it, here.  I cannot see where "confirmed" is being removed.  It is used only in this page, nowhere else.
^_^
<cfsetting enablecfoutputonly="yes" showdebugoutput="yes" requesttimeout="86400">
<cfparam name="marketplace_module" default="AMAZON">
<cfparam name="marketplace_pk" default="">
<cfquery name="marketplaceParams" datasource="#data_source#">
<!--- GET DATA ON MARKET --->
</cfquery>
<cfwddx action="WDDX2CFML" input="#marketplaceParams.marketplaceData_wddx#" output="marketplaceData">
<cfset amazon_sellername = marketplaceData.account_sellername>
<cfset This_Host = Root_Host & "\" & marketplaceParams.clientid>
<cfset amazon_dir_local = This_Host & "\AMAZON\ref">
<cfset amazon_file = "ref_#DateFormat(Now(),'mmddyyyy')##TimeFormat(Now(),'HHmm')#.txt">
<cftry>
<cfquery name="order" datasource="#data_source#">
<!--- QUERY TO GET ORDERS --->
</cfquery>
<cfset confirmed = 0><!--- IT'S BEING INITIALIZED HERE --->
<cfif order.RecordCount>
<cfset content = "order-id order-item-id refund-amount reason message">
<cffile action="WRITE" file="#amazon_dir_local#\#amazon_file#" output="#content#" addnewline="Yes">
<cfoutput query="order">
<cfset refund_amount = DecimalFormat(unit_price+unit_shipping)>
<cfif unit_status EQ 9>
<cfset reason = "Inventory No Longer Available">
<cfelse>
<cfset reason = "Customer Return">
</cfif>
<cfset message = "">
<cfset content = order_id & CHR(9) & order_item_id & CHR(9) & refund_amount & CHR(9) & reason & CHR(9) & message>
<cffile action="APPEND" file="#amazon_dir_local#\#amazon_file#" output="#content#" addnewline="Yes">
<cfquery name="update" datasource="#data_source#">
<!--- QUERY TO UPDATE DATABASE --->
</cfquery>
<cfset notes = "Refund for Line #lineno# submitted to AMAZON.">
<cf_noteit clientid="1111" action="add" keytype="orderno" key="#orderno#" username="#userData.username#" notes="#notes#" show="0">
<cfset confirmed = val(confirmed) + 1><!--- BEING INCREMENTED HERE --->
<cfdump var="#confirmed#" expand="yes" label="confirmed value"><!--- JUST ADDED THIS PART --->
</cfoutput>
</cfif>
<cfcatch>
<cfoutput>#cfcatch.Message# - #cfcatch.Detail#</cfoutput>
<cfmail to="[my email address]" from="[server email address]" subject="An error">amazon.ref.exp.cfm has erred#chr(13)##chr(10)##cfcatch.Message# - #cfcatch.Detail#</cfmail>
</cfcatch>
</cftry>
<cfoutput>#val(confirmed)# orderitems refunded.<br/></cfoutput><!--- THIS IS WHERE CF TELLS ME IT'S NOT DEFINED --->
<cfif val(confirmed) gt 0>
<cf_logit siteid="123" username="#userData.username#" action="#val(confirmed)# AMAZON Orders refunded.">
<cffile action="WRITE" file="#amazon_dir_local#\#amazon_file#.flag" output="#amazon_file#" addnewline="No">
<cfoutput>File #amazon_file# written to #amazon_dir_local#.<br/></cfoutput>
</cfif>

Similar Messages

  • Variable not defined: '_XDOXSLTCTX'

    Hi,
    This is Rama krishna. I have implemented a prototype for barcode generation service using BI Publisher API. I am using Jdeveloper 11g. I have created a small ADF Fusion application to consume the webservice.
    My application is working fine when I run it in Jdeveloper 11g.
    When I run it after deploying to standalone Weblogic server 10.3, I am getting the following error while generating the XSL. I found that RTFProcessor did not generate xsl:params and xsl:variables.
    020609_111410132http://oracle.apps.xdo.common.xml.XSLTWrapperEXCEPTION XSL error:
    <Line 11, Column 170>: XML-22031: (Error) Variable not defined: '_XDOXSLTCTX'.
    Any idea why RTFProcessor is not generating XSL properly when deployed to Oracle WLS 10.3?
    Thanks in advance.
    Thanks & Regards,
    Rama Krishna. P

    Are you trying to use _XDOCTX?
    Use the following syntax to declare/set a variable value:
    <?xdoxslt:set_variable($_XDOCTX, 'variable name', value)?>
    Use the following syntax to retrieve a variable value:
    <?xdoxslt:get_variable($_XDOCTX, 'variable name')?>

  • Variable not defined: '_MR'.

    Dear all,
    I developped an RTF-template that runs fine locally.
    If I upload it to the eBusinessSuite and try to run it there, I receive the following error in the OPP log:
    [UNEXPECTED] [24862:RT391458] java.lang.reflect.InvocationTargetException at ....
    Caused by: oracle.xdo.parser.v2.XPathException: Variable not defined: '_MR'.
    I did not define any variable _MR in my template.
    However if I export my template to an XSL-FO Style Sheet, I can find this variable.
    It is defined twice as: <xsl:variable name="_MR" select="number(89.85)" xdofo:alt="internal"/>
    If I use an image in the heading, variable $_MR is used once in a statement that I don't understand.
    If I remove the image, the variable is only declared, but never used.
    In the eBS he is always wrong: with or without image.
    Any help in this would be very appreciated.
    Little update:
    In the XSL-FO are several variables defined for each section in the template:
    _PW = page with
    _PH = page height
    _ML = margin left
    _MR = margin right
    _MT = margin top
    _MB = margin bottom
    _HY ? something to do with header ?
    _FY ? something to do with footer ?
    May be this does ring a bell.

    Hi
    I have a RTF template wherein I am calling a sub-template.
    Whether I invoke the sub-template RTF directly (import:file) or convert it to XSL and import that (import:xsl), I always get this error
    Caused by: oracle.xdo.parser.v2.XPathException: Variable not defined: '_MR'.
    This happens in my local desktop, I have not even copied the files to server.
    My Template Builder version is '5.6 Build 45'
    Please help.
    Ritu
    Edited by: Rits on Oct 15, 2008 12:42 AM

  • Variable not defined: '_MR' error when using sub template

    Hi,
    I am creating a check print report. When I had the check layout and the invoice layout on the same template it worked fine. But when I moved the check layout to a sub template then I started getting the error Variable not defined: '_MR' but I dont have any variable '_MR' can some please help me on this.
    Thanks a ton in advance
    Lakshmanan a.

    Hi Lakshmanan
    Its probably worth running the XML Publisher template regenerator program. somehow, I think your templates are out of sync
    Regards
    Tim
    http://blogs.oracle.com/xmlpublisher

  • Oracle.xdo11g.xpath.XPathException: Variable not defined

    Hello,
    I got two pivot tables in the RTF Word PlugIn, when I take the second one out, the HTLM output shows fine, when I out the second one in, I get the error "oracle.xdo11g.xpath.XPathException: Variable not defined". I used the wizard to create the tables.
    If I upload the layout and try to execute the report online, I get this error" oracle.xdo.XDOException: java.lang.reflect.InvocationTargetException"
    anyone an Idea how I can add two pivot tables to my template without causing xml errors?

    I got those two in a WORD table and as soon as I put the second one in the table (a word layout table by putting my pivot table in it) the error comes.

  • XSQL variable not defined

    Hallo,
    with the new XSQL-Version 9.2.0.4.0 I get this error:
    XSL-1031: (Error) Variable not defined: 'colspan'.
    transforming a XML File like:
    <ingroup >
    <INPUT />
    </ingroup>
    with an XSL-File like:
    <xsl:template match="ingroup">
    <xsl:variable name="colspan">something</xsl:variable>
    <xsl:apply-templates/>
    </xsl:template>
    <xsl:template match="INPUT" >
    <xsl:value-of select="$colspan"/>
    </xsl:template>
    In the former versions it happens correct:
    A variable defined in one scope is usable in all templates called in this scope.
    What do You do? And what shall I do?
    Greetings from Roland Minde

    You can't share XSL variable across templates. It likes a local variable.

  • Variable not defined

    Hi All,
    we are currently upgrading the addon that created using VB6 from B1 2004A to 2007A. When compiling or make project dll file, there is an error message : "Compile Error : variable not defined"
    then the system shows or highlight
    Private Sub Form_Load()
    CRViewer.Top = 0
    CRViewer.Left = 0
    etc
    How to resolve this problem ? Pls give advice.
    Rgd,
    Steve

    Hi,
    Thx for your answer. yes, you are correct. It is CRViewer91in the properties of the CRViewer form meanwhile in the source code CRViewer.
    Rgd,
    Steve

  • Variable not defined after running for() loop.

    Hi,
    I have a little problem, I have created a for loop, which seems to work, except that a variable within the for() loop gets lost, because if I try to call the variable after the loop, it says it's not there. anyway, here is my code, followed by the error. Thanks!
    <%
    Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:testdb");
    Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
    String sql_count = "SELECT COUNT(*) FROM users";
    ResultSet cn = stmt.executeQuery(sql_count);
    cn.first();
    int row_count = cn.getInt(1);
    int num = (int)(Math.random() * (row_count));
    int inum;
    for (inum=0; inum<row_count; inum++)
    int jnum = inum + num;
    if (jnum >= row_count) { jnum = 1; }
    String sql = "SELECT * FROM users WHERE ID = "+jnum+"";
    ResultSet rs = stmt.executeQuery(sql);
    int ce = rs.getInt("cr_earned");
    int cu = rs.getInt("cr_used");
    if ((ce-cu) > 0) { inum = row_count + 1; }
    String sql = "SELECT * FROM users WHERE ID = "+jnum+"";
    ResultSet rs = stmt.executeQuery(sql);
    rs.first();
    String url = rs.getString("url");
    con.close();
    %>
    ***********************ERROR***********************
    Generated servlet error:
    C:\tomcat\jakarta-tomcat-4.0\work\localhost\examples\gtt\surf$jsp.java:93: Undefined variable or class name: rs
    rs.first();
    ^
    An error occurred between lines: 17 and 43 in the jsp file: /gtt/surf.jsp
    Generated servlet error:
    C:\tomcat\jakarta-tomcat-4.0\work\localhost\examples\gtt\surf$jsp.java:94: Undefined variable or class name: rs
    String url = rs.getString("url");
    ^

    now i've defined them all before the loop and I get this error. Error is following modified code below.
    <%
    Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:testdb");
    Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
    String sql_count = "SELECT COUNT(*) FROM users";
    ResultSet cn = stmt.executeQuery(sql_count);
    cn.first();
    int row_count = cn.getInt(1);
    int num = (int)(Math.random() * (row_count));
    int inum;
    int jnum;
    ResultSet rs;
    for (inum=0; inum<row_count; inum++)
    jnum = inum + num;
    if (jnum >= row_count) { jnum = 1; }
    String sql = "SELECT * FROM users WHERE ID = "+jnum+"";
    rs = stmt.executeQuery(sql);
    int ce = rs.getInt("cr_earned");
    int cu = rs.getInt("cr_used");
    if ((ce-cu) > 0) { inum = row_count + 1; }
    rs.first();
    String url = rs.getString("url");
    con.close();
    %>
    ***********ERROR***************
    An error occurred between lines: 17 and 45 in the jsp file: /gtt/surf.jsp
    Generated servlet error:
    C:\tomcat\jakarta-tomcat-4.0\work\localhost\examples\gtt\surf$jsp.java:95: Variable rs may not have been initialized.
    rs.first();
    ^
    Thanks anyone.... ;-)

  • Pass codes were set and i did not set them now it will not reset, pass codes were set and i did not set them now it will not reset

    my itouch has started asking for pass codes i did not set. i have used the same 4 digit pass code for many years. i was attempting to update to iso 7 when i went to reset the device i was prompted for the code. i tried my standard 4 dig. number. also my restriction setting is on also asking for a pass code. I have never used restriction setting EVER. i dont lock my device i dont sign out of mail. worry? no nothing to hide. it agrivates me that i learned that certain apps ive downloaded may be changing my settings and accessing information without my knowing. i dont mind the info leave my settings alone.

    Place the iOS device in Recovery Mode and then connect to your computer and restore via iTunes. The iPod will be erased.
    iOS: Wrong passcode results in red disabled screen                         
    If recovery mode does not work try DFU mode.                        
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings        
    For how to restore:
    iTunes: Restoring iOS software
    To restore from backup see:
    iOS: Back up and restore your iOS device with iCloud or iTunes
    If you restore from iCloud backup the apps will be automatically downloaded. If you restore from iTunes backup the apps and music have to be in the iTunes library since synced media like apps and music are not included in the backup of the iOS device that iTunes makes.
    You can redownload most iTunes purchases by:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store        
    If problem what happens or does not happen and when in the instructions? When you successfully get the iPod in recovery mode and connect to computer iTunes should say it found an iPod in recovery mode.

  • Is anyone else having difficulties with the Appstore not loading, iTunes store being unresponsive, and iTunes radio being down constantly today?

    My itunes store is having connectivity issues and my net connection is fine.  My appstore is also coming up blank rather frequently as well.  Also I have not been able to get my itunes radio to work - saying an internet connection problem - again not the issue.  Anyone else having these issues?

    It sure is...all three keep acting very wonky.  I'll be able to access the store from my macbook and then browse then not be able to connect.  Same goes for app store....
    As for itunes radio....seems a hot topic for everyone.

  • Entering a matrix in a fomula knot results in "variable not defined" error

    if i enter a matrix in a formula code, the program keeps telling me i have a undefined variable.
    usually, matlab does work with code like "M=[123 456];" just fine.
    the manual states, that in a formula knot code just works like it works in matlab.
    what's my mistake?

    to use a matrix inside a formula node, you must declare a 2-dimensional array of the type you want to use. for example:
    int32 y[2][2];
    to assign values to the fields you can index them:
    y[0][1] = 1;
    you also could use a loop to put the values or pass a allready initialised array into the formula node.
    Maybe these links also give you some hints:
    problem regarding the formula node
    array formula node
    regards,
    Robert H.
    National Instruments

  • QUESTION - Has anyone else recently experienced an iPhone or iPad's alarm going off by itself, without being set by the user?

    Has anyone else had his/her phone alarm (on the clock app) go off by itself, without being set, and with a very weird sound?
    Happened to me at 11:34 pm last night (Oct 28, 2013). I'm using an iPhone 5 with iOS 6.  Sound was named something like "Orari" and sounded like a woo-woo ghostly alarm. I immediately swiped to stop the alarm and then deleted the alarm, which I had NOT set, but which seems to have set itself.  The iPhone was plugged into my iMac at the time.  There is no such sound on my phone or, it seems, anywhere (I Googled).
    The night before, Oct 27, something similar happened to my iPad mini running iOS 6 ... also plugged in to recharge, but at a wall socket ... the sound was like a fire or smoke alarm.
    I know it's Halloween week, but some of us need our sleep!
    Any explanations?

    Hi Littleleslie,
    Have you tried resetting the device (nothing will be lost): Hold down the Home and Power buttons at the same time and continue to hold them down until the Silver Apple appears (up to 30 seconds). Once the Home screen comes up, double tap the Home key and make sure you don't see the Alarm app in the list of background apps. If you do, swipe up on the thumbnail for it to close it out completely.
    Then all you can do is wait to see if it will let you sleep through the night!
    Good luck!
    Cheers,
    GB

  • Xslt error: the expression does not evaluate to a node-set

    hi guys - i'm really down because i cannot find / understand my xsl error and i have to finish my work very very soon
    the error message (by using xalan to create from the xml file my html output) is the following:
    xslt error: the expression does not evaluate to a node-set
    and the code fragement is:
    <xsl:template name="getNext">
    <xsl:param name="currentKnoten" />
    <xsl:for-each select="$currentKnoten"> //error is in this line
    </xsl:for-each>
    </xsl:template>please... help me....

    ok thanks!!! this saved me some time ;-)
    now i go back to the origin problem... my main idea is the following xsl code... may u can see here the problem with the node site.. but i think u need the xml file or?
    however this is my relevant xsl code:
    <xsl:template match="DATA">
              <xsl:element name="process">
                   <xsl:attribute name="name">
                        <xsl:value-of select="@name" />
                   </xsl:attribute>
                   <xsl:apply-templates select="INSTANCE"/>
              </xsl:element>
         </xsl:template>
    <xsl:template match="INSTANCE[@class='Data']">
              <xsl:element name="node">
                   <xsl:attribute name="name">
                        <xsl:value-of select="@name" />
                   </xsl:attribute>
                   <xsl:attribute name="class">
                        <xsl:value-of select="@class" />
                   </xsl:attribute>
                   <xsl:call-template name="copyAttributes" />
                   <xsl:variable name="nextNodes">
                        <xsl:value-of select="key('keyGetData', key('keyFrom', @name)/../TO/@instance)" />
                   </xsl:variable>
                   <xsl:call-template name="getNext">
                        <xsl:with-param name="currentNode" select="$nextNodes" />
                   </xsl:call-template>
              </xsl:element>
    </xsl:template>     
    <xsl:template name="getNext">
              <xsl:param name="currentNode"/>
              <xsl:for-each select="$currentNode">
                   <xsl:element name="node">
                        <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
                        <xsl:attribute name="class"><xsl:value-of select="@class"/></xsl:attribute>
                        <xsl:variable name="nextNodes">
                             <xsl:value-of select="key('keyGetData', key('keyFrom', @name)/../TO/@instance)"/>
                        </xsl:variable>
                        <xsl:call-template name="copyAttributes"/>
                        <xsl:call-template name="getNext">
                             <xsl:with-param name="currentNode" select="$nextNodes"/>
                        </xsl:call-template>
                   </xsl:element>
              </xsl:for-each>
         </xsl:template>
         <xsl:template name="copyAttributes">
              <xsl:for-each select="descendant::*">
                   <xsl:copy>
                        <xsl:copy-of select="@*|node()"/>
                   </xsl:copy>
              </xsl:for-each>
         </xsl:template>
         <xsl:template match="@*|node()">
              <xsl:apply-templates/>
         </xsl:template>

  • Error "Item is not defined as an Inventory Item" using oInventoryGenEntry

    I am trying to create a Receipt from Production with this code:
                    receive = (Documents)_Company.GetBusinessObject(BoObjectTypes.oInventoryGenEntry);
                    receiveLine = receive.Lines;
                            receiveLine.BaseType = 202;
                            receiveLine.BaseEntry = oli.ProductionOrderNumber;
                            receiveLine.BaseLine = 0;
                            receiveLine.Quantity = oli.Quantity;
                            receiveLine.WarehouseCode = "01";
                    int errorCode = receive.Add();
    where the production order will contain several component items that make up a finished good.  Two of the component items are Labor and Royalties and are not marked as Inventory Items.
    The Add method returns this error:
    "Item is not defined as an Inventory Item" and references one the non-inventory items (ie 'Labor').
    I can received the same Production Order through SBO without an error.
    Suggestions?
    Thanks

    Because I am concerned about eliminating Labor from the Bill Of Material and its effect on the 'Acutal Product Cost' when I create a Production Order I set up a test.
    I created two Finished Goods Inventory Items with similar Bills of Material.  Both included a Labor component (non-inventory item).  The difference though, is one Labor component has an Item Type of Labor and the other Labor component has an Item Type of  'Items'
    Next, I create a Work order for each of the finished items.  Then I did a receipt from Production and closed the Work Orders.
    Looking at the Production Order summary, the Finished Good had an 'Actual Additional Cost' that was non-zero for the Finished Good that had a Labor component of the 'Items'; the other Finshed Good had a zero 'Actual Additional Cost'.  These seems in conflict with the eLearning segment on Production.
    At this point is this a different Forum?

  • Error message  - Message no. 26168, Document type '' not defined .

    Hi,
    I am setting up QA system after successful building of Dev System .
    While chnaging newly created folder in QA system gives error message  - Message no. 26168, Document type '' not defined .
    Document Type exists and are used to create folders successfully.
    Why I am getting this error?
    Kind Regards
    Harish

    Hi,
    Am Not able to implement this Note .
    Am facing the same issue .Please let me know the solution ASAP.
    Our SAP Version ECC6 EHP6
    Regards,
    Veeramani

Maybe you are looking for