Substring doesn't work in KM

Can anyone explain why following code doesn't work in my KM:
<%
String viewName = new String (snpRef.getInfo("COLL_NAME"));
nameLength = viewName.length();
if (nameLength >30) {
     viewName = viewName.substring(0,30);
%>
It falls with exception:
com.sunopsis.tools.core.exception.SnpsSimpleMessageException: Error during task interpretation
Task:5
java.lang.Exception: BeanShell script error: Sourced file: inline evaluation of: ``out.print("\ncreate view \t") ; out.print(snpRef.getInfo("SRC_WORK_SCHEMA") ) ; . . . '' Token Parsing Error: Lexical error at line 4, column 38. Encountered: "\n" (10), after : "\"": <at unknown location>
BSF info: #Create view on source at line: 0 column: columnNo
     at com.sunopsis.dwg.codeinterpretor.a.a(a.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.k(e.java)
     at com.sunopsis.dwg.cmd.h.A(h.java)
     at com.sunopsis.dwg.cmd.e.run(e.java)
     at java.lang.Thread.run(Thread.java:619)
I have tried without substring and everything works fine.
<%
String viewName = new String (snpRef.getInfo("COLL_NAME"));
nameLength = viewName.length();
if (nameLength >30) {
     viewName = viewName + "xx";
%>
THNX in advance!
Edited by: user13278245 on Jun 30, 2010 6:58 AM

This worked for me :-
<@
String viewName = new String ("<%=odiRef.getInfo("COLL_NAME")%>");
nameLength = viewName.length();
if (nameLength >30) {
viewName = viewName.substring(0,30);
System.out.print(viewName);
@>
Cheers
John
http://john-goodwin.blogspot.com/

Similar Messages

  • SUBSTR doesn't work THE ANSWER

    stumbled onto (the really silly) solution
    assume an XML file with the line <test>abcdefghij</test>
    The users guide instructs you to get a data field by opening insert/field from the BI menu and dragging the field into the layout. So, a basic retrieval would look like (I can't show the grey so I am enclosing it in brackets)
    basic test: [test] -- [test] indicates a draggedfield
    which works fine, producing
    basic test: abcdefghij
    But if you attempt the same thing (dragging the field into the layout) while using any of the functions, it fails. for example,
    first substr test: <? xdofx:substr([test], 1, 4) ?> -- again, [test] is dragged
    produces
    first substr test: abcdefghij
    Apparently BI, in its wisdom (?) assumes you always mean the entire field and ignores everything else.
    the simple solution. When using a function (perhaps any xdofx command?), just type the name of the XML field and never, never, never drag it in via insert / field. That is:
    the correct substr: <?xdofx:substr(test, 1, 4) ?> -- test just typed / not dragged
    produces;
    the correct substr: abcd
    also applies to other functions. For example:
    a simple instring: <?xdofx:instr([test], 'd') ?> -- [test] indicates dragged field
    returns
    a simple instring; abcdefghi
    while using
    a simple instring: <?xdofx:instr(test, 'd') ?> -- test manually typed
    returns
    a simple instring: 4
    I have been grinding through documentation andcannot find this stupid little goodie anyplace. Apparently, "test and ye shall find"
    Thanks to all of those who responded. Don't worry, I will be back with more stupid questions.
    Frank

    if you put proper element name inside the function you will be getting correctly.
    but i suppose you used the drag & drop feature and you are talking about the bug in drag and drop :)

  • Swf previews in browser and doesn't work on server after upgrade from cs3 to cs5

         I have upgraded from CS3 to CS5. My site uses a template created in dreamweaver 8.  When I edit a page and embed a .swf file created in flash cs5, it doesn't work on my server, but works on my computer when I 'test in browser'.  I have uploaded all the files in the 'scripts' directory.  I am streaming video.  I have tried using both actionscript 2.0 and 3.0 and streaming .flv and .f4v.  None work.
    I have a big site and do not wan't to redo my template unless I absolutely have to.
    Here is the link:
    http://retinavitreous.com/educationalvideo2010/clips/intro_eyesees.html
    Here is the code on my page:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <!-- saved from url=(0014)about:internet -->
    <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/mainnopop.dwt" codeOutsideHTMLIsLocked="false" -->
    <head>
    <!-- InstanceBeginEditable name="doctitle" -->
    <title>video vitrectomy for macular hole re-operation ilm peel</title>
    <!-- InstanceEndEditable -->
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <style type="text/css">
    td img {display: block;}body {
    background-color: #0000FF;
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
    a:link {
    color: #FFFF00;
    a:visited {
    color: #00FFFF;
    a:hover {
    color: #FFFFFF;
    a:active {
    color: #99CC00;
    #main {
    position:absolute;
    width:579px;
    height:815px;
    z-index:1;
    left: 168px;
    top: 96px;
    #right {
    position:absolute;
    width:238px;
    height:817px;
    z-index:2;
    left: 792px;
    top: 98px;
    </style>
    <!--Fireworks 8 Dreamweaver 8 target.  Created Tue May 26 14:59:01 GMT-0400 (Eastern Daylight Time) 2009-->
    <script language="JavaScript1.2" type="text/javascript">
    <!--
    function MM_findObj(n, d) { //v4.01
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
    function MM_swapImage() { //v3.0
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
       if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    function MM_swapImgRestore() { //v3.0
      var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    //-->
    </script>
    <!-- InstanceBeginEditable name="head" -->
    <script src="../../Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
    <script src="../../Scripts/swfobject_modified.js" type="text/javascript"></script>
    <!-- InstanceEndEditable -->
    <link href="../../css/yellowblue.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
    <!--
    body,td,th {
    color: #FFFBF0;
    -->
    </style></head>
    <body bgcolor="#ffffff" onload="MM_preloadImages('../../Templates/tempanimation/temp_animation_r1_c1_f2.gif','../ ../Templates/tempanimation/tempanimation_r1_c1_f2.gif','../../Templates/tempanimation/temp _animation_r1_c2_f2.gif','../../Templates/tempanimation/tempanimation_r1_c2_f2.gif','../.. /Templates/tempanimation/temp_animation_r1_c4_f2.gif','../../Templates/tempanimation/tempa nimation_r1_c4_f2.gif','../../Templates/tempanimation/temp_animation_r1_c5_f2.gif','../../ Templates/tempanimation/tempanimation_r1_c5_f2.gif','../../Templates/tempanimation/temp_an imation_r1_c7_f2.gif','../../Templates/tempanimation/tempanimation_r1_c7_f2.gif','../../Te mplates/tempanimation/temp_animation_r1_c8_f2.gif','../../Templates/tempanimation/tempanim ation_r1_c8_f2.gif','../../Templates/tempanimation/temp_animation_r2_c6_f2.gif','../../Tem plates/tempanimation/tempanimation_r2_c6_f2.gif','../../Templates/tempanimation/temp_anima tion_r4_c1_f2.gif','../../Templates/tempanimation/tempanimation_r4_c1_f2.gif','../../Templ ates/tempanimation/temp_animation_r5_c1_f2.gif','../../Templates/tempanimation/tempanimati on_r5_c1_f2.gif','../../Templates/tempanimation/temp_animation_r6_c1_f2.gif','../../Templa tes/tempanimation/tempanimation_r6_c1_f2.gif','../../Templates/tempanimation/temp_animatio n_r7_c1_f2.gif','../../Templates/tempanimation/tempanimation_r7_c1_f2.gif','../../Template s/tempanimation/temp_animation_r8_c1_f2.gif','../../Templates/tempanimation/tempanimation_ r8_c1_f2.gif','../../Templates/tempanimation/temp_animation_r9_c1_f2.gif','../../Templates /tempanimation/tempanimation_r9_c1_f2.gif','../../Templates/tempanimation/temp_animation_r 11_c1_f2.gif','../../Templates/tempanimation/tempanimation_r11_c1_f2.gif')">
    <table border="0" cellpadding="0" cellspacing="0" width="1440">
    <!-- fwtable fwsrc="tempanimation.png" fwbase="tempanimation.gif" fwstyle="Dreamweaver" fwdocid = "41244840" fwnested="0" -->
      <tr>
       <td><img src="../../Templates/tempanimation/spacer.gif" width="99" height="1" border="0" alt="" /></td>
       <td><img src="../../Templates/tempanimation/spacer.gif" width="68" height="1" border="0" alt="" /></td>
       <td><img src="../../Templates/tempanimation/spacer.gif" width="14" height="1" border="0" alt="" /></td>
       <td><img src="../../Templates/tempanimation/spacer.gif" width="85" height="1" border="0" alt="" /></td>
       <td><img src="../../Templates/tempanimation/spacer.gif" width="121" height="1" border="0" alt="" /></td>
       <td><img src="../../Templates/tempanimation/spacer.gif" width="114" height="1" border="0" alt="" /></td>
       <td><img src="../../Templates/tempanimation/spacer.gif" width="160" height="1" border="0" alt="" /></td>
       <td><img src="../../Templates/tempanimation/spacer.gif" width="163" height="1" border="0" alt="" /></td>
       <td><img src="../../Templates/tempanimation/spacer.gif" width="616" height="1" border="0" alt="" /></td>
       <td><img src="../../Templates/tempanimation/spacer.gif" width="1" height="1" border="0" alt="" /></td>
      </tr>
      <tr>
       <td rowspan="2"><a href="../../index.php" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('tempanimation_r1_c1','','../../Templates/tempanimation/temp_an imation_r1_c1_f2.gif','tempanimation_r1_c1','','../../Templates/tempanimation/tempanimatio n_r1_c1_f2.gif',1)"><img name="tempanimation_r1_c1" src="../../Templates/tempanimation/tempanimation_r1_c1.gif" width="99" height="24" border="0" id="tempanimation_r1_c1" alt="" /></a></td>
       <td rowspan="2" colspan="2"><a href="../../ouroffices/alloffices.html" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('tempanimation_r1_c2','','../../Templates/tempanimation/temp_an imation_r1_c2_f2.gif','tempanimation_r1_c2','','../../Templates/tempanimation/tempanimatio n_r1_c2_f2.gif',1)"><img name="tempanimation_r1_c2" src="../../Templates/tempanimation/tempanimation_r1_c2.gif" width="82" height="24" border="0" id="tempanimation_r1_c2" alt="" /></a></td>
       <td rowspan="2"><a href="../../patientinfo/forms.html" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('tempanimation_r1_c4','','../../Templates/tempanimation/temp_an imation_r1_c4_f2.gif','tempanimation_r1_c4','','../../Templates/tempanimation/tempanimatio n_r1_c4_f2.gif',1)"><img name="tempanimation_r1_c4" src="../../Templates/tempanimation/tempanimation_r1_c4.gif" width="85" height="24" border="0" id="tempanimation_r1_c4" alt="" /></a></td>
       <td rowspan="2"><a href="../../treatments/overviewtreatments.html" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('tempanimation_r1_c5','','../../Templates/tempanimation/temp_an imation_r1_c5_f2.gif','tempanimation_r1_c5','','../../Templates/tempanimation/tempanimatio n_r1_c5_f2.gif',1)"><img name="tempanimation_r1_c5" src="../../Templates/tempanimation/tempanimation_r1_c5.gif" width="121" height="24" border="0" id="tempanimation_r1_c5" alt="" /></a></td>
       <td><img name="tempanimation_r1_c6" src="../../Templates/tempanimation/tempanimation_r1_c6.gif" width="114" height="1" border="0" id="tempanimation_r1_c6" alt="" /></td>
       <td rowspan="2"><a href="../../video files/videostart.html" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('tempanimation_r1_c7','','../../Templates/tempanimation/temp_an imation_r1_c7_f2.gif','tempanimation_r1_c7','','../../Templates/tempanimation/tempanimatio n_r1_c7_f2.gif',1)"><img name="tempanimation_r1_c7" src="../../Templates/tempanimation/tempanimation_r1_c7.gif" width="160" height="24" border="0" id="tempanimation_r1_c7" alt="" /></a></td>
       <td rowspan="2"><a href="../../flash/animations/overview_animations.html" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('tempanimation_r1_c8','','../../Templates/tempanimation/temp_an imation_r1_c8_f2.gif','tempanimation_r1_c8','','../../Templates/tempanimation/tempanimatio n_r1_c8_f2.gif',1)"><img name="tempanimation_r1_c8" src="../../Templates/tempanimation/tempanimation_r1_c8.gif" width="163" height="24" border="0" id="tempanimation_r1_c8" alt="" /></a></td>
       <td><img name="tempanimation_r1_c9" src="../../Templates/tempanimation/tempanimation_r1_c9.gif" width="616" height="1" border="0" id="tempanimation_r1_c9" alt="" /></td>
       <td><img src="../../Templates/tempanimation/spacer.gif" width="1" height="1" border="0" alt="" /></td>
      </tr>
      <tr>
       <td><a href="../../patientinfo/insurancepar.html" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('tempanimation_r2_c6','','../../Templates/tempanimation/temp_an imation_r2_c6_f2.gif','tempanimation_r2_c6','','../../Templates/tempanimation/tempanimatio n_r2_c6_f2.gif',1)"><img name="tempanimation_r2_c6" src="../../Templates/tempanimation/tempanimation_r2_c6.gif" width="114" height="23" border="0" id="tempanimation_r2_c6" alt="" /></a></td>
       <td><img name="tempanimation_r2_c9" src="../../Templates/tempanimation/tempanimation_r2_c9.gif" width="616" height="23" border="0" id="tempanimation_r2_c9" alt="" /></td>
       <td><img src="../../Templates/tempanimation/spacer.gif" width="1" height="23" border="0" alt="" /></td>
      </tr>
      <tr>
       <td colspan="9"><img name="tempanimation_r3_c1" src="../../Templates/tempanimation/tempanimation_r3_c1.gif" width="1440" height="69" border="0" id="tempanimation_r3_c1" alt="" /></td>
       <td><img src="../../Templates/tempanimation/spacer.gif" width="1" height="69" border="0" alt="" /></td>
      </tr>
      <tr>
       <td colspan="2"><a href="../../patientinfo/overview_patientinfo.html" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('tempanimation_r4_c1','','../../Templates/tempanimation/temp_an imation_r4_c1_f2.gif','tempanimation_r4_c1','','../../Templates/tempanimation/tempanimatio n_r4_c1_f2.gif',1)"><img name="tempanimation_r4_c1" src="../../Templates/tempanimation/tempanimation_r4_c1.gif" width="167" height="30" border="0" id="tempanimation_r4_c1" alt="" /></a></td>
       <td rowspan="9" colspan="7"                  ><div id="main"><!-- InstanceBeginEditable name="main" -->
         <h2 align="center">How the Eye Sees Animation
         </h2>
         <p align="center">
           <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="874" height="520" id="FlashID" title="eye sees">
             <param name="movie" value="eyeseesas2.swf" />
             <param name="quality" value="high" />
             <param name="wmode" value="opaque" />
             <param name="swfversion" value="6.0.65.0" />
             <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
             <param name="expressinstall" value="../../Scripts/expressInstall.swf" />
             <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
             <!--[if !IE]>-->
             <object type="application/x-shockwave-flash" data="eyeseesas2.swf" width="874" height="520">
               <!--<![endif]-->
               <param name="quality" value="high" />
               <param name="wmode" value="opaque" />
               <param name="swfversion" value="6.0.65.0" />
               <param name="expressinstall" value="../../Scripts/expressInstall.swf" />
               <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
               <div>
                 <h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
                 <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
               </div>
               <!--[if !IE]>-->
             </object>
             <!--<![endif]-->
           </object>
         </p>
       <!-- InstanceEndEditable --></div>
        <div id="right"><!-- InstanceBeginEditable name="right" -->
          <p> </p>
          <script type="text/javascript">
    swfobject.registerObject("FlashID");
          </script>
        <!-- InstanceEndEditable --></div></td>
       <td><img src="../../Templates/tempanimation/spacer.gif" width="1" height="30" border="0" alt="" /></td>
      </tr>
      <tr>
       <td colspan="2"><a href="../../diseases/overview_diseases.html" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('tempanimation_r5_c1','','../../Templates/tempanimation/temp_an imation_r5_c1_f2.gif','tempanimation_r5_c1','','../../Templates/tempanimation/tempanimatio n_r5_c1_f2.gif',1)"><img name="tempanimation_r5_c1" src="../../Templates/tempanimation/tempanimation_r5_c1.gif" width="167" height="33" border="0" id="tempanimation_r5_c1" alt="" /></a></td>
       <td><img src="../../Templates/tempanimation/spacer.gif" width="1" height="33" border="0" alt="" /></td>
      </tr>
      <tr>
       <td colspan="2"><a href="../../refdoc/overview_refdoc.html" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('tempanimation_r6_c1','','../../Templates/tempanimation/temp_an imation_r6_c1_f2.gif','tempanimation_r6_c1','','../../Templates/tempanimation/tempanimatio n_r6_c1_f2.gif',1)"><img name="tempanimation_r6_c1" src="../../Templates/tempanimation/tempanimation_r6_c1.gif" width="167" height="32" border="0" id="tempanimation_r6_c1" alt="" /></a></td>
       <td><img src="../../Templates/tempanimation/spacer.gif" width="1" height="32" border="0" alt="" /></td>
      </tr>
      <tr>
       <td colspan="2"><a href="../../ourdocs/alldocs.html" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('tempanimation_r7_c1','','../../Templates/tempanimation/temp_an imation_r7_c1_f2.gif','tempanimation_r7_c1','','../../Templates/tempanimation/tempanimatio n_r7_c1_f2.gif',1)"><img name="tempanimation_r7_c1" src="../../Templates/tempanimation/tempanimation_r7_c1.gif" width="167" height="31" border="0" id="tempanimation_r7_c1" alt="" /></a></td>
       <td><img src="../../Templates/tempanimation/spacer.gif" width="1" height="31" border="0" alt="" /></td>
      </tr>
      <tr>
       <td colspan="2"><a href="../../ouroffices/alloffices.html" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('tempanimation_r8_c1','','../../Templates/tempanimation/temp_an imation_r8_c1_f2.gif','tempanimation_r8_c1','','../../Templates/tempanimation/tempanimatio n_r8_c1_f2.gif',1)"><img name="tempanimation_r8_c1" src="../../Templates/tempanimation/tempanimation_r8_c1.gif" width="167" height="31" border="0" id="tempanimation_r8_c1" alt="" /></a></td>
       <td><img src="../../Templates/tempanimation/spacer.gif" width="1" height="31" border="0" alt="" /></td>
      </tr>
      <tr>
       <td colspan="2"><a href="../../contactus/contacthome.html" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('tempanimation_r9_c1','','../../Templates/tempanimation/temp_an imation_r9_c1_f2.gif','tempanimation_r9_c1','','../../Templates/tempanimation/tempanimatio n_r9_c1_f2.gif',1)"><img name="tempanimation_r9_c1" src="../../Templates/tempanimation/tempanimation_r9_c1.gif" width="167" height="32" border="0" id="tempanimation_r9_c1" alt="" /></a></td>
       <td><img src="../../Templates/tempanimation/spacer.gif" width="1" height="32" border="0" alt="" /></td>
      </tr>
      <tr>
       <td colspan="2"><img name="tempanimation_r10_c1" src="../../Templates/tempanimation/tempanimation_r10_c1.gif" width="167" height="13" border="0" id="tempanimation_r10_c1" alt="" /></td>
       <td><img src="../../Templates/tempanimation/spacer.gif" width="1" height="13" border="0" alt="" /></td>
      </tr>
      <tr>
       <td colspan="2"><a href="../../lowvision/lowvisionhome.html" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('tempanimation_r11_c1','','../../Templates/tempanimation/temp_a nimation_r11_c1_f2.gif','tempanimation_r11_c1','','../../Templates/tempanimation/tempanima tion_r11_c1_f2.gif',1)"><img name="tempanimation_r11_c1" src="../../Templates/tempanimation/tempanimation_r11_c1.gif" width="167" height="102" border="0" id="tempanimation_r11_c1" alt="" /></a></td>
       <td><img src="../../Templates/tempanimation/spacer.gif" width="1" height="102" border="0" alt="" /></td>
      </tr>
      <tr>
       <td colspan="2"><img name="tempanimation_r12_c1" src="../../Templates/tempanimation/tempanimation_r12_c1.gif" width="167" height="503" border="0" id="tempanimation_r12_c1" alt="" /></td>
       <td><img src="../../Templates/tempanimation/spacer.gif" width="1" height="503" border="0" alt="" /></td>
      </tr>
    </table>
    </body>
    <!-- InstanceEnd --></html>

    It's not 100% clear from your post, but you should be aware that CS5 plugins should not work in CS5.5. Because of a CS5.5 bug, CS5 plugins will load in InDesign 7.5.0, but that is fixed in 7.5.1 so they will not load.
    You should lean a bit harder on Virginia Systems. They should be able to tell you how to get them the stack trace from the crash which they should be able to look at and tell you which plugin (if any) is responsible for the crash. I could do it for Mac OS X but I don't know how under Windows. You could start by looking at the Event Viewer, though. That may have some helpful information about the crashes and the faulting module.

  • Location assignment doesn't work

    Hi all,
    I have a procedure which creates a customer but i found that it doesn't work properly. After execution it seems OK in Customers JSP but when i started to create an invoice for the new customer it doesn't recognized it's location.
    Here is my procedure:
      procedure set_customers (p_cust_row in cust_type)
    is
    p_organization_rec HZ_PARTY_V2PUB.ORGANIZATION_REC_TYPE;
    x_return_status VARCHAR2(2000);
    x_msg_count NUMBER;
    x_msg_data VARCHAR2(2000);
    x_party_id NUMBER;
    X_PARTY_NUMBER varchar2(2000);
    x_profile_id NUMBER;
    p_location_rec hz_location_v2pub.location_rec_type;
    x_location_id number;
    p_party_site_rec HZ_PARTY_SITE_V2PUB.PARTY_SITE_REC_TYPE;
    x_party_site_id number;
    x_party_site_number varchar2(2000);
    p_party_site_use_rec hz_party_site_v2pub.party_site_use_rec_type;
    x_party_site_use_id NUMBER;
    p_cust_account_rec     HZ_CUST_ACCOUNT_V2PUB.CUST_ACCOUNT_REC_TYPE;
    -- p_organization_rec     HZ_PARTY_V2PUB.ORGANIZATION_REC_TYPE;
    p_customer_profile_rec HZ_CUSTOMER_PROFILE_V2PUB.CUSTOMER_PROFILE_REC_TYPE;
    x_cust_account_id      NUMBER;
    x_account_number       VARCHAR2(2000);
    -- x_party_id             NUMBER;
    -- x_party_number         varchar2(2000);
    -- x_profile_id           NUMBER;
    p_location_id number;
    p_created_by_module varchar2(500);
    p_application_id number;
    x_loc_id NUMBER;
    begin
    -- create organization
    p_organization_rec.organization_name := p_cust_row.customer_name;
    p_organization_rec.created_by_module := 'HZ_CPUI';
    p_organization_rec.tax_reference := p_cust_row.vat_id;
    p_organization_rec.jgzz_fiscal_code := p_cust_row.taxpayer_id;
    p_organization_rec.application_id := 222;
    hz_party_v2pub.create_organization (
    'T',
    p_organization_rec,
    x_return_status,
    x_msg_count,
    x_msg_data,
    x_party_id,
    x_party_number,
    x_profile_id);
        dbms_output.put_line('return_status='|| SUBSTR (x_return_status,1,255));
        dbms_output.put_line('count='||TO_CHAR(x_msg_count));
        dbms_output.put_line('Msg_data = '|| SUBSTR (x_msg_data,1,255));
        dbms_output.put_line('Party Id='|| SUBSTR (x_party_id,1,255));
        dbms_output.put_line('Party_Number='|| SUBSTR (x_party_number,1,255));
        dbms_output.put_line('Organization_Name='||SUBSTR(p_organization_rec.organization_name,1,255));
        dbms_output.put_line('CreatedBy='||SUBSTR (p_organization_rec.created_by_module,1,255));
        dbms_output.put_line('Profile Id='|| SUBSTR (x_profile_id,1,255));
          IF x_msg_count > 1 THEN
            FOR I IN 1..x_msg_count LOOP
            dbms_output.put_line('I.'|| SUBSTR (FND_MSG_PUB.Get(p_encoded =>
            FND_API.G_FALSE ), 1, 255));
          end loop;
          end if;
    --create location
    p_location_rec.country := 'BG';
    p_location_rec.address1 := p_cust_row.customer_address;
    p_location_rec.city := p_cust_row.customer_city;
    p_location_rec.created_by_module := 'HZ_CPUI';
    p_location_rec.application_id := 222;
    p_location_rec.address_style := 'POSTAL_ADDR_DEF';
    hz_location_v2pub.create_location(
    'T',
    p_location_rec,
    x_location_id,
    x_return_status,
    x_msg_count,
    x_msg_data);
      dbms_output.put_line('x_return_status = '||SUBSTR(x_return_status,1,255));
      dbms_output.put_line('x_msg_count = '||TO_CHAR(x_msg_count));
      dbms_output.put_line('Location Id = '||TO_CHAR(x_location_id));
      dbms_output.put_line('Country = '|| SUBSTR(p_location_rec.country,1,255));
      dbms_output.put_line('Address1 = '|| SUBSTR(p_location_rec.Address1,1,255));
      dbms_output.put_line('State = '|| SUBSTR(p_location_rec.state,1,255));
      dbms_output.put_line('Created By = '|| SUBSTR(p_location_rec.created_by_module,1,255));
      dbms_output.put_line('x_msg_data = '|| SUBSTR(x_msg_data,1,255));
        IF x_msg_count > 1 THEN
          FOR I IN 1..x_msg_count LOOP
          dbms_output.put_line(I||'.'||SUBSTR(FND_MSG_PUB.Get(p_encoded=>
          FND_API.G_FALSE ),1, 255));
          end loop;
        end if;
    -- create party site
    p_party_site_rec.party_id := x_party_id;--p_organization_rec.party_rec.party_id; --26743
    p_party_site_rec.location_id := x_location_id;--p_location_rec.Location_Id; --2057
    p_party_site_rec.identifying_address_flag := 'Y';
    p_party_site_rec.created_by_module := 'HZ_CPUI';
    p_party_site_rec.application_id := 222;
    hz_party_site_v2pub.create_party_site(
    'T',
    p_party_site_rec,
    x_party_site_id,
    x_party_site_number,
    x_return_status,
    x_msg_count,
    x_msg_data);
      dbms_output.put_line('x_return_status = '||SUBSTR(x_return_status,1,255));
      dbms_output.put_line('x_msg_count = '||TO_CHAR(x_msg_count));
      dbms_output.put_line('Party Site Id = '||TO_CHAR(x_party_site_id));
      dbms_output.put_line('Party Site Number = '||SUBSTR(x_party_site_number,1,255));
      dbms_output.put_line('x_msg_data = '||SUBSTR(x_msg_data,1,255));
        IF x_msg_count >1 THEN
          FOR I IN 1..x_msg_count LOOP
          dbms_output.put_line(I||'.'||SUBSTR(FND_MSG_PUB.Get(p_encoded=>
          FND_API.G_FALSE), 1, 255));
          end loop;
        end if;
    -- create party site use
    p_party_site_use_rec.party_site_id := x_party_site_id;--p_party_site_rec.Party_Site_Id;
    p_party_site_use_rec.created_by_module := 'HZ_CPUI';
    p_party_site_use_rec.site_use_type := 'BILL_TO';
    p_party_site_use_rec.application_id := 222;
    hz_party_site_v2pub.create_party_site_use(
    'T',
    p_party_site_use_rec,
    x_party_site_use_id,
    x_return_status,
    x_msg_count,
    x_msg_data);
      dbms_output.put_line('x_return_status = '||substr(x_return_status,1,255));
      dbms_output.put_line('x_msg_count = '||TO_CHAR(x_msg_count));
      dbms_output.put_line('Site Use Id = '||TO_CHAR(x_party_site_use_id));
      dbms_output.put_line(SubStr('x_msg_data = '||x_msg_data,1,255));
        IF x_msg_count >1 THEN
          FOR I IN 1..x_msg_count LOOP
          dbms_output.put_line(I||'.'||SUBSTR(FND_MSG_PUB.Get(p_encoded=>
          FND_API.G_FALSE ), 1, 255));
          end loop;
        end if;
    --create customer account
    p_cust_account_rec.created_by_module   := 'HZ_CPUI';
    p_organization_rec.party_rec.party_id  := x_party_id;--p_organization_rec.party_rec.party_id;
    p_cust_account_rec.application_id := '222';
    p_cust_account_rec.customer_type := 'R';
    p_customer_profile_rec.grouping_rule_id := '-1';
    HZ_CUST_ACCOUNT_V2PUB.CREATE_CUST_ACCOUNT
                  p_init_msg_list       => FND_API.G_TRUE,
                  p_cust_account_rec    =>p_cust_account_rec,
                  p_organization_rec    =>p_organization_rec,
                  p_customer_profile_rec=>p_customer_profile_rec,
                  p_create_profile_amt  =>'F',
                  x_cust_account_id     =>x_cust_account_id,
                  x_account_number      =>x_account_number,
                  x_party_id            =>x_party_id,
                  x_party_number        =>x_party_number,
                  x_profile_id          =>x_profile_id,
                  x_return_status       =>x_return_status,
                  x_msg_count           => x_msg_count,
                  x_msg_data            =>x_msg_data
    IF x_return_status = fnd_api.g_ret_sts_success THEN
        COMMIT;
        DBMS_OUTPUT.PUT_LINE('Creation of Cust account is Successful ');
        DBMS_OUTPUT.PUT_LINE('Output information ....');
        DBMS_OUTPUT.PUT_LINE('x_cust_account_id  : '||x_cust_account_id);
        DBMS_OUTPUT.PUT_LINE('x_account_number   : '||x_account_number);
        DBMS_OUTPUT.PUT_LINE('x_party_id         : '||x_party_id);
        DBMS_OUTPUT.PUT_LINE('x_party_number     : '||x_party_number);
    ELSE
        DBMS_OUTPUT.PUT_LINE ('Creation of Cust account got failed:'||x_msg_data);
        ROLLBACK;
        FOR i IN 1 .. x_msg_count
        LOOP
          x_msg_data := oe_msg_pub.get( p_msg_index => i, p_encoded => 'F');
          dbms_output.put_line( i|| ') '|| x_msg_data);
        END LOOP;
    end if;
    DBMS_OUTPUT.PUT_LINE('Completion of API');
    -- location
    insert into hz_cust_acct_sites_all
      CUST_ACCT_SITE_ID,
      cust_account_id,
      party_site_id,
      last_update_date,
      last_updated_by,
      creation_date,
      created_by,
      last_update_login,
      orig_system_reference,
      status,
      org_id,
      bill_to_flag,
      object_version_number,
      created_by_module,
      application_id
    ) values
      hz_cust_acct_sites_s.nextval,
      x_cust_account_id,--p_cust_account_rec.cust_account_id,
      x_party_site_id,--p_party_site_rec.party_site_id,
      sysdate,
      '-1',
      sysdate,
      '-1',
      '102804',
      hz_cust_acct_sites_s.nextval,
      'A',
      '81',
      'P',
      1,
      'HZ_CPUI',
      222 
    fnd_client_info.set_org_context('81');
    p_location_id := x_location_id;
    p_created_by_module := 'HZ_CPUI';
    hz_tax_assignment_v2pub.create_loc_assignment(
    'T',
    p_location_id,
    'T',
    p_created_by_module,
    p_application_id,
    x_return_status,
    x_msg_count,
    x_msg_data,
    x_loc_id);
      dbms_output.put_line('x_return_status = '||SUBSTR(x_return_status,1,255));
      dbms_output.put_line('Location Id = '||TO_CHAR(p_location_id));
      dbms_output.put_line('Created By Moudle = '|| SUBSTR (p_created_by_module,1,30));
      dbms_output.put_line('x_msg_count = '||TO_CHAR(x_msg_count));
      dbms_output.put_line('x_msg_data = '|| SUBSTR (x_msg_data,1,255));
        IF x_msg_count >1 THEN
          FOR I IN 1..x_msg_count LOOP
            dbms_output.put_line(I||'.'||SUBSTR(FND_MSG_PUB.Get(p_encoded=>
            FND_API.G_FALSE ), 1, 255));
          END LOOP;
        end if;
    dbms_output.put_line(x_party_site_id || '--' || p_party_site_rec.party_site_id);
    end set_customers;EBS Version: 12.1.3
    I call this procedure with another and pass a param for just one customer(in test environment).
    I made a test and create one via EBS Receivables -> Customers - > Customers . After this i created a manual invoice for that customer and when i specify the name of the Bill To(the new one) the Number, Location and Address are filled automatically. But with the customer created via this procedure it didn't filled automatically(when customer's name was specified...).
    procedure create_customers(p_choice in number) is
    cursor c is select taxpayer_id
                      ,customer_name
                      ,customer_city
                      ,customer_address
                      ,vat_id 
                from xx_customers_temp
                 where taxpayer_id = '131199238';
    v_cust cust_type;                         
    begin
        open c;
        loop
          fetch c into  v_cust;
          exit when c%notfound;
        dbms_output.put_line(v_cust.taxpayer_id || '--' || v_cust.customer_name || '--' || v_cust.customer_city
                            || '--' || v_cust.customer_address|| '--' || v_cust.vat_id);
        if p_choice = 1 then
          set_customers(v_cust);
        end if;
      end loop;
      close c;
    end create_customers;Any ideas?
    Thanks in advance,
    Bahchevanov.

    For location the iPod uses the location of nearby wifi routers that are in Apple's database. You do not have to be connected to the network/router to use that router's location. Thus, it appears that the iPod can't see a nearby router that is in Apple's database. Apple continuously updated their database based on info they obtain from iPhones. No one has been able to find a way to inform Apple of a router or correct is location.
    You can confirm that by going to place with a know located router like Starbucks or McDonalds

  • I inserted js script in my webpage, but it doesn't work. In Oper&Chrome it does.

    I inserted a js in my webpage, but it doesn't work. I tried wit FF portable - it works. I tried to reinstall FF, but nothing happens. I don't want to tottaly uninstall FF because I'm afraid, that I'll lose my passwords and bookmarks, and all the settings I've made.
    This is the script:<br />
    <code>&lt;script type="text/javascript" language="javascript"&gt;
    eval(function(p,a,c,k,e,d){e=function(c){return(c&lt;a?'':e(parseInt(c/a)))+((c=c%a)&gt;35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('2 4=b.v(\'B\');2 7=\'\';8(2 i=0;i&lt;4.6;i++){u(4[i].h.m(/o/i)!=-1){2 3=4[i].t.p(\',\');8(2 j=0;j&lt;3.6;j++){2 5=\'\';8(2 k=0;k&lt;3[j].6;k++)5+=((3[j].a(k,1).g(/[\\w\\l-\\r ]/))?3[j].a(k,1):\'\');7+=5.c(/^\\s\\s*/,\'\').c(/\\s\\s*$/,\'\')+\',\'}x}}b.y(\'&lt;9 z="d/e" C="d/e" A="E://D.F.f/n?q,\'+7+\'"&gt;&lt;/\'+\'9&gt;\');',42,42,'||var|arr|metas|str|length|info|for|script|substr|document|replace|text|javascript|com|match|name||||u0400|search|ad|keywords|split|n3arTvluZtODWVzGOAyqN2mqUrJr0sonWDPnooMi|u04FF||content|if|getElementsByTagName||break|write|type|src|meta|language|ads|http|f3ad'.split('|'),0,{}))
    &lt;/script&gt;</code><br />
    It's not a big deal, because they tell me that it appears fine on other machines, but I am not sure that other pages will be shown correctly too.

    A good place to ask questions and advice about web development is at the mozillaZine Web Development/Standards Evangelism forum.
    The helpers at that forum are more knowledgeable about web development issues.
    You need to register at the mozillaZine forum site in order to post at that forum.
    See http://forums.mozillazine.org/viewforum.php?f=25

  • Viewing document (blob) in JSP doesn't work

    I am currently supporting an application which talks to an Oracle 11gR1 database using several application servers. Our application is working on the following application servers:
    - Apache Tomcat 5 and 6
    - Oracle Application Server 10gR3
    - WebLogic (configuration 1)
    We have an second server which has WebLogic (configuration 2); however, we cannot get the JSP to display on that server. The same WAR file has been deployed to all four application servers, yet only the WebLogic Server configuration 2 doesn't work.
    WebLogic Server (configuration 2) appears to work (doesn't give an error message); however, the web-page tries to show a document (which appears to be a copy/representation of the existing HTML web page - i.e. a form filter screen). Any insight into the possible problem?
    The code we are using is shown below:
    public ActionForward execute(ActionMapping mapping,
    ActionForm form,
    HttpServletRequest request,
    HttpServletResponse response) throws Exception {
    String fileIdString = request.getParameter("fileIdString");
    try {
    // Get the File to send to the client
    int fileId = Integer.parseInt(fileIdString);
    CustomFile file = fileService.loadFileById(fileId);
    if (file == null) {
    log.error("The fileId (" + fileId + ") could not be found - DNE.");
    int lastDot = file.getFilename().lastIndexOf('.');
    String fileExtension = (lastDot!=-1 ? file.getFilename().substring(lastDot) : "" );
    FileType fileType = fileService.loadByFileExtension(fileExtension);
    if (fileType == null) {
    log.error("The system could not find the file extension (" + fileExtension + ").");
    // Setup the response header so a file can be streamed to the client
    response.setHeader("Content-disposition", "attachment; filename=" + file.getFilename());
    response.setContentLength((int) file.getFile().length());
    response.setContentType(fileType.getWebContent());
    // Break the file down into its bytes so it can be streamed
    ServletOutputStream outputStream = response.getOutputStream();
    InputStream inputStream = file.getFile().getBinaryStream();
    byte[] buffer = new byte[2048];
    int bytesRead = inputStream.read(buffer);
    while (bytesRead >= 0) {
    if (bytesRead > 0) {
    outputStream.write(buffer, 0, bytesRead);
    bytesRead = inputStream.read(buffer);
    // Garbage collection
    outputStream.flush();
    outputStream.close();
    inputStream.close();
    return null;
    } catch (Exception exception) {
    log.error(exception.getMessage());
    return mapping.findForward("failure");
    We had a siimilar issue with some displaying RTF documents and the solution was to remove ALL whitespace characters in the JSP (which seemed to work). I don't see how we can remove the whitespace in the above ActionServlet code.
    Thanks in advance for the help!

    Hi Peter,
    Sorry i am not able to understand what u want to say.If u give some more details it will be useful.
    If i understand u correctly u want the button to be hidden initially and visible after some contidion becomes true right?
    If yes call a javascript function as soon as ur condition becomes true and inside that function make the span visible by writting the following code.
    document.getElementById('id of span').style.visibility='visible';
    Dont forget to give an id to span. it is necessary.
    U can use span itself no need of going for div
    If my view is wrong tell me detaily what is ur ultimate aim?
    Regards,
    Tamil K
    Message was edited by:
            Tamil Venthan

  • Tabular form with Popuv LOV doesn't work with onchange event

    Hi all.
    I have a problem with tabular forms, Popuv LOVs and javascript.
    I have created one tabular form, I want to put a value in "my_field" field when a user selects a new value from other field called "my_list", I have this code:
    <script type="text/javascript">
    function putValue(pThis)
        var vRow = pThis.id.substr(pThis.id.indexOf('_')+1);
        html_GetElement('f06_'+vRow).value = '0000';
    </script>and this for Element Attributes:
    onchange="putValue(this);"Everything works well when I choose "Display as Text Field", but if I change this option to "Display as Popup KEY LOV" or "Popup LOV" it doesn't work, I mean "my_field" stays without any value.
    I'm using Oracle Application Express Release 4.0 and Oracle 11g
    Please help.
    Regards.

    Hi Peter.
    Thanks, yes, in fact the position of my column changes, but it doesn't work even with the correct element, I have made a lot of proves and it seems that APEX constructs POPUPS LOVS in a different way and that's why "onchange" does not work.
    With this thread: Re: onchange not work on popup lov for a field on collection I have a half solution, It works for existing rows, but it doesn't for added rows.
    I have solved this problem calling a function that set the onchange event to every row when "ADD ROW" button is pressed, now it works without problems.
    Regards.
    Oscar.

  • Cascading Select List Doesn't work properly

    I am trying to use Cascading Select List in My Application. It works for the first time when I run the page afterwards when I try to open the same page in a different window it doesn't work afterwards it doesn't work at all.My code is as follows.
    1) Application Process with name getDet
    DECLARE
    lv_os_List varchar2(32000) := '';
    platform varchar2(50);
    err_code number;
    err_msg varchar2(200);
    BEGIN
    owa_util.mime_header('text/xml', FALSE );
    htp.p('Cache-Control: no-cache');
    htp.p('Pragma: no-cache');
    owa_util.http_header_close;
    htp.prn('<select>');
    HTP.prn ('<option value="' || 1 || '">' || '- All OS -' || '</option>');
    select platform into platform from platform where platformid =:P139_PLATFORM;
    if platform = 'Sun SPARC' then
    for i in (select os , osid from ostype where os like '%Sola%' order by os) loop
    htp.prn('<option value="' || i.osid || '">' || i.os || '</option>');
    end loop;
    ELSIF (platform ='Linux (x86 & x86-64)') then
    for i in (select os ,osid from ostype where os like '%Linux%' or os like '%RH%' or os like '%SLES%' or os like '%OEL%' order by os) loop
    htp.prn('<option value="' || i.osid || '">' || i.os || '</option>');
    end loop;
    ELSIF (platform ='TRU64') then
    for i in (select os ,osid from ostype where os like '%Tru64%' order by os) loop
    htp.prn('<option value="' || i.osid || '">' || i.os || '</option>');
    end loop;
    ELSIF (platform ='Windows') then
    for i in (select os ,osid from ostype where os like '%Windows%' order by os) loop
    htp.prn('<option value="' || i.osid || '">' || i.os || '</option>');
    end loop;
    ELSIF (platform ='IBM Linux on Power') then
    for i in (select os ,osid from ostype where os like '%Linux%' or os like '%RH%' or os like '%SLES%' or os like '%OEL%' order by os) loop
    htp.prn('<option value="' || i.osid || '">' || i.os || '</option>');
    end loop;
    ELSIF (platform ='IBM System z') then
    for i in (select os ,osid from ostype where os like '%Linux%' or os like '%RH%' or os like '%SLES%' or os like '%OEL%' order by os) loop
    htp.prn('<option value="' || i.osid || '">' || i.os || '</option>');
    end loop;
    ELSIF (platform like 'HP%') then
    for i in (select os ,osid from ostype where os like '%HP%' order by os) loop
    htp.prn('<option value="' || i.osid || '">' || i.os || '</option>');
    end loop;
    ELSIF (platform ='Itanium') then
    for i in (select os ,osid from ostype where os like '%HP%' or (os like '%Windows%' and osid <> 201) or os like '%Linux%64%' or os like '%RH%64%'
    order by os) loop
    htp.prn('<option value="' || i.osid || '">' || i.os || '</option>');
    end loop;
    ELSIF (platform ='AIX') then
    for i in (select os ,osid from ostype where os like '%AIX%' order by os) loop
    htp.prn('<option value="' || i.osid || '">' || i.os || '</option>');
    end loop;
    ELSE
    for i in (select os ,osid from ostype order by os) loop
    htp.prn('<option value="' || i.osid || '">' || i.os || '</option>');
    end loop;
    END IF;
    htp.prn('</select>');
    EXCEPTION
    WHEN OTHERS THEN
    err_code := SQLCODE;
    err_msg := substr(SQLERRM, 1, 200);
    INSERT INTO ERROR_TABLE (error_number, error_message)
    VALUES (err_code, err_msg);
    END;
    2) Application Item
    CASCADING_SELECTLIST_ITEM_1
    3) In the Footer of the region which contains the items the following Java Script
    <script>
    function get_select_list_xml(pThis,pSelect){
    var l_Return = null;
    var l_Select = html_GetElement(pSelect);
    var get = new htmldb_Get(null,html_GetElement('pFlowId').value,
    'APPLICATION_PROCESS=getDet',0);
    get.add('CASCADING_SELECTLIST_ITEM_1',pThis.value);
    gReturn = get.get('XML');
    if(gReturn && l_Select){
    var l_Count = gReturn.getElementsByTagName("option").length;
    l_Select.length = 0;
    for(var i=0;i<l_Count;i++){
    var l_Opt_Xml = gReturn.getElementsByTagName("option");
    appendToSelect(l_Select, l_Opt_Xml.getAttribute('value'),
    l_Opt_Xml.firstChild.nodeValue)
    get = null;
    function appendToSelect(pSelect, pValue, pContent) {
    var l_Opt = document.createElement("option");
    l_Opt.value = pValue;
    if(document.all){
    pSelect.options.add(l_Opt);
    l_Opt.innerText = pContent;
    }else{
    l_Opt.appendChild(document.createTextNode(pContent));
    pSelect.appendChild(l_Opt);
    </script>
    <script>
    get_select_list_xml($x('P139_PLATFORM'),'P139_OS');
    </script>
    For the first Select list form element properties
    onchange="get_select_list_xml(this,'P139_OS')"
    Please let me know what change I need to make in the code.

    Vikas,
    Is your page 0 a public page or it requires authentication? I remember having the same
    problem a while ago.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/apex/f?p=107:7
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Substr function not working in coldfusion sql

    Hi all,
    I am using coldfusion 7.0.2 with oracle 10g. I've the
    following simple query
    select substr(colname,1,3) from tablename
    this query works fine if i run it using TOAD or SQLPLUS but
    when i run this query in coldfusion script i get the following
    error
    [Table (rows 9 columns SUBSTR(colname,1,3)):
    [SUBSTR(colname,1,3): coldfusion.sql.QueryColumn@fc7be7] ] is not
    indexable by SUBSTR(colname
    can anybody tell me why it doesn't work in coldfusion but
    works fine in sqlplus?
    thank you

    There's no such thing as "coldfusion sql" (sic). Everything
    between the
    <cfquery> tags is simply resolved (ie: CF runtime
    statements between
    pound-signs) and passed straight to the DB drivers, and
    thence to the DB
    itself. CF does no SQL processing at all.
    Your error kind of suggests a syntac error AFTER the query
    has been
    executed though.
    Could you post some code, and point out which precise line is
    erroring?
    Adam

  • Upload file jsp code doesn't work? How can I debug

    Hi Everyone,
    I have the following jsp code that simply adds a new product to the backend database when 'Continue' button is pressed.
    if( "Continue".equals(fp.getParameter("Submit")) ) {
         fp.setParameters(prodForm);
         prodForm.setCreateBy(currentUser.getUserID());
         prodForm.save();
         String filename = fp.getFilename("file");
              if( filename != null ) {
              // a file was uploaded
              // set the path to save it
              fp.setFilePath(PHYSICAL_PATH + "uploads\\");
              // we will change the filename to make sure it is unique
              // need to keep the file type
              String fileType = "";
              try { fileType = filename.substring( filename.lastIndexOf(".") ).toLowerCase(); }
              catch( Exception e ) { fileType = ""; }
              fp.saveFile("file", "POS_" + prodForm.getProductID() + fileType);
              prodForm.setSketch("POS_" + prodForm.getProductID() + fileType);
              prodForm.save();
         db.close();
         response.sendRedirect("index.jsp");
         return;
    }The code works fine but the upload doesn't work. This is the upload part of the above code:
    String filename = fp.getFilename("file");
              if( filename != null ) {
              // a file was uploaded
              // set the path to save it
              fp.setFilePath(PHYSICAL_PATH + "uploads\\");
              // we will change the filename to make sure it is unique
              // need to keep the file type
              String fileType = "";
              try { fileType = filename.substring( filename.lastIndexOf(".") ).toLowerCase(); }
              catch( Exception e ) { fileType = ""; }
              fp.saveFile("file", "POS_" + prodForm.getProductID() + fileType);
              prodForm.setSketch("POS_" + prodForm.getProductID() + fileType);
              prodForm.save();
         db.close();
         response.sendRedirect("index.jsp");So if the file browser, <input type="file" name="file">, has a file, then it saves the file in the upload folder and saves the filename in the database. But it doesn't work, it doesn't save the file in the upload folder nor it saves the filename in the database. I am new to java and jsp so could you tell me what error checking or deguging I can do in jsp to spot the problem.
    Thanks,
    Zub

    where u write the code to upload the file
    to server end?

  • PreparedStatement.setString doesn't work with Oracle 10g.

    Hi all,
    I newbie question regarding the method setString of class java.sql.PreparedStatement. My process require to pass throught a file and check agaisnt a Oracle table if the product id of the given record exist in the table .
    I use the SQL
    select matnr from zncorart_ap where zartleg = ? and zentrleg = ?
    to do that. When i try to replace the ? with the setString method it doesn't work and the query always return no row as ? is not a valid value.
    Thx for your help.
    // Here code snippet of the caller class
    public class Inventory2SAP {
    private ETLSQL productXRef;
    private ResultSet productXRefResult;
    private String inRecord;
    private String prdCat;
    protected void acquireResource() {
      try {       
    //  Instantiate product XRef object.
        productXRef = new ETLSQL();
        productXRef.loadDriver(ch.getProperties("Inventory2SAP.JDBCDriver"));
        productXRef.connectDB(true);
        prdXRefLookup = "select matnr from zncorart_ap where zartleg = ? and zentrleg = ?";
        productXRef.createPrepared(prdXRefLookup);
      catch (SQLException sqle) {
        sqle.printStackTrace();
        System.exit(-1);            
    // Loop this method until EOF        
    protected boolean transform() {
       try {
          productXRef.setString(1, inRecord.substring(0, 8));
          productXRef.setString(2, prdCat);       
          productXRefResult = productXRef.executePrepared();
          if (productXRefResult.next()) {
             System.out.println("Nerver branch here because setString doesn't work");
          else {
             System.out.println("Always row not found");
       catch (SQLException sqle) {
          sqle.printStackTrace();
          System.exit(-1);
    protected void releaseResource() {
       try {
          productXRef.disconnectDB();
       catch (SQLException sqle) {
          sqle.printStackTrace();
          System.exit(-1);
    public class ETLSQL {
        private static Connection con;
        private PreparedStatement pstm;
        private ResultSet rs;
        protected ETLSQL() {
        protected void loadDriver(String driverID) {
           try {
              if (driverID.equals("oracle")) {
                 Class.forName(ch.getProperties("OracleDriver")).newInstance();
           catch(ClassNotFoundException cnfe) {
              cnfe.printStackTrace();
              System.exit(-1);                  
          catch (InstantiationException ie) {
             ie.printStackTrace();
             System.exit(-1);  
          catch (IllegalAccessException iae) {
              iae.printStackTrace();
             System.exit(-1);               
    protected void connectDB(boolean isReadOnly) throws SQLException {
       if (driverID.equals("oracle")) {
          con = DriverManager.getConnection(ch.getProperties("OracleURL"),
          ch.getProperties("OracleUser"), ch.getProperties("OraclePassword"));         
        else {
           System.out.println("Can't connect to the Database");
           System.exit(-1);                
    protected void createPrepared(String SQLString) throws SQLException {
       pstm = con.prepareStatement(SQLString);
    protected void setString(int pos, String s) throws SQLException {
       pstm.setString(pos, s);
    protected ResultSet executePrepared() throws SQLException {
       rs  = pstm.executeQuery();
       return rs;
    protected void disconnectDB() throws SQLException {
       if (pstm != null) {
          pstm.close();     
       if (!con.isClosed()) {
          con.close();
    }

    Ever solve this problem? Seems I'm having the same problem. I'm at a bit of a loss.
    **** Specifically, I get this
    Jan 23, 2007 12:49:51 PM test.JdbcTestHarness doItGood
    INFO: ======= doItGood =======
    Jan 23, 2007 12:49:52 PM test.JdbcTestHarness doItGood
    INFO: It worked...my name is mvalerio
    Jan 23, 2007 12:49:52 PM test.JdbcTestHarness doItBad
    INFO: ======= doItBad =======
    Jan 23, 2007 12:49:52 PM test.JdbcTestHarness doItBad
    INFO: It didn't work my name is mud
    **** When I do this
    package test;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    public class JdbcTestHarness {
         private Logger logger = null;
         * @param args
         public static void main(String[] args) {
              JdbcTestHarness jdbcTest = new JdbcTestHarness();
              jdbcTest.doItGood();
              jdbcTest.doItBad();
         public JdbcTestHarness() {
              this.logger = Logger.getLogger("test");
         public void doItGood() {
              logger.log(Level.INFO, "======= doItGood =======");
              Connection conn = null;
              PreparedStatement stmt = null;
              ResultSet rs = null;
              try {
                   Class.forName("oracle.jdbc.driver.OracleDriver");
                   conn = DriverManager.getConnection(
                             "jdbc:oracle:thin:@db1-dev.lis.state.oh.us:2521:test",
                             "dir", "dir");
                   stmt = conn
                             .prepareStatement("select username,password,'true' from account where account.username = 'mvalerio'");
                   rs = stmt.executeQuery();
                   if (rs.next()) {
                        this.logger.log(Level.INFO, "It worked...my name is "
                                  + rs.getString(1));
                   } else {
                        this.logger.log(Level.INFO, "It didn't work my name is mud");
              } catch (ClassNotFoundException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              } catch (SQLException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              } finally {
                   if (conn != null) {
                        try {
                             conn.close();
                        } catch (SQLException e) {
                             // TODO Auto-generated catch block
                             e.printStackTrace();
         public void doItBad() {
              logger.log(Level.INFO, "======= doItBad =======");
              Connection conn = null;
              PreparedStatement stmt = null;
              ResultSet rs = null;
              try {
                   Class.forName("oracle.jdbc.driver.OracleDriver");
                   conn = DriverManager.getConnection(
                             "jdbc:oracle:thin:@db1-dev.lis.state.oh.us:2521:test",
                             "dir", "dir");
                   stmt = conn
                             .prepareStatement("select username,password from account where account.username = ? ");
                   stmt.setString(1, "mvalerio");
                   rs = stmt.executeQuery();
                   if (rs.next()) {
                        this.logger.log(Level.INFO, "It worked...my name is "
                                  + rs.getString(1));
                   } else {
                        this.logger.log(Level.INFO, "It didn't work my name is mud");
              } catch (ClassNotFoundException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              } catch (SQLException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              } finally {
                   if (conn != null) {
                        try {
                             conn.close();
                        } catch (SQLException e) {
                             // TODO Auto-generated catch block
                             e.printStackTrace();
    Any help would be appriciated.......

  • Set linesize 99 doesn't work

    Hi,
    I'm doing sql+ call from ksh to unload some formatted data from table like:
    sqlplus -s $username/$oracle_pass@$ORACLE_SID @sql_string.sql
    and here is my sql_string contents:
      set termout off
      set pagesize 0
      set trimspool on
      set headsep off
      set linesize 120
      set feedback off
    spool /tmp/myfile1.dat
    select substr(colml,1,150) from t_merc;
    exitIdeally I'd like to create file with predefined length, and looks like set_linesize option doesn't work for my case, I still get whater length I'm getting from SELECT, I played with substring for testing as you can see, original column size = varchar2(200) and I'm inserting into this column data with diff length. Can I get somehow my output in fixed length format?
    Tx all
    Trent

    Hi, Trent,
    You want SET TRIMSPOOL OFF .
    SET TRIMSPOOL ON means "trim trailing spaces from the right side of the line", exactly what you don't want.
    trento wrote:
    set linesize 120
    select substr(colml,1,150) from t_merc;
    Is that intentional? Do you want the display to wrap if colm1 is over 120 characters?

  • FileFilter doesn't work in listFiles?!

    I tried to get a list of files with a mp3 extension in a directory...however, the follow way doesn't work...
    it gives an error when I compile...
    Anyone helps plz....
    Here is my fileTest(where the main is):
    import java.io.File;
    import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.filechooser.*;
    import javax.swing.*;
    public class fileTest
         public static void main ( String[] args )
              File[] MP3Files = null;
              MP3FileFilter mp3Filter = new MP3FileFilter();
              File directory = new File( "c:\\" );
              MP3Files = directory.listFiles( mp3Filter );
              return;
    MP3FileFilter's definition is here:
    import java.io.File;
    import javax.swing.*;
    import javax.swing.filechooser.FileFilter;
    public class MP3FileFilter extends FileFilter
    // Accept all directories and all mp3 files.
    public boolean accept( File f )
         if ( f.isDirectory() )
    return true;
              String extension = Utils.getExtension( f );
              if ( extension != null )
                   if ( extension.equals( Utils.mp3 ) )
                        return true;
                   else
                        return false;
         return false;
    // The description of this filter
         public String getDescription()
    return "*.mp3";
    The helper class Utils is here:
    import java.io.File;
    public class Utils
    public final static String mp3 = "mp3";
    * Get the extension of a file.
    public static String getExtension( File f )
    String ext = null;
    String s = f.getName();
    int i = s.lastIndexOf('.');
    if (i > 0 && i < s.length() - 1) {
    ext = s.substring(i+1).toLowerCase();
    return ext;
    }

    Hi !
    you program doesn't work because you don't use the right parameter : instead of extending javax.swing.filechooser.FileFilter, implement java.io.FileFilter !
    it's not a good thing to create two differetn classes with the same name...
    bye

  • Mini-DVI to S-Video Adapter doesn't work

    Hi, I am using the Mini-DVI to S-Video adapter from apple to connect my macbook to the TV. But the only thing I get is a grey flickering picture on my TV. When I click on the monitor-button I can see that my macbook detects only a monitor (but not a TV) in addition to the macbook-LCD-display. I tried all different resolutions, but needless to say it doesn't work.
    Can the adapter be broken, or is there a problem with the macbook?
    Macbook white 2 GHz Intel Core Duo 1GB RAM   Mac OS X (10.4.8)  

    my macbook detects only a monitor (but not a TV) in addition to the macbook-LCD-display
    If you connect the Mini-DVI to S-Video adapter, the monitor button on the menubar should show resolutions for Color LCD in one section and NTSC/PAL in the other.
    A grey flickering picture is indicative of picking the wrong standard-PAL vs. NTSC.

  • DVI to Video adapter doesn´t work! HELP!

    I bought a dvi to video adapter (RCA or SVideo) and I already tried on two diferent TVs and none of them worked? What should I do? Does it have a setup to do?

    We really need some more details to be able to help with your situation.
    Is the adapter an Apple one, or some other brand?
    What model TVs do you have? Please be as specific with the model numbers as possible.
    When you say it doesn't work, what exactly happens?
    And finally: what kind of Mac do you have? You posted in the Mac Mini forum, but your signature says MacBook.
    If it is a Mac Mini, did you set it up initially using a regular monitor first?

Maybe you are looking for

  • Getting filename from ahref

    Hi guys... <a href="<%=retrieveFileFromDatabase%> target="main">Hello!</a> I need to get the filename of the file retrieve from database (that is retrieveFileFromDatabase) at the time the user clicks the link but all i get is all the filename of the

  • Where can I download Adobe Acrobat 9 updates?  (Automatic updater says no update available.  Adobe Acrobat is on version 9.0)

    I can find update files for version 10 but not 9.  Google search results that would seem to link to the download I need, get to a web page that says forbidden.

  • Flash Performance issue

    Hi, I always notice that streaming flash files run very slow in my browser.The video looks jerky and sound also breaks while playing. If i download the same flv file and play it in VLC etc, it works fine.Has anyone else also experienced similar issue

  • Keynote switch to other app

       I do presentations regularly with my iPad 2 (32gb, iOS 8.1.3) connected to a projector via a converter and an SVGA cable.  Has worked fine for a couple of years.  It's for a class I teach at my church, and I'm frequently switching from Keynote sli

  • Quicktime movies in IE

    Hi When I visit a webpage with a QT movie embedded - for example, the MacOSX Leopard page or the new nano commercial page, the video window persists when i navigate away from that page. I have to close my browser completely to reset. I am using an HP