How to use an if statement in javascript code

Hello,
I have a batch processing script to search for text "employee signature" on each page in a multiple page file and to then list in the console any pages that do not have the "Employee Signature" text included.
The script is not yet functional as an if statement needs to be included.
Can anyone please advise how to use an if statement in javascript code?
var numpages = this.numPages;
for (var i=0; i < numpages; i++)
search.query("Employee Signature", "ActiveDoc");
console.println('Pages that do not include an employee signature: ' + this.pageNum +' ');
Any assistance will be most appreciated.

Thank you very much for your assistance try.
I have modified the code as suggested and the page numbers are now listing correctly, thank you, but....................,
The console  lists every page as having an "employee signature" when there are pages in the document that do not have an employee signature.
The code (revised as follows) is not processing the "getPageNthWord part of the statement" in the console report?
Can you please advise where the code needs reworking?
var ckWords; // word pair to test
var bFound = false; // logical status of found words
// loop through pages
for (var i = 0; i < this.numPages; i++ ) {
   bFound = false; // set found flag to false
   numWords = this.getPageNumWords(i); // number of words on page
   // loop through the words on page
   for (var j = 0; j < numWords; j++) {
      // get word pair to test
      ckWords = this.getPageNthWord(i, j) + ' ' + this.getPageNthWord(i, j + 1); // test words
      // check to see if word pair is 'Employee' string is present
      if ( ckWord == "Employee") {
         bFound = true; // indicate found logical value
         console.println('Pages that includes an employee signature: ' + (i + 1) +' ');
         break; // no need to further test for this page
      } // end Employee Signature
   } // end word loop
   // test to see if words not found
   if(bFound == false) {
         console.println('Pages that do include an employee signature: ' + (i + 1) +' ');
    } // end not found on page  
} // end page loop
Thank you

Similar Messages

  • How to use the Include Statement in the BADI

    Dear All,
            I am trying to implement the BADI. So i need to use the Include in the BADI.
    How to use the Include statement in the BADI. I cant able to use it in the Public, Private and protected statement.
    Where should i mention that,,,,
    Thanks
    Yogesh

    Hi Sharat,
      Thanks for your reply.
    I need to use the BADI HRWPC_PCR_APPR_FORM. In which the values are available in the Container. So if i need to use the container values then i need to use that include <cntain>.
    Is there any possible ways to make it.
    Thanks
    Yogesh

  • Pleasse How To  Compute Spaces in Statement (by JAVA code)

    hi
    Please can you help me ;
    How To Compute Spaces in Statement (by JAVA code) .
    Best Regards;

    Hi,
    can you be more specific? What statement? If it is a string you can use a String buffer and add spaces to wherever you want within a string.
    Frank

  • How to Use Mobile Service in HTML/JavaScript Application

    The Windows Azure Mobile Service is a back end tool for mobile applications. It supports various platforms, such as Windows Store, Windows Phone 8, iOS and Android. The Windows Azure
    Mobile service can also support HTML/JavaScript. This article helps you to get a basic idea of how to use the Windows Azure Mobile Service in HTML/JavaScript applications.
    Let us start with a Quick startup project provided by Microsoft. A Quick startup is a simple demo project that can help us to understand how to use the Windows Azure Mobile Service with HTML/JavaScript. So let's start from the Quick startup project.
    Login into in the Windows Azure portal and use the following procedure.
    This article assumes you already have a Windows Azure account and the mobile service is enabled in your account.
    1. Create a new Windows Azure Mobile Service
    Click on the +New button from the left corner and select Compute -> Mobile Service and then click on the "Create" button.
    The Windows Azure portal popup creates a mobile service wizard when you click the Create button. Windows Azure asks you to enter the mobile service name as shown in the following image:
    Select the database options and region for your mobile service and click on the "Next" button.
    Once your mobile service is successfully created, the portal will show all your mobile services as shown in the following images.
    Ok! We have created a new mobile service successfully. Let's move to our subsequent steps.
    1. Quick startup Project 
    As we all know, the Windows Azure Mobile Service can support many platforms such as Windows Store, Windows Phone 8, iOS, Android and HTML/JavaScript. This article only tells us about the new HTML/JavaScript platform that is recently added to the Windows Azure
    Mobile Service.
    In the image above, we are in the quick startup page where the Windows Azure Mobile Service allows the user to choose their platform. I have selected the HTML/JavaScript Platform.
    In the image above, we found 3 quick steps that can allow us to run <g class="gr_ gr_74 gr-alert gr_gramm Grammar" data-gr-id="74" id="74">a HTML/JavaScript</g> sample project. 
    1. Create Table: In this step the user needs to create a table that can used by the sample project, once you hit the create TodoItem Table button. The Portal will create a TodoItem table in your mobile service. You
    can check this table by clicking on the data tab(menu).
    2. Download and run your app: In this step the user needs to download the Quick startup project that is provided by the Windows Azure portal. Click on the "Download" button and download the project. You will
    see the following files in the quick startup project.
    The Server folder contains some files to setup this project locally. The user should run the file from the server folder corresponding to their OS. I am using Windows OS so I ran the <g class="gr_ gr_80 gr-alert gr_spell ContextualSpelling ins-del multiReplace"
    data-gr-id="80" id="80">lanch</g>-<g class="gr_ gr_79 gr-alert gr_spell ContextualSpelling ins-del multiReplace" data-gr-id="79" id="79">windwos</g> file to setup this project locally in
    IISExpress.
    Press r and enter the key, you will see IISExpress started. Do not close this Windows and open your browser and request the http://localhost:8000/ page.
    Enter the Item name and click on the add button. Your Item will be added to the TodoItem table.
    3. Configure your host name: This step is a very important step for any HTML/JavaScript application that uses the Windows Azure Mobile Service. In this <g class="gr_ gr_83 gr-alert gr_gramm Punctuation only-ins
    replaceWithoutSep" data-gr-id="83" id="83">step</g> the user must register their website name in the Cross-origin resource sharing (CORS). By default, "localhost" is added by the Windows Azure Mobile Service
    so your quick startup project can run without making any CORS setting changes. The user can add their website domain name by clicking on the configure tab (menu).
    The user can add as many website domain names as needed.

    are you asking a question or did you just post a tutorial here? you might want to post it as a blog post or wiki entry instead.

  • How to use count sql statement?

    i've never used the count function and i'm not sure how to use it to print it onto a html page...my code is below...
    <%
    String tot = (String)session.getAttribute("total");
    int total = Integer.parseInt(tot);
    Class.forName("org.postgresql.Driver");
    // create connection url
    String URL2 = "jdbc:postgresql://dbhost/ug59sxn";
    // pass database parameters to JDBC driver
    Connection Conn2 = DriverManager.getConnection(URL2, "ug59sxn", "hupeswop");
    // query statement
    Statement SQLStatement2 = Conn2.createStatement();
    // generate query
    String Query2 = "SELECT COUNT(*) FROM userteam WHERE total > '"+total+"'";
    // get result code
    ResultSet SQLResult2 = SQLStatement2.executeQuery(Query2);
    int position = (int)SQLResult2 + 1;
    %>
    <TD valign=top>
    <P align=center><FONT size=+1>Welcome <%= session.getAttribute("fName") %> <%= session.getAttribute("surname") %><BR>
    Your Team, <%= session.getAttribute("teamname") %>, are currently lying in position <FONT color=red><% out.println(position) %></font>, with <FONT color=red><%= session.getAttribute("total") %></font> points.<BR>
    </FONT></P>
    <P align=justify>      Use the shorcuts on the left to visit different sections of the game.
    You can change your squad around to prepare for forthcoming games (fixtures can be found in the statistics section),
    transfer a player in to your squad to add some depth or replace injured members, or perhaps browse the statistics section to see how your team is doing in the FFL table.</P>
    <HR>
    <%
    SQLResult2.close();
    SQLStatement2.close();
    Conn2.close();
    %>
    i get the following errors:
    type Exception report
    message Internal Server Error
    description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
    An error occured between lines: 62 and 84 in the jsp file: /main2.jsp
    Generated servlet error:
    /home/students/ug/ug59sxn/servlets-local/work/localhost/myapp/main2$jsp.java:80: Invalid cast from java.sql.ResultSet to int.
    int position = (int)SQLResult2 + 1;
    ^
    An error occurred at line: 88 in the jsp file: /main2.jsp
    Generated servlet error:
    /home/students/ug/ug59sxn/servlets-local/work/localhost/myapp/main2$jsp.java:108: Invalid type expression.
    out.println(position)
    ^
    An error occurred at line: 88 in the jsp file: /main2.jsp
    Generated servlet error:
    /home/students/ug/ug59sxn/servlets-local/work/localhost/myapp/main2$jsp.java:111: Invalid declaration.
    out.write("</font>, with <FONT color=red>");
    ^
    3 errors, 1 warning
    if anyone can help me out, please do so..thanx in advance...

    You cannot cast a ResultSet object (or any other object for that matter) to a primitive (such as an int)
    Replace the following line of code:
    int position = (int)SQLResult2 + 1;with this:
    int position = 0;
    if(SQLResult2.next())
      position = SQLResult2.getInt(1) + 1;
    }Additionally I noticed that you have put single quotes around total in the following line:
    String Query2 = "SELECT COUNT(*) FROM userteam WHERE total > '"+total+"'";Are you sure that the total column in the userteam table is of string type? If not, you don't need the single quotes.

  • How to use the select statement in for loop

    Hi All,
    my question is can we use select statement in for loop like as follows .
    for key in select key from one_table.
    when i am using this am getting an error like Found select invalid i identifier
    how to make use of select statement in for loop
    please suggest me .
    Thanks
    Sree

    SQL>set serveroutput on;
    SQL> DECLARE
         BEGIN
         FOR Cur_Rec IN (SELECT dname FROM dept) LOOP
          DBMS_OUTPUT.PUT_LINE(Cur_Rec.dname);
         END LOOP;
         END;
    SQL>
    ACCOUNTING
    RESEARCH
    SALES
    OPERATIONSAs per your requirement always filter the Query beforehand
    Like
    FOR Cur_Rec IN (SELECT key FROM <table> WHERE key=1) LOOP
    END LOOP;Edited by: Lokanath Giri on १ दिसंबर, २०११ ३:५६ अपराह्न

  • How to use Native SQL statement in JDBC receiver interface

    Dear All,
    Can any one please help us in using Native SQL statement in a JDBC receiver channel. The reason why I need to use Native SQL statement instead of standard XML structure is that I need to execute a dynamic SQL query in third party database system lke:-
    Select Field1 Field2 from TABLE Where Field3 like "%Name'
    I expect the the response in the form of XML file which I can pick up using synchornous interface as mentioned on help.sap.com:-
    http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm
    The value for %Name can change dynamically according to the transaction and hence cannot be inluded as a KEY element in standard XLM structure,
    Hence I need to know:-
    1. What message mapping I should use in case if I have to use Native SQL statement.
    2.What operation mapping I should use in case if I have to use Native SQL statement.
    If guess correclty I may have to use Java mapping to do the above activities. Hence I want to know
    3 .How do to go about it to do the Java mapping.
    Thanks
    Ameet

    >
    Ameet Deshpande wrote:
    > Dear All,
    >
    > Can any one please help us in using Native SQL statement in a JDBC receiver channel. The reason why I need to use Native SQL statement instead of standard XML structure is that I need to execute a dynamic SQL query in third party database system lke:-
    >
    > "
    > Select Field1 Field2 from TABLE Where Field3 like "%Name'
    > "
    > I expect the the response in the form of XML file which I can pick up using synchornous interface as mentioned on help.sap.com:-
    >
    > http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm
    > http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm
    >
    > The value for %Name can change dynamically according to the transaction and hence cannot be inluded as a KEY element in standard XLM structure,
    >
    > Hence I need to know:-
    >
    > 1. What message mapping I should use in case if I have to use Native SQL statement.
    > 2.What operation mapping I should use in case if I have to use Native SQL statement.
    > If guess correclty I may have to use Java mapping to do the above activities. Hence I want to know
    > 3 .How do to go about it to do the Java mapping.
    >
    > Thanks
    > Ameet
    You can use a stored procedure, and call it from jdbc receiver adapter.
    I also solve this issue, with a DBLookup in message mapping. You can refer to my blog, and this usefull 3d:
    http://simonlesflex.wordpress.com/2010/12/07/pi-oracle-dblookup/
    /people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
    /people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler

  • How to use a update statement which has a string containing '&' -  Pls help

    When used the following select statment in SQL plus it is working fine:
    SELECT * FROM REDEMPTION_OFFERS
    WHERE portfolio=203 AND display_description= '$100 Bed Bath'||' & '||'Beyond Gift Card' AND ext_redemption_type_lc = 'ERT_CERT'
    But when using the same statement in a Update statement it is not working. Can some one please help me: Thanks in advance
    UPDATE REDEMPTION_OFFERS SET LONG_DESCRIPTION = 'null'
    WHERE portfolio=203 AND display_description= '$100 Bed Bath'||' & '||'Beyond Gift Card' AND ext_redemption_type_lc = 'ERT_CERT'

    When used the following select statment in SQL plus
    it is working fine:
    SELECT * FROM REDEMPTION_OFFERS
    WHERE portfolio=203 AND display_description= '$100
    Bed Bath'||' & '||'Beyond Gift Card' AND
    ext_redemption_type_lc = 'ERT_CERT'
    But when using the same statement in a Update
    statement it is not working. Can some one please
    help me: Thanks in advance
    UPDATE REDEMPTION_OFFERS SET LONG_DESCRIPTION =
    'null'
    WHERE portfolio=203 AND display_description= '$100
    Bed Bath'||' & '||'Beyond Gift Card' AND
    ext_redemption_type_lc = 'ERT_CERT'looks like You are using the UPDATE statement in SQL*PLUS too. Your statement is also working....
    SQL> select * from a;
            F1 F2        F3
             1           BED BATH
             2           BED BATH
             5           BED BATH
             3           BED BATH
            -2           BED BATH
            -4           BED BATH
            -1           BED BATH
    7 rows selected.
    SQL> update a set f3 = 'BED '||'&'||' BATH';
    7 rows updated.
    SQL> select * from a;
            F1 F2        F3
             1           BED & BATH
             2           BED & BATH
             5           BED & BATH
             3           BED & BATH
            -2           BED & BATH
            -4           BED & BATH
            -1           BED & BATH
    7 rows selected.

  • How to use a select statement with chinese characters?

    I am currently developing a java servlet<using tomcat 4.x> which allows me to use select statement to retrieve results from the Microsoft SQL Server 2000 database. I am using a simple form to get the parameter for querying. The main problem i'm facing is that there are chinese information in the SQL database, but i can't retrieve it through the sql statement with the chinese characters input<thru the form with the help of NJ STAR>in the WHERE condition. When i execute the statement, it returns me no results even though the rows are present in the database.
    Does anyone have the solution to using chinese words in the WHERE clause of the select statement to retrieve results with columns which contains chinese characters? Please help me. Thanks everyone. :)
    PS: when i cut and paste those characters in the sql database and paste onto java.. it is ??? in questionmarks.. but when i paste them into excel 2000.. its shown as chinese chars again..
    please heelppp~~

    Greetings,
    PS: when i cut and paste those characters in thesql
    database and paste onto java.. it is ??? in
    questionmarks.. but when i paste them into excelThis is why the SELECT is not returning any results.
    You need to set the character encoding set on your
    statement and parameters for the characters to be
    properly translated. Refer to the charsetName
    parameter in the String class constructor in your API
    docs and also to
    $JDK_DOCS/guide/intl/encoding.doc.html in your JDK
    documentation.
    2000.. its shown as chinese chars again..Because Office programs are performing the same kind
    of character translation with the appropriate MS APIs.
    please heelppp~~Regards,
    Tony "Vee Schade" Cookis it possible for you to show me some coding examples? i don't really understand what is to be done in order to set the char set and what does it really do.. tried reading up but still dun understand.. :(
    pardon my shallow knowledge of java..
    ok..
    The thing is when i used an insert statement with chinese characters of GBK format hardcoded into the java servlet and then i use the insert statement to insert the chars into the database, it cannot be seen as a chinese word when i off the NJStar. and then it can be searched out with my current form of servlet.. below is my coding of the servlet..
    note: i've set my html file to charset = GBK
    //prototype of Search engine...
    //workable for GBK input and output...
    import java.io.*;
    import java.io.OutputStream;
    import java.io.IOException;
    import javax.servlet.http.*;
    import javax.servlet.ServletException;
    import java.util.*;
    import java.sql.*;
    import java.nio.charset.Charset;
    public class SearchBeta extends HttpServlet {
         private Vector musicDetails = new Vector();
         private String query = "";
         public void service (HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException, UnsupportedEncodingException {
              query = req.getParameter ("T1");
              System.out.println("before:"+query);
              String type = req.getParameter ("D1");//type
              query = req.getParameter ("T1");
              //query = "������";
              System.out.println("after:"+query);
              getResults(type,query);
              System.out.println("locale = :"+req.getLocale());
              res.setContentType ("text/html;charset=GBK");
              PrintWriter out = res.getWriter();
              out.println("<html>");
              out.println("<head>");
              out.println("<body bgcolor = \"black\">");
              out.println("<font face = \"comic sans ms\" color=\"Cornsilk\">");
              if (query.length()==0)
                   out.println ("Please key in your search query.");
              else if (musicDetails.size()==0)
                   out.println ("Sorry, no results matching your search can be found.");
              else {
                   out.println("<center>");
                   out.println("<table cellspacing = \"50\">");
                   int i = 0;
                   //Display the details of the music
                   while (i<musicDetails.size()) {
                        Results details = (Results)musicDetails.get(i);
                        String dbArtist = "";
                        String dbAlbum = "";
                        String dbTitle = "";
                        String dbCompany = "";
                        dbAlbum = details.getAlbum();
                        dbTitle = details.getTitle();
                        dbCompany = details.getCompany();
                        dbArtist = details.getArtist();
                        try{
                             dbAlbum = new String(dbAlbum.getBytes("ISO-8859-1"),"GBK");
                             dbTitle = new String(dbTitle.getBytes("ISO-8859-1"),"GBK");
                             dbCompany = new String(dbCompany.getBytes("ISO-8859-1"),"GBK");
                             dbArtist = new String(dbArtist.getBytes("ISO-8859-1"),"GBK");//correct translation.
                        catch(UnsupportedEncodingException e){
                             System.out.print(e);
                             e.printStackTrace();
                        String dbImage_loc = details.getImage();
                        out.println("<tr>");
                             out.println("<td><table>");
                                  out.println("<img src=C:\\Program Files\\Apache Group\\Tomcat 4.1\\webapps\\examples\\ThumbNails\\"+dbImage_loc+">");
                             out.println("<tr>");
                                  out.println("<th><font color=\"violet\"> Artist: </font></th>");
                                  out.println("<td><font color=\"Cornsilk\">"+dbArtist+"</font></td>");
                             out.println("</tr>");
                             out.println("<tr>");
                                  out.println("<th><font color=\"violet\"> Title: </font></th>");
                                  out.println("<td><font color=\"Cornsilk\">"+dbTitle+"</font></td>");
                             out.println("</tr>");
                             out.println("<tr>");
                                  out.println("<th><font color=\"violet\"> Company: </font></th>");
                                  out.println("<td><font color=\"Cornsilk\">"+dbCompany+"</font></td>");
                             out.println("</tr>");
                             System.out.println("album: "+ dbAlbum);
                             out.println("<tr>");
                                  out.println("<th><font color=\"violet\"> Album: </font></th>");
                                  out.println("<td><font color=\"Cornsilk\">"+dbAlbum+"</font></td>");
                             out.println("</tr>");
                             System.out.println("company: "+ dbCompany);
                             out.println("</table></td>");
                        out.println("</tr>");
                        i++;
                   out.println("</table>");
                   out.println("</center>");
              out.println("</font>");
              out.println("</body>");
              out.println("</head>");
              out.println("</html>");
              out.close();
              //to remove all the elements from the Vector
              musicDetails.removeAllElements();
         //get Searched Music Details and store in Results object which is stored in musicDetails vector
         public void getResults (String type, String searchQuery) {
              try {
                   Class.forName ("com.microsoft.jdbc.sqlserver.SQLServerDriver");
                   Connection con = DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=music","sa","kokkeng");
                   Statement stmt = con.createStatement();
                   String query = "SELECT * FROM MusicDetails WHERE "+type+" = '"+searchQuery+"'";
                   ResultSet rs = stmt.executeQuery(query);
                   while (rs.next()) {
                        String artist = rs.getString("Artist");
                        String title = rs.getString("Song");
                        String company = rs.getString("Company");
                        String album = rs.getString("Album");
                        String image_loc = rs.getString("Image");
                        Results details = new Results (artist,title,company,album,image_loc);
                        musicDetails.add(details);
                   stmt.close();
                   con.close();
              catch (Exception e) {
                   System.out.println(e.getMessage());
                   e.printStackTrace();
    with the above servlet i created, i can search out the data in the database which i've inserted through the insert statement. I still can't search for things i've keyed into the database directly using NJStar..
    thank you so much for helping.. really hope any one else who knows the answer to this will reply too... thank you all so much...
    -KK

  • How to use  alternative SQL  statements  in  EJB

    I have a probelm to use alternative sql statements in EJB,
    could any one sugg on this topic,
    Thanks in advance.

    Please explain your problem better. Really can't figure what you are trying to do.....
    choosing which sql statement to use at runtime
    or creating dynamic sql statement at runtime
    which??
    Regards

  • How to use a case statement in where clause

    Hi All,
    I have a requirement which is to bring all the claims that are created in the last month.So, i wrote a query something like this
    select * from claims
    where
    (Month(ClaimOpenDate) = Month(Getdate())-1 and year(claimopendate) = year(getDate()))
    which would give me any new claims created in last month of current year, but this condition fails if we are in the first month of a new year( lets say if we are in 2016 jan then month(getdate())-1 would be 0 and year(getdate()) would be 2016 so we dont
    find any records where year is 2016 and month is 0 for claimopen).
    So, i would like to use a case statament or something which can help me get around this one.
    Can someone please help me with any suggestions?
    Thanks

    Hi Jason,
    Thanks a lot for your help. This is what exactly i am looking for but i just gave a sample query above below is my original query 
    select
    row_number() over (order by [ClaimNumber]) as DataElementName
    ,c.PolicyNumber as PolicyNum
    , c.FirstName as CustNameF
    ,c.LastName as CustNameL
    ,c.PolicyForm as PolType
    ,'Homesite' as Company
    ,[ClaimNumber] as ClaimNum
    ,E.office as Ofc
    ,e.Supervisior_FullName as Team
    , RIGHT(e.adjuster_Name ,LEN(e.adjuster_Name)- charindex(',' ,e.adjuster_Name)) as FORepF
    , case when charindex(',' ,e.adjuster_Name) <> 0 then left(e.adjuster_Name,charindex(',' ,e.adjuster_Name)-1) else e.adjuster_Name end as FORepL
    ,e.AdjusterID as RepC -- not sure
    ,CONVERT ( varchar,c.LossDate ,101) as DOL
    ,convert (varchar,c.ClaimOpenDate,101) as DOR
    ,rtrim(c.Loss_State) as LossSt
    ,c.Loss_ZipCode as LossZIP
    ,c.Loss_City as LossCity
    ,c.LossType as FOL
    ,'' as PR
    ,'' as PRNum
    ,1 as FeaNum
    ,'HO' as FeaType
    ,case when rtrim(c.claimStatus)= 'Closed' then 'Closed' else 'Open' end as FeaStat
    ,'' as FeaOpen
    ,'' as FeaClosed
    ,s.PaymentIndemnityAmount as PaidAmt
    ,s.ReserveIndemnityAmount as Reserve
    ,'' as Sub
    ,'' as Sal
    ,'' as FeatOwnOfc
    ,e.Supervisior_FullName as FeatOwnTeam
    ,RIGHT(e.adjuster_Name ,LEN(e.adjuster_Name)- charindex(',' ,e.adjuster_Name)) as FeatOwnRepF
    ,case when charindex(',' ,e.adjuster_Name) <> 0 then left(e.adjuster_Name,charindex(',' ,e.adjuster_Name)-1) else e.adjuster_Name end as FeatOwnRepL
    ,e.AdjusterID as FeatOwnRepCode
    ,NULL AS Description --not sure
    from [Stg].[HS_DW_RV_Claims] c
    inner join [dbo].[Claims_Primary_Adjuster] a on a.CLAIM_NUMBER = c.ClaimNumber
    inner join [dbo].[vw_Adjuster] e on e.adjuster_Name = a.primary_ADJUSTER
    left outer join [Stg].[HS_DW_LossClaimSummary] s on c.ClaimKey=s.ClaimKey
    where c.LoadSource = 'CMS'
    and
    (s.PaymentIndemnityAmount <>0 or s.PaymentExpenseAmount <>0)
    and
    ClaimOpenDate BETWEEN DATEADD(mm, DATEDIFF(mm, 0, CURRENT_TIMESTAMP) -1, 0) AND DATEADD(mm, DATEDIFF(mm, 0, CURRENT_TIMESTAMP), 0)
    UNION ALL
    select
    row_number() over (order by [ClaimNumber]) as DataElementName
    ,c.PolicyNumber as PolicyNum
    , c.FirstName as CustNameF
    ,c.LastName as CustNameL
    ,c.PolicyForm as PolType
    ,'Homesite' as Company
    ,[ClaimNumber] as ClaimNum
    ,E.office as Ofc
    ,e.Supervisior_FullName as Team
    , RIGHT(e.adjuster_Name ,LEN(e.adjuster_Name)- charindex(',' ,e.adjuster_Name)) as FORepF
    , case when charindex(',' ,e.adjuster_Name) <> 0 then left(e.adjuster_Name,charindex(',' ,e.adjuster_Name)-1) else e.adjuster_Name end as FORepL
    ,e.AdjusterID as RepC -- not sure
    ,CONVERT ( varchar,c.LossDate ,101) as DOL
    ,convert (varchar,c.ClaimOpenDate,101) as DOR
    ,rtrim(c.Loss_State) as LossSt
    ,c.Loss_ZipCode as LossZIP
    ,c.Loss_City as LossCity
    ,c.LossType as FOL
    ,'' as PR
    ,'' as PRNum
    ,1 as FeaNum
    ,'HO' as FeaType
    ,case when rtrim(c.claimStatus)= 'Closed' then 'Closed' else 'Open' end as FeaStat
    ,'' as FeaOpen
    ,'' as FeaClosed
    ,s.PaymentIndemnityAmount as PaidAmt
    ,s.ReserveIndemnityAmount as Reserve
    ,'' as Sub
    ,'' as Sal
    ,'' as FeatOwnOfc
    ,e.Supervisior_FullName as FeatOwnTeam
    ,RIGHT(e.adjuster_Name ,LEN(e.adjuster_Name)- charindex(',' ,e.adjuster_Name)) as FeatOwnRepF
    ,case when charindex(',' ,e.adjuster_Name) <> 0 then left(e.adjuster_Name,charindex(',' ,e.adjuster_Name)-1) else e.adjuster_Name end as FeatOwnRepL
    ,e.AdjusterID as FeatOwnRepCode
    ,DESCRIPTION --not sure
    from Stg.IG_Document D
    inner join [Stg].[HS_DW_RV_Claims] c on D.PARENTREF = C.ClaimNumber
    inner join [dbo].[Claims_Primary_Adjuster] a on a.CLAIM_NUMBER = c.ClaimNumber
    inner join [dbo].[vw_Adjuster] e on e.adjuster_Name = a.primary_ADJUSTER
    left outer join [Stg].[HS_DW_LossClaimSummary] s on c.ClaimKey=s.ClaimKey
    where c.LoadSource = 'CMS'
    and
    DESCRIPTION like '%Denial Letter%'
    and
    ClaimOpenDate BETWEEN DATEADD(mm, DATEDIFF(mm, 0, CURRENT_TIMESTAMP) -1, 0) AND DATEADD(mm, DATEDIFF(mm, 0, CURRENT_TIMESTAMP), 0)
    So if i use your logic in the end for both the where clauses its been more than 10 minutes and the query is still running however if i use my old method it doesnt even take a second. Looks like its affecting the execution plan. Any suggestions to get around
    this one please?
    Thanks

  • How to isolate the Sql Statement from Java Code

    Hi
    I Need to know that can we segregate the Sql Statements and convert them to Stored Procedures so as to isolate the Sql statements from Java Code.
    So i have one static web page which uses four select Statements so what i want is to create a stored procedure encapsulating these queries. So that the Java Web Developer will simply call the Stored Procedure instead of using four different SQL Statements.
    Suppose the developer has these four Statements
    Select ename,empno,sal,job from emp;
    select empno,ename,mgr from emp;
    select deptno,dname from dept;
    select emp.ename,emp.empno,emp.deptno,dept,dname fromemp,dept;
    So can i encapsulate these four Sql Statements in one Procedure and the Web developer can call the Store procedure and dont need to write the Sql Statements in his code.
    Can Anybody guide me how to write this Stored type of Store procedure.
    Thanks

    http://www.google.com/search?q=java+windows+registry
    Next time, search yourself. It might be beyond your belief, but you're really, really not the first person to wonder about this.

  • How  can use a variable in the folowing code?

    How  can use a variable 'W_ROWNUM2' in the folowing code?
    MOVE '1' TO CNT.
    LOOP AT L_T_PM2.
                  CONCATENATE '0' CNT INTO W_ROWNUM2.CONDENSE W_ROWNUM2.
                   CONCATENATE 'F110V-VARI'W_ROWNUM2'(01)' INTO FLD2.
        perform  DYNPRO_FIELD       using FLD2
                                     L_T_PM2-vari12_con.
                   CNT = CNT + 1.
                   CONDENSE CNT.                                                              
    ENDLOOP.
    I need to increment the value of W_ROWNUM2.
    Please ,it is urgent!!

    Hello
    CONCATENATE 'F110V-VARI'W_ROWNUM2'(01)' INTO FLD2.
    Try using spaces between parts of the resulting string.
    CONCATENATE 'F110V-VARI'  W_ROWNUM2  '(01)'   INTO FLD2
    Regards
    Greg Kern.

  • How to use .properties files in Webdynpro Java code?

    Hi all,
      I want to use a logon.properties file when I initial a JCO connection pool in my webdynpro DC (JCO.addClientPool()),but  I found when I deployed this DC to the server, it always giv e me an FileNotFoundException. So I donot know how to deploy a .properties file to the server and how to access this file in my Java code?
    Thans and Best regards
    Deyang

    Hi,
    1) put .properties file to your packege under src\packages folder (src\packages\com\sdn\properties\jco.properties)
    2) load property:
         final InputStream is = getClass().getClassLoader().getResourceAsStream("com/sdn/properties/jco.properties");
         final Properties properties = new Properties();
         try
              properties.load(is);
         catch(Exception e)
              wdComponentAPI.getMessageManager().reportException(new WDNonFatalException(e), false);
    Regatds Maxim R.

  • Using the rewriter to include javascript code on an external webpage

    -We are running Sun Portal Server 6.2
    -When users go to GOOGLE.COM through our gateway. I want the google page to be rewritten in such a way that it includes a piece of javascript code. (Written by me)
    In all the examples of the Sun documentation, I noticed only possibilities of rewriting tags so that it includes the gateway URL. Is it possible to actually replace a specific HTML tag with your own code or just even add code using the Sun Portal Rewriter service ???
    Anybody any clues ?

    I may have a (very bad) solution.
    You explode the /opt/SUNWps/libgateway.jar. In ressources subdir you have SRAPConvertSystem.js.
    It seems to be the javascript code the rewriter add at the beginning of the page.
    Try to edit the file, add some javascript at the end, redo the jar file and put it back in /opt/SUNps/lib.
    I did not try this. Maybe it's working, maybe not.

Maybe you are looking for

  • 6103 screen light

    Is there a way to increase the time that the main display stays lit? I find that I'm cast into darkness part way through some tasks. Thanks.

  • FontBook - where does it store font informations?

    As I've posted here before, I've been massively frustrated by Leopard's FontBook over and over again... so much so that this afternoon's longish post was deleted by the modgods here (they say "Your post was removed from Apple Discussions as it contai

  • Re:Standard Functional Module to Create Product in CRM

    Hi Frnds ,     I am Looking for a Standard Functional Module were i can create a Product in CRM ,          Please kindly let me know the fields that has to be input in that FM or you mail me @ [email protected]  . It is Urgent and Immd for me the cor

  • Cannot open bookmarks

    Cannot open my bookmarks from safari task bar or view open web pages

  • Bundle photoshop cc et LR

    Impossible de finaliser la commande de ce bundle, une fois les informations de paiement tenseignées et validées la page de confirmation reste dans l'état "en cours" et ne bouge plus, et pas de nouvelles par mail,...