Using JSP variable inside Java Script's alert function.

Hi Gurus,
We are trying to use alert function with one of the string variables populated inside JSP code, but its not working.
Here is the code snippet, please advice.
     <%
     oracle.apps.qot.util.RequestCtx.log("qotcustom.jsp",AOLMessageManager.getMessageSt(QotUtil.QOT_APPS_CODE, "XDPYY_DISC"));
     %>
     var alert_text="<%=AOLMessageManager.getMessageSt(QotUtil.QOT_APPS_CODE, "XDPYY_DISC")%>";
     alert(alert_text);
     Here in the first line we are using API to get text message defined in database, the line is getting executed properly and we could see output text message in debug log file, after this in the 4th line, we are assiging this string output of API to java script variable alert_text and further using alert function with the variable alert_text as argument. But alert function is failing, no errors are thown in debug log file.
Please advice whether we are doing any thing wrong.
Thanks in advance.

What pgeuens means is that you can't mix javascript and jsp/java code in this way.
ALL of the jsp/java code gets executed at the server end.
This produces an HTML page (with embedded javascript) which gets sent to the client.
The client then runs javascript code in response to events (onLoad, onClick, onChange etc etc)
So in this case, the jsp:forward will always be executed, because as far as the server is concerned, the javascript is just template text.
If you WANT to do a conditional forwarding on the server side you do it in java ie (horribly using scriptlet)
<%
if (testCondition){
%>
  <jsp:forward>
%<
%>Or if you want to test what the client has entered client side, all you can do is submit the form, or navigate to a URL
<script>
function test()
if(document.f.htemp.value=="true")
alert("jus");
else
var s=document.f.htemp.value;
alert(s);
document.f1.action="success.jsp";
document.f.submit();
</script>You cannot run JSP code based on your javascript code.
Java. Javascript. Not the same thing.
Hope this helps,
evnafets

Similar Messages

  • Problem using jsp:forward in java script

    hi,
    when I use jsp forward tag inside java script i'm getting a problem that
    when the jsp is invoked it is getting forwarded to the page specified in the forward tag, without checking the if conditions. Following code may give you a better idea.
    <html>
    <script>
    function test()
    if(document.f.htemp.value=="true")
    alert("jus");
    else
    var s=document.f.htemp.value;
    alert(s);
    <jsp:forward page="success.jsp" />
    </script>
    <body>
    <form name="f" method=post>
    <input type=text name=htemp value="true">
    <input type=button onclick="test()">
    </form>
    </body>
    </html>
    please help me,thanks inadvance
    regards
    chandu

    What pgeuens means is that you can't mix javascript and jsp/java code in this way.
    ALL of the jsp/java code gets executed at the server end.
    This produces an HTML page (with embedded javascript) which gets sent to the client.
    The client then runs javascript code in response to events (onLoad, onClick, onChange etc etc)
    So in this case, the jsp:forward will always be executed, because as far as the server is concerned, the javascript is just template text.
    If you WANT to do a conditional forwarding on the server side you do it in java ie (horribly using scriptlet)
    <%
    if (testCondition){
    %>
      <jsp:forward>
    %<
    %>Or if you want to test what the client has entered client side, all you can do is submit the form, or navigate to a URL
    <script>
    function test()
    if(document.f.htemp.value=="true")
    alert("jus");
    else
    var s=document.f.htemp.value;
    alert(s);
    document.f1.action="success.jsp";
    document.f.submit();
    </script>You cannot run JSP code based on your javascript code.
    Java. Javascript. Not the same thing.
    Hope this helps,
    evnafets

  • Using jsp variable in java code

    Hey guys,
    I need some help hope you guys can help me.
    I've declared a variable "error" in a jsp. how do I access this variable in the java code whice resides in the same jsp page.
    I know I can use java variable in jsp code using
    <%= sVariable %>
    where sVariable was declared in the java code. but how do I access a jsp variable in java code??
    Thanks very much in advance

    Thanks for the reply.
    This is what I want to do.
    I've declared a variable "error" using <c:catch var="error">I want to check the value of this variable and suppose if it contains XYZ (error variable will have a long string so I just want to check if it contains a specific value) I want to do step1 and if the variable of error is not XYZ I want to do step 2
    Problem is I dont know how to check if error contains the XYZ in jsp thats why I thought java code would help here.
    Can you guys suggest a better way to solve my problem.
    Thanks again

  • Accessing shell environment variables inside OMBPlus script

    Hi,
    I have a problem accessing an environment variable inside OMBPlus script. I can 'see' the env. var values when using tclsh, but when I use OMBPlus.sh it doesn't work?
    Anybody has an example of how to do this?
    For example: puts $::env(MYVAR)
    Thanks,
    Ed

    Hello!
    Issue the command:
    puts [array names env];
    this will print you the content of the env array which is definitely not the environment variables.
    If you want your environment variable appear in the env tcl variable then you must edit the ombplus.bat file and pass it through a java option like this:
    -DMYENV="%MYENV%" (on windows assuming you declared MYENV).
    Now puts $env(MYENV) will work.
    Regards,
    Robert

  • Assigning a jstl variable to java Script variable

    Hai All,
    I created one jsp page with java script with JSTL.
    I retrive arrayList from simple java bean in jsp page with help of JSTL .
    Now i want assign the ArrayList value through JSTL to Java Script Array.
    How to convert JSTL to Java Script.
    Please give me details asp.
    thanks ,
    Bala

    You can do this:
    <% request.setAttribute("x", "hello"); %>
    <c:out value="${x}"/>or if you want to go from JSTL to scriplet you can:
    <c:set var="testvar" value="hello" scope="request"/>
    <%= request.getAttribute("testvar") %>Both of these will output "hello"
    <c:set> defaults to the page scope, so you could substitute pageContext for request and get the same results (remove scope="request" first though).
    Karl

  • How to use host variable in Java?

    How do I use host variable in java? I am getting SQL code of -404 and description of SQL code is The UPDATE or INSERT statement specifies a String that is too long column-name SQLSTATE=22001. Below is my code:
    * i n s e r t M e s s a g e
    * insertMessage: This method will retrive detail message and other fields for
    * selected item from screen1.
    public final Collection insertMessage(String businessId,String messageNumber,String messageType,
    String messageTitle,String printStyle,String statusIndicator,
    String approverId,String lastUpdateId,String longMessage) {
    MessageTransport msi = new MessageTransport();
    PreparedStatement ps = null;
    Connection connection = null;
    MessageTransport msi1 = new MessageTransport();
    PreparedStatement ps1 = null;
    Connection connection1 = null;
    ArrayList list = new ArrayList();
    try {
    if (businessId != null) {
    businessId = businessId.trim();
    if (messageNumber != null) {
    messageNumber = messageNumber.trim();
    if (messageType != null) {
    messageType = messageType.trim();
    if (messageTitle != null) {
    messageTitle = messageTitle.trim();
    if (printStyle != null) {
    printStyle = printStyle.trim();
    if (statusIndicator != null) {
    statusIndicator = statusIndicator.trim();
    if (approverId != null) {
    approverId = approverId.trim();
    if (lastUpdateId != null) {
    lastUpdateId = lastUpdateId.trim();
    if (longMessage != null) {
    longMessage = longMessage.trim();
    int len = longMessage.length();
    if (len > 254) {
    int constant = 254;
    int k = len % constant; //k will hold value that has number of loops including initial insert.
    k = k - 1; //this is for total number of loop.
    int j = len / constant; //this will have remainder if any to insert rest of longmessage.
    System.out.println("Display remainder: " + k);
    System.out.println("Display divisible: " + j);
    System.out.println("Display Length of longMessage: " + len);
    StringBuffer sql = new StringBuffer();
    sql.append("INSERT INTO " + MESSAGE_TBL + " ( MT_BUS_ID,MT_MSG_NBR,MT_MSG_TYPE,MT_MSG_TITLE,MT_PRINT_STYLE,MT_APV_STATUS,MT_APV_ID,MT_APV_DT,MT_APV_TM,MT_LAST_UPDATE_ID,MT_LAST_UPDATE_DT,MT_LAST_UPDATE_TM,MT_MSG_TXT ) VALUES ");
    sql.append("(");
    sql.append("'");
    sql.append(businessId).append("'");
    sql.append(",").append(messageNumber);
    sql.append(",").append("'I'");
    sql.append(",").append("'").append(messageTitle).append("'");
    sql.append(",").append("'").append(printStyle).append("'");
    sql.append(",").append("'P'");
    sql.append(",").append("' '");
    sql.append(",").append("CURRENT DATE");
    sql.append(",").append("CURRENT TIME");
    sql.append(",").append("'").append(lastUpdateId).append("'");
    sql.append(",").append("CURRENT DATE");
    sql.append(",").append("CURRENT TIME");
    sql.append(",").append("'").append(longMessage).append("'");
    sql.append(")");
    System.out.println("Display SQL Statement: " + sql);
    connection = DriverManager.getConnection(DATABASE_URI, USER, PASS);
    ps = connection.prepareStatement(sql.toString());
    ps.executeUpdate();
    System.out.println("Refreshed Record: ");
    catch (SQLException sqle) {
    System.out.println("SQLException: "+ sqle + ". SQLSTATE=" + sqle.getSQLState()+" SQLCODE=" + sqle.getErrorCode());
    finally {
    if (ps != null) {
    try {
    ps.close();
    ps=null;
    catch (Exception e) {}
    if (ps1 != null) {
    try {
    ps1.close();
    ps1=null;
    catch (Exception e) {}
    if (connection != null) {
    try {
    connection.close();
    connection = null;
    catch (Exception e) {}
    if (connection1 != null) {
    try {
    connection1.close();
    connection1 = null;
    catch (Exception e) {}
    return list;
    if my longMessage is smaller like one line then everything works fine, but as soon as my longMessage if greater than 254 it starts giving me -404. How do I work around or Is there any way to use host variable in Java?
    All kind of help is appreciated. Any question then please email me at [email protected].
    Thank you.

    This is what you got to do to insert a larger value.
    //Assuming that message length is less than 254+ 254 characters.
    //If larger then run the update loop that many times.
    String longMessage = "Blah blah ... ";
    String firstPart = "";
    String secondPart = "";
    int messageLength = longMessage.length();
    if (messageLength > 254)
         try
              firstPart = longMessage.subString(0, 253);
              secondPart = longMessage.subString(254, message);
         catch (IndexOutOfBoundsException e)
    //In the first insert  set the first 254 characters
    ps.setString(1, firstPart);
    int result = ps.executeUpdate();
    if (result != 0)
           System.out.println("Insert  sucessful  ");
           if (messageLength > 254)
                //now update with the second part.
                static String UPDATE_SECOND_PART = UPDATE my.table SET LONG_COL = LONG_COL || ? WHERE KEY_COL = ?;
                ps2 = connection.getPreparedStatement(UPDATE_SECOND_PART);
                ps2.setString(1, secondPart);
                ps2.setString(2, businessId);  //assuming that businessId is the primary key.
                int result2 = ps2.executeUpdate();
                if (result2 != 0)
                      System.out.println("Update  sucessful  ");
                else
                     System.out.println("Update failed ");
    else
           System.out.println("Insert failed ");
    }Hope this helps.

  • Using PHP variable inside MySQL  recordset

    Can someone let me know if this is possible? I'm trying to
    use a variable inside a recordset. The code below is what I have at
    present but it white screens me when I try open it the page in the
    browser. $qualificationchoice is the variable (line 3)
    mysql_select_db($database_con_rsca, $con_rsca);
    $query_rs_Instructorsearch = sprintf("SELECT * FROM
    rsca_users WHERE rsca_public_region = %s AND
    rsca_public_"$qualificationchoice" = %s",
    GetSQLValueString($colname_rs_Instructorsearch,
    "text"),GetSQLValueString($colname2_rs_Instructorsearch, "int"));
    $rs_Instructorsearch =
    mysql_query($query_rs_Instructorsearch, $con_rsca) or
    die(mysql_error());
    $row_rs_Instructorsearch =
    mysql_fetch_assoc($rs_Instructorsearch);
    $totalRows_rs_Instructorsearch =
    mysql_num_rows($rs_Instructorsearch);

    Any chance you can help me with phase 2.
    I'm trying to get determine $qualificationchoice by the
    setting of a form menu $_POST['qualification']
    I know I'm close but it just won't quite work
    Here's what I have right now:
    if (isset($_POST['qualification'])) {
    $colname2_rs_Instructorsearch = (get_magic_quotes_gpc()) ?
    $_POST['qualification'] : addslashes($_POST['qualification']);
    //code to set qualification choice
    if($_POST['qualification']==1) {$qualificationchoice="CWA";}
    elseif ($_POST['qualification']==2)
    {$qualificationchoice="SPA";}
    elseif ($_POST['qualification']==3)
    {$qualificationchoice="WGL";}
    elseif ($_POST['qualification']==4)
    {$qualificationchoice="ML";}
    elseif ($_POST['qualification']==5)
    {$qualificationchoice="MLW";}
    elseif ($_POST['qualification']==6)
    {$qualificationchoice="MIA";}
    elseif ($_POST['qualification']==7)
    {$qualificationchoice="MIC";}
    elseif ($_POST['qualification']==8)
    {$qualificationchoice="guide";}
    // code to set qualification choice ends
    $colname_rs_Instructorsearch = "-1";
    if (isset($_POST['region'])) {
    $colname_rs_Instructorsearch = (get_magic_quotes_gpc()) ?
    $_POST['region'] : addslashes($_POST['region']);
    mysql_select_db($database_con_rsca, $con_rsca);
    $query_rs_Instructorsearch = sprintf("SELECT * FROM
    rsca_users WHERE rsca_public_region = %s AND
    rsca_public_{$qualificationchoice} = 1 AND rsca_public_listme =1
    AND expired =0", GetSQLValueString($colname_rs_Instructorsearch,
    "text"));
    $rs_Instructorsearch =
    mysql_query($query_rs_Instructorsearch, $con_rsca) or
    die(mysql_error());
    $row_rs_Instructorsearch =
    mysql_fetch_assoc($rs_Instructorsearch);
    $totalRows_rs_Instructorsearch =
    mysql_num_rows($rs_Instructorsearch);
    ?>
    Any suggestion would be great
    Thanks
    Dave

  • Someone is using faebook to run java script to get data and email from me in windows 8

    someone is using faebook to run java script  to get  data  and  email  from  me in  windows  8

    Is this a developer question?
    Jeff Sanders (MSFT)
    @jsandersrocks - Windows Store Developer Solutions
    @WSDevSol
    Getting Started With Windows Azure Mobile Services development?
    Click here
    Getting Started With Windows Phone or Store app development?
    Click here
    My Team Blog: Windows Store & Phone Developer Solutions
    My Blog: Http Client Protocol Issues (and other fun stuff I support)

  • Using XML file in Java script to create Google Map

    Hello,
    I work for a non-profit in San Diego as a GIS Specialist. I have had to teach myself about some scripting to create some dynamic maps, but I am still very limited in my skills, so I have had to explore the internet in order to discover various tutorials and examples that have led me on a positive path.
    Right now I am working on a Google Mash-Up that will incorporate over 14,000 records, which will appear as separate markers that will have pop-up info bubbles with additional info inside (using html), once the marker is clicked.
    Here is the XML script example that is used in the tutorial I am following:
    <markers>
    <marker lat="43.65654" lng="-79.90138" html="Some stuff to display in the<br>First Info Window"
    label="Marker One" />
    <marker lat="43.91892" lng="-78.89231" html="Some stuff to display in the<br>Second Info Window"
    label="Marker Two" />
    <marker lat="43.82589" lng="-79.10040" html="Some stuff to display in the<br>Third Info Window"
    label="Marker Three" />
    </markers>
    ...and this is how it looks when the file is retrieved by the java script and mapped: http://econym.googlepages.com/example_map3.htm
    This is the java script that creates the Google Map. I have emboldened the section of the script that retrieves the data and parses it to create the markers:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Google Maps</title>
    <script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAA6GoL8P5zqjQlG5A5uM1ETBSUPozAscB0cY3RG8xEGnZyeom4axRySak889rVpvHYRsV4f9OZZzbboA"
    type="text/javascript"></script>
    </head>
    <body onunload="GUnload()">
    <!-- you can use tables or divs for the overall layout -->
    <table border=1>
    <tr>
    <td>
    <div id="map" style="width: 800px; height: 1200px"></div>
    </td>
    <td width = 200 valign="top" style="text-decoration: underline; color: #4444ff;">
    <div id="side_bar"></div>
    </td>
    </tr>
    </table>
    <noscript><b>JavaScript must be enabled in order for you to use Google Maps.</b>
    However, it seems JavaScript is either disabled or not supported by your browser.
    To view Google Maps, enable JavaScript by changing your browser options, and then
    try again.
    </noscript>
    <script type="text/javascript">
    //<![CDATA[
    if (GBrowserIsCompatible()) {
    // this variable will collect the html which will eventualkly be placed in the side_bar
    var side_bar_html = "";
    // arrays to hold copies of the markers used by the side_bar
    // because the function closure trick doesnt work there
    var gmarkers = [];
    var i = 0;
    // A function to create the marker and set up the event window
    function createMarker(point,name,html) {
    var marker = new GMarker(point);
    GEvent.addListener(marker, "click", function() {
    marker.openInfoWindowHtml(html);
    // save the info we need to use later for the side_bar
    gmarkers[i] = marker;
    // add a line to the side_bar html
    side_bar_html += '<a href="javascript:myclick(' + i + ')">' + name + '</a><br>';
    i++;
    return marker;
    // This function picks up the click and opens the corresponding info window
    function myclick(i) {
    GEvent.trigger(gmarkers, "click");
    // create the map
    var map = new GMap2(document.getElementById("map"));
    map.addControl(new GLargeMapControl());
    map.addControl(new GMapTypeControl());
    map.setCenter(new GLatLng( 37.251699,-119.604315), 7);
    *// Read the data from testXML2blackpoolformat.xml*
    var request = GXmlHttp.create();
    request.open("GET", "testXML2blackpoolformat.xml", true);
    *request.onreadystatechange = function() {*
    *if (request.readyState == 4) {*
    var xmlDoc = GXml.parse(request.responseText);
    *// obtain the array of markers and loop through it*
    var markers = xmlDoc.documentElement.getElementsByTagName("ConnectoryRecord");
    *for (var i = 0; i < markers.length; i++) {*
    *// obtain the attribues of each marker*
    *var lat = parseFloat(markers[i].getAttribute("lat"));*
    *var lng = parseFloat(markers[i].getAttribute("lng"));*
    var point = new GLatLng(lat,lng);
    *var html = markers[i].getAttribute("html");*
    *var label = markers[i].getAttribute("label");*
    *// create the marker*
    var marker = createMarker(point,label,html);
    map.addOverlay(marker);
    // put the assembled side_bar_html contents into the side_bar div
    document.getElementById("side_bar").innerHTML = side_bar_html;
    request.send(null);
    else {
    alert("Sorry, the Google Maps API is not compatible with this browser");
    // This Javascript is based on code provided by the
    // Blackpool Community Church Javascript Team
    // http://www.commchurch.freeserve.co.uk/
    // http://econym.googlepages.com/index.htm
    //]]>
    </script>
    </body>
    </html>
    Here is my delima--
    This is the xml format that I need to use because it can accept the rest of my excel file and loop it through the 14,000+ records to create a functioning xml file. This is just a sample (2 records) of the larger file:
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    <ConnectoryAug2008>
    <ConnectoryRecord>
         <lng>-117.03683</lng>
         <lat>32.944505</lat>
         <ConnectoryID>1</ConnectoryID>
         <Name>$2.95 Guys</Name>
         <StreetAddress>13750 Stowe Drive</StreetAddress>
         <City>Poway</City>
         <State>CA</State>
         <Zip>92064</Zip>
    <Marker>White</Marker>
         <IndustryGroup>Technical Services</IndustryGroup>
         <ConnectoryProfileLink>http://connectory.com/search/profile_view.aspx?connectoryId=1</ConnectoryProfileLink>
    </ConnectoryRecord>
    <ConnectoryRecord>
         <lng>-117.272843</lng>
         <lat>33.13337</lat>
         <ConnectoryID>2</ConnectoryID>
         <Name>(GLDS) Great Lakes Data Systems</Name>
         <StreetAddress>5954 Priestly Drive</StreetAddress>
         <City>Carlsbad</City>
         <State>CA</State>
         <Zip>92008</Zip>
    <Marker>Orange</Marker>
         <IndustryGroup>Technology</IndustryGroup>
         <ConnectoryProfileLink>http://connectory.com/search/profile_view.aspx?connectoryId=2</ConnectoryProfileLink>
    </ConnectoryRecord>
    </ConnectoryAug2008>
    This is the tutorial where I found the formatting techniques to successfully create the large xml file that will format/convert my excel file properly: http://www.mrexcel.com/tip064.shtml
    These variables should appear as html in the info bubble:
    <ConnectoryID>2</ConnectoryID>
         <Name>(GLDS) Great Lakes Data Systems</Name>
         <StreetAddress>5954 Priestly Drive</StreetAddress>
         <City>Carlsbad</City>
         <State>CA</State>
         <Zip>92008</Zip>
    <IndustryGroup>Technology</IndustryGroup>
         <ConnectoryProfileLink>http://connectory.com/search/profile_view.aspx?connectoryId=2</ConnectoryProfileLink>
    The "Marker" variable instructs Google Maps to label the marker with a particular color. I will be so grateful to the person(s) that helps me get through this wall that I have been hitting for a long time. It's very difficult without having the luxury of peers who know about these types of issues.
    Thank you!!

    Here is the relationship: They both contain geographic coordinates that produce a point on a map. I will use the rest of the information in the second xml file (company name, address, link, etc.) to produce the information for the bubble that will pop up once the marker is clicked.
    My problem is that I need to try to keep the second xml file in a relatively similar format, so the rest of my records will still be accepted. If I had a smaller amount of records I could place them directly into the javascript, but because there are so many records, I need to use an xml file that can be retrieved by the java script. I chose to use the second type of xml file because I can easily copy and past the 14,000+ records that are now in excel document.
    After the xml issue is corrected I need to rework the javascript that is now emboldened so that it will read the new xml file correctly. I included the first xml file so that the readers will understand what type of xml format is currently being used to produce the markers in the tutorial map.

  • How to write JSP code in Java Script Code

    Hello friends
    I have code like
    <script language="JavaScript">
    function f()
    (some code is here)
    </script>
    Now i wants to put some JSP code in f()
    So can i do this ? IF yes then how ?
    (one solution may be make JSP function and call that JSP function from the f().So in that case how can i call JSP function from JavaScript??
    If other method is there then please mail me

    If it's a simple matter of mixing client-side code with server side code, it can be done so long as you're using the server-side to write the client-side.
    For example:
    <h1>Good Morning Mr. Phelps</h1>
    <input name=anybodyFunction type=text>
    <% if (userIsAdmin) { %>
    <input name=adminOnlyFunction type=text>
    etc.
    <% } %>
    <h1>This browser will self-destruct in ...</h1>
    That's JSP (inside the <% %>) mixed with HTML.
    Javascript goes 100% on the client-side. If you're writing JSP with inter-mixed HTML, you might have to inter-mix the java-script.
    For example: Suppose you need to validate the form. "adminOnlyFunction", among others, is a mandatory field, and you want the Javascript to only submit the form if all mandatory fields are set. Well, if the user is NOT an administrator, then that field WILL be left blank.
    One way to handle that is with mixing JSP/HTML/Javascript on the SERVER side.
    <h1>Good Morning Mr. Phelps</h1>
    <input name=mandatory1 type=text>
    <input name=optional1 type=text>
    <% if (userIsAdmin) { %>
    <input name=adminOnlyFunction type=text>
    <% } %>
    <input name=submit type=button value=Submit onClick="checkit()">
    etc. etc.
    <script language=Javascript>
    function checkit() {
    var f = document.form;
    if (
    � � f.mandatory1.value == ""
    � � || f.mandatory1.value == ""
    � � || f.mandatory2.value == ""
    <% if (userIsAdmin) { %>
    � � || f.adminOnlyFunction.value == ""
    <% } %>
    � � � � ) {alert ("Hey! You left out a required field!!");}
    etc. etc. etc.
    I imagine THIS might be what is meant by "mixing JSP with Javascript", and in this particular fashion, it can be done. What you're doing is making decisions on the server side over what to write out to the client. That client code can make further decisions based on user input.
    However, once it's on the client side, you can not have anymore JSP code. The client NEVER runs JSP code.

  • Using a variable inside another variable

    I'm trying to use one two variable in a package with one variable feeding its value to another variable as follows:
    Variable 1 = Count
    Variable 2 = File_Name
    Variable 1 counts up from 1;I would like to use this value as an input to Variable 2 as follows:
    SELECT LOAD_FILENAME FROM DIMSTATS_FILENAME WHERE (SELECT ROW_NUMBER() OVER (Order by FILE_ID) AS RN FROM DIMSTATS_FILENAME) = #DIMSTATS_TEST.count.
    How ever I am getting the following Error :
    +ODI-1228: Task File_Name (Variable) fails on the target  connection DDBSTAGE.
    Caused By: java.sql.SQLException: [FMWGEN][SQLServer JDBC Driver][SQLServer]The multi-part identifier "#DIMSTATS_TEST.count" could not be bound.+
    I have also noticed that the value of Variable 1 is not being passed to the Select statement above through SQLServer Profiler. If I hard-code the value of #DIMSTATS_TEST.count (Variable1) the query is successful.
    How can I get the value of Variable 1 to be passed to Variable 2?
    Could someone please help
    Thanks

    You did not mentioned how you are using those variable .
    You need to have these variable inside a package .
    It will be like
    Variable 1 (Refresh) -------OK-------->Variable 2(Refresh) ------------OK-----> Some other operation .
    Thanks,
    Sutirtha

  • Java scriptlets inside java scripts

    Hello.
    Im putting a java scriptlet inside a java script.What i want to do is to put some selected values inside a method and that method im calling inside the javascript.
    function result()
         var Category = document.getElementById("ddlcategory").value;
         var source= document.getElementById("ddlFromCity").value;
         var desti = document.getElementById("ddlToCity").value;
         if(Category != "" && Category != null)
         <%
         Values vss = new Values();
         ResultSet rss = vss.getFairChart("route_id","charge_seat","charge_birth","Mst_route_charges","layout_id",%>Category<%,"city_src_id",%>source<%,"city_dst_id",%>desti<%);%>
    }This is what im doin. but the error it is giving is as follows,
    The method getFairChart(String, String, String, String, String, String, String, String, String, String) in the type Values is not applicable for the arguments (String, String, String, String, String, void, String, void, String, void)
    21:      {
    22:      <%
    23:      Values vss = new Values();
    24:      ResultSet rss = vss.getFairChart("route_id","charge_seat","charge_birth","Mst_route_charges","layout_id",%>Category<%,"city_src_id",%>source<%,"city_dst_id",%>desti<%);%>
    25:      }Can any one help me abt this thing.

    Java is already executed at the server side before the response arrives to the client and Javascript (which is an entirely different language) can only be executed at the client side if the response is already arrived at the client side.
    If you want to execute some Java using Javascript, you'll have to create a new request to the server. That can be a GET request or a POST request. You can use plain vanilla links, or forms or AJAX for that.

  • Using c++ variable in apple script

    Hi all,
    I am just calling the apple script from my indesign plugin.
    I need to pass the c++ variable to apple script for opening a file
    This in my apple Script which i have embedded in c++ code
    tell application "TextEdit"
    activate
    open "Users:User1:Library:Preferences:Adobe Indesign:Version 5.0:MathEQ.txt"
    end tell
    The filepath "Users:User1:Library:Preferences:Adobe Indesign:Version 5.0:MathEQ.txt" is stored in the C++ variable char* textFileName.
    I need to use the variable textFileName in apple script which has the path.
    How to go about it?
    Thanks
    Sakthi

    I have a similar problem trying to get data from any field into an AppleScript variable.
    Something like *set phoneNumber to cell "Phone Number" of current record* works fine if you are using the script from a layout that has this field on it.
    But I have a lot of fields on different layouts and I want to have access to all fields in the table, no matter what layout they are on, or what layout is currently active.
    And I want to do this without having to specify on what layout each field is located.
    In the past (FileMaker 6) I used something like *set phoneNumber to (cell "Phone Number" of current record of database 1)* but this is no longer working in FileMaker 9.
    So I was thinking to use something like *set phoneNumber to cell "Phone Number" of current record of table "Table Name"* but that doesn't seem to work.
    The only thing that seems to work is *set phoneNumber to cell "Phone Number" of current record of layout "Layout Name"* but as I said, I don't want to specify the layout for each field.
    Any ideas anyone?
    Message was edited by: khasmir

  • How to use bean objects in java script

    function insertRow()
              var row=1;
              var tbl = document.all("TAU");
         var tr = tbl.rows(row);
         var td = tr.cells(0);
         var td2 = tr.cells(1);
         var td3 = tr.cells(2);
         row++;
         tr = tbl.insertRow();
         tr.setAttribute(false);
         td = tr.insertCell();
         td2 = tr.insertCell();
         td3 = tr.insertCell();
         td.innerHTML = "<html:text property='unit' value ='02' />";
         td2.innerHTML = "<html:text property='unit Id' />" ;
         td3.innerHTML = "<html:text property='unit Type' />" ;
    this is my code, it is basicaly add row at run time thru java scripts. i want to set property of beans with this script , in this code i foun error ie. "can not found bean in nay scope" so plz anybody can tell me how can i pass bean object to java script !!!!!!

    mmmh i'm not understanding so much....
    well... as i told before i'm working in oracle database environment and i'm developing a java procedure.
    now, i have this object
    CREATE OR REPLACE
    TYPE REPORT.FATTURA_OBJ AS OBJECT (
    POD VARCHAR2(1000),
    ID_FATTURA NUMBER,
    ID_FILE NUMBER,
    COERENZA_EA_F VARCHAR2(1000),
    COERENZA_ER_F VARCHAR2(1000),
    COERENZA_EA_M VARCHAR2(1000),
    COERENZA_EF_M VARCHAR2(1000),
    ANOMALIA VARCHAR2(1000),
    MOTIVO_INVALIDAZIONE VARCHAR2(1000),
    MATRICOLA_CONTATORE VARCHAR2(1000),
    POTENZA_DISPONIBILE VARCHAR2(1000),
    MEMBER PROCEDURE pulisci
    /and i need to work with it inside this procedure:
    CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED REPORT."Manage_Excel_ASMBS" AS
    import java.io.*;
    import java.io.IOException;
    import java.io.StringWriter;
    public class Manage_Excel_ASMBS
    public static void read_Excel(String inputFile,int var_Id_Caricamento, int var_Id_Distributore, String var_Distributore) throws SQLException, IOException
              **here i need to put what i'm reading inside the excel file into oracle objects**
    /can you please give me a sample ?
    thanks

  • Using context variable in formcalc scripting language.

    Hi all,
             I wanted to know if it is possible to use context variables in formcalc. I wanted to use those variables in "if else" condition in formcalc scripting language. Please post the sample code also as i am new to adobe forms.
    Regards,
    Vinod

    Hi ,
    Each variable define in the context can be used on the layout of the form and/or in script linked to fields.
    This can be done in formcalc or in javascript language , without any problem . You have only to acess the correct variable in the script.
    For getting variable in a script you must define the complete name of the variable, example "Myform.Header.Data.Myvariable" get access to variable MyVariable define in the context under nodes Header/Data .
    Hope it's help you
    regards.

Maybe you are looking for

  • Release Strategy of Procurement in BI Content?

    Hi, Is there any standard datasource about Release Strategy of Procurement in BI Content? Any helpful suggestion, I will give points. Thanks. Stephen

  • Partial CENVAT Credit

    Hi... 1. In Partial CENVAT credit scenario we require to create the seperate TAXCODE which splits the excise entry and adds the remaining value in Material Price. Can you suggest the customization settings for that..? 2. Taxcodes are mainly used in T

  • Facing issue in HSRP configuration with IPV6

    Hi, i am trying to configure hsrp with ipv6 and all command are running for hsrp excep this command standby 1 ipv6 2001::10/64 and i have also tried  standby 1 ipv6 2001::10, then showing error:- % invalid link-local address. i have also configred  s

  • Create titleWindow  inside a canvas

    doubt as to create a titleWindow a component canvas the code to create out I already have private function newTitleWindow(window:Class):void                   var desktop:TitleWindow = new TitleWindow();                 desktop= PopUpManager.createPo

  • Comment actualiser le catalogue quand on modifie une metadonnée en dehors de PSE8?

    Bonjour, Je viens de me rendre compte que si je modifie des meta données (mot-clefs, position GPS, ...) depuis un programme autre que PSE (je suis encore en version 8), la modification n'est pas prise en compte dans le catalogue de PSE8. Quelle est l