Complex Script needed

Hi - I have two things here I need help on.
I have a form created in Adobe LiveCycle Designer 8 that has an add and delete row.  The rows have a check box called Sub to Sub for users if a job construction job was sent from a subcontractor to another subcontractor.  Next to that is the description, and then 2 more columns, One is called "Original Amount" and the other is called "Final Amount Paid."  The Original Amount and Final Amount Paid totals at the bottom of the page.  What I need to do is if a user clicks on the Sub to Sub check box, the amount they enter in the  Original Amount and Final Amount Paid does not get added into the Grand Totals at the bottom of the page.  Can someone provide me with a script that will do this?
My second question - On the "Add Row" and "Delete Row," when it expands to a second page, the "Add Row" and "Delete Row" buttons do not work.  The user has to go back to the first page to add another row or delete another row.  Is there a way to have the add and delete row work on the second page so the user does not have to go back to the first page to add a row or delete a row?
Any assistance would be appreciated.
I use Adobe Livecycle Designer 8 and Adobe Acrobat 8.

Hi Pratyunna D,
As swapnil bhootwala in the above post you can use Unix and Windows line scripts.
Please refer the SAP Data Services Technical Manual  for more information about the scripts.
http://help.sap.com/businessobject/product_guides/sbods42/en/ds_42_tech_manuals_en.pdf#page=334
Refer to the 3.7 Topic in the technical manual for more about scripts and its functions.
http://help.sap.com/businessobject/product_guides/sbods42/en/ds_42_tech_manuals_en.pdf#page=1790
Data Services Scripting:
Data Services Scripting Language
I hope this will help you out.
Regards,
Akhileshkiran.

Similar Messages

  • Simple script needed

    I work with InDesign doing text layout. I have used scripts, but have never had the time to learn JavaScript. I need what I assume is a fairly simple script. The script needs to do the following:
    1. Open a document.
    2. Ignore the missing font dialog box.
    3. Load all text style from another file, with the styles from that file overwriting the styles in the current document.
    4. Save the open document with the same name.
    The script needs to be able to batch process all of the document in a folder.
    If this is simple enough to do with several lines of code, I would appreciate it if someone could help me out. If it is more complex than that, I can possibly pay.

    Hi kwilson68, could you contact me by email? I might be able to help you out.

  • Calendar script needed

    I need a recommendation for a PHP calendar script. It should
    have both a
    large display for use on a single page as well as a small one
    for use in
    a sidebar, like on a home page. The script needs to be able
    to handle
    links from within an event and must be easy for a user to
    update.
    And finally, it must integrate easily into an existing
    design.
    Any ideas?
    Thanks,
    Harvey Wasserman

    You're welcome!
    eclipsme wrote:
    > Thanks, MD
    >
    > Harvey
    >
    > Mad Dog wrote:
    >> If you want to be able to change the PHP files, then
    this is a
    >> problem. If you don't need to mess with them (and I
    don't know why
    >> you would when there are plenty of variables and CSS
    you can mess
    >> with the make the changes) then there's nothing to
    worry about.
    >> Installation is a breeze as long as you have Zend
    Optimizer or
    >> IonCube on the server. MD
    >>
    >>
    >> "eclipsme" <[email protected]> wrote in message
    >> news:ga8a3l$1o0$[email protected]..
    >>> Thanks for the reference. Yes, this looks
    interesting, but I don't
    >>> like that that the script is encoded. For
    instance, this line
    >>> bothers me: "DON'T GIVE UP! Installation of
    encoded files can be tough.
    >>> If you
    >>> haven't already, try the Auto-installer."
    >>>
    >>> Harvey
    >>>
    >>> Mad Dog wrote:
    >>>> www.easyPHPCalendar.com
    >>>>
    >>>> I've used it on several sites including
    integrating it into a
    >>>> Wordpress-run site.
    >>>>
    >>>> Mad Dog
    >>>>
    >>>>
    >>>> eclipsme wrote:
    >>>>> I need a recommendation for a PHP
    calendar script. It should have
    >>>>> both a large display for use on a single
    page as well as a small
    >>>>> one for use in a sidebar, like on a home
    page. The script needs
    >>>>> to be able to handle links from within
    an event and must be easy
    >>>>> for a user to update.
    >>>>> And finally, it must integrate easily
    into an existing design.
    >>>>>
    >>>>> Any ideas?
    >>>>>
    >>>>> Thanks,
    >>>>> Harvey Wasserman

  • Indesign CS5.5 Relink Script needs help

    Hi, I'm trying to relink images in an InDesign CS5.5 file to a different server using a script. This is what I have so far, but when I run the script I get errors and can't relink because "Either the file does not exist, you do not have permission, or the file may be in use by another application". Does anyone know how to make this script work? I'm fairly new to scripting.
    Here is the script I have:
    tell application "Adobe InDesign CS5.5"
              tell document 1
                        set linkList to links
                        set errInfo to "" -- We'll display error if we can't relink an item
                        repeat with x in linkList
                                  if (x's status) is not normal then -- I usually check for any link that has an error
      -- This should only return an AppleScript path with ":" separators
                                            set linkPath to (x's file path) as string
                                            if "Volumes/Calendars_2013 FPO" is in linkPath then
                                                      set AppleScript's text item delimiters to "Volumes/Calendars_2013 FPO"
                                                      set linkPath to (linkPath's text items) -- Create a list of text items
                                                      set AppleScript's text item delimiters to "Volumes/Calendars_2013"
                                                      set linkPath to (linkPath as string) -- Concatenate with new path
                                                      set AppleScript's text item delimiters to "" -- Reset TIDs
                                                      try
      -- Need to make our string (path) into an alias path
      relink x to alias linkPath
                                                                try
      update x -- This can be helpful
                                                                end try
                                                      on error err
      -- We'll store link name if error occurs
                                                                set errInfo to (errInfo & return & x's name)
                                                      end try
                                            end if
                                  end if
                        end repeat
      -- If an error occurs while trying to relink, we'll display it
                        if (count errInfo) > 0 then display dialog ("Can't relink:" & errInfo)
              end tell
    end tell
    --Hector

    I just tried adding collens to the end of the folder path. For some reason the script skipped the relink line. Below is the code with your update. I'm thinking its not finding the images because the script needs to make a list of all the images and choose the one that matches the missing image.
    tell application "Adobe InDesign CS5.5"
              tell document 1
                        set linkList to links
                        set errInfo to "" -- We'll display error if we can't relink an item
                        repeat with x in linkList
                                  if (x's status) is not normal then -- I usually check for any link that has an error
      -- This should only return an AppleScript path with ":" separators
                                            set linkPath to (x's file path) as string
                                            if "Calendars_2013 FPO:" is in linkPath then
                                                      set AppleScript's text item delimiters to "Calendars_2013 FPO:"
                                                      set linkPath to (linkPath's text items) -- Create a list of text items
                                                      set AppleScript's text item delimiters to "Calendars_2013:"
                                                      set linkPath to (linkPath as string) -- Concatenate with new path
                                                      set AppleScript's text item delimiters to "" -- Reset TIDs
                                                      try
      -- Need to make our string (path) into an alias path
      relink x to alias linkPath
                                                                try
      update x -- This can be helpful
                                                                end try
                                                      on error err
      -- We'll store link name if error occurs
                                                                set errInfo to (errInfo & return & x's name)
                                                      end try
                                            end if
                                  end if
                        end repeat
      -- If an error occurs while trying to relink, we'll display it
                        if (count errInfo) > 0 then display dialog ("Can't relink:" & errInfo)
              end tell
    end tell
    --Thanks for you help

  • Illustrator scripter needed

    Illustrator scripter needed to write a simple script regarding layers in AI.
    If you are interested, please contact me at [email protected]

    hi all,
    this is my first time to this forum , I need your help friends .I want to apply background color to pageitem using javascriping
    (widows os). How can I do this?
    Please send the mail regarding to this to [email protected] or [email protected]
    Thanks in advance
    Dhananjay Patil

  • Constant color gear turning, frequent message "Script needs debugging"

    constant color beach ball (gear) turning for extended periods using Safari and Facebook. small window opens indicating "Script needs debugging" esp in Facebook.
    Is this hardware or software? What to do?

    Discovered the reason for no space to load..toram..
    The SIZE statement of 800MB limits the loading to 800MB.,  thus, it must be changed to 2500MB in order to load the 2gb DVD DISC ..TORAM.
    IT BOOTS AND LOADS TO DESKTOP IN 5MINS10SECS.  THERE IS 5gB OF PROGRAMS ..IN RAM.
    I can now run my system without hdds or cd's and use USB "on call" and leave the system running day and night!!

  • Help with scripting: need to import Excel files into PS type layers

    Howdy all,
    I have a series of TV commercials provided to me as layered PS files.  I work in CS3 and export to Avid for editing.
    For customization, I need to import their Excel list of phone numbers and duplicate each one into a type layer with existing efx and placement.
    There are 30-60 #s, which appear in 2 locations, so automation is key (just finished a 45 # series, and they have more!)
    I dont know how to script this, and would appreciate any guidance. I am not asking for someone to do it for me, just help me learn what I have to do.
    Dave Koslow

    From Excel save your file out as either CSV or TDT from the drop down 'save as' options. Once you have a plain text file script will be able to read the text file using which ever delimiter best suits you and create an array of string variables that you can use within photoshop to assign to the contents of a text layer…

  • Script needed to generate a list of paragraph and character styles from the Book Level

    Hello,
    I am using FrameMaker 11 in the Adobe Technical Communication Suite 4 and I need to find a script that will generate a list
    of paragraph and character styles from the book level.
    I am working with unstructured FrameMaker books, but will soon be looking at getting a conversion table developed
    that will allow me to migrate all my data over to Dita (1.1 for now).
    Any thoughts, ideas on this is very much appreciated.
    Regards,
    Jim

    Hi Jim,
    I think the problem you are having with getting a response is that you are asking someone to write a script for you. Normally, you would have to pay someone for this, as it is something that folks do for a living.
    Nonetheless, I had a few minutes to spare, so I worked up the following script that I believe does the job. It is very slow, clunky, and totally non-elegant, but I think it works. It leverages the book error log mechanism which is built in and accessible by scripts, but is spendidly unattractive. I hope this gives you a starting point. It could be made much more beautiful, of course, but such would take lots more time.
    Russ
    ListAllFormatsInBook()
    function ListAllFormatsInBook()
        var doc, path, fmt;
        var book = app.ActiveBook;
        if(!book.ObjectValid()) book = app.FirstOpenBook;
        if(!book.ObjectValid())
            alert("No book window is active. Cannot continue.");
            return;
        CallErrorLog(book, 0, 0, "-----------------------------------------------------------");
        CallErrorLog(book, 0, 0, "** Book format report for:");
        CallErrorLog(book, 0, 0, book.Name);
        var comp = book.FirstComponentInBook;
        while(comp.ObjectValid())
            path = comp.Name;
            doc = SimpleOpen (path, false);
            if(doc.ObjectValid())
                CallErrorLog(book, 0, 0, "-----------------------------------------------------------");
                CallErrorLog(book, 0, 0, "-----------------------------------------------------------");
                CallErrorLog(book, doc, 0, "");
                CallErrorLog(book, 0, 0, "-----------------------------------------------------------");
                CallErrorLog(book, 0, 0, "-----------------------------------------------------------");
                CallErrorLog(book, 0, 0, "Paragraph formats:");
                fmt = doc.FirstPgfFmtInDoc;
                while(fmt.ObjectValid())
                    CallErrorLog(book, 0, 0, "  - " + fmt.Name);
                    fmt = fmt.NextPgfFmtInDoc;
                CallErrorLog(book, 0, 0, "-----------------------------------------------------------");
                CallErrorLog(book, 0, 0, "Character formats:");
                fmt = doc.FirstCharFmtInDoc;
                while(fmt.ObjectValid())
                    CallErrorLog(book, 0, 0, "  - " + fmt.Name);
                    fmt = fmt.NextCharFmtInDoc;
            else
                CallErrorLog(book, 0, 0, "-----------------------------------------------------------");
                CallErrorLog(book, 0, 0, "!!!  Could not open: " + comp.Name + " !!!");
                CallErrorLog(book, 0, 0, "-----------------------------------------------------------");
            comp = comp.NextComponentInBook;
    function CallErrorLog(book, doc, object, text)
        var arg;
        arg = "log ";
        if(book == null || book == 0 || !book.ObjectValid())
            arg += "-b=0 ";
        else arg += "-b=" + book.id + " ";
        if(doc == null || doc == 0 || !doc.ObjectValid())
            arg += "-d=0 ";
        else arg += "-d=" + doc.id + " ";
        if(object == null || object == 0 || !object.ObjectValid())
            arg += "-O=0 ";
        else arg += "-O=" + object.id + " ";
        arg += "--" + text;
        CallClient("BookErrorLog", arg);

  • Lost -never written java script - need simple calculation of tax field

    Read through all the scripting threads, all I need is to calculate the tax based on a subtotal field. Help!

    Thank you!  I was putting the 8.25% instead of .0825.  Appreciate the quick response!

  • Script needed to print complete contents in scrolling text field Acrobat Pro 9 (MAC)

    I've seen this question several times in my search but no real solution. My client wants a form with text fields that only show 1-2 lines when viewed on-screen but are scrollable so that the user can input a lot of text. I had no problem creating that. The problem occurs when I try to print the form. Only the visible lines of text print and not the entire contents of the field. 
    Is there a Javascript that I can assign to a Print button in my form that can be assigned to the Mouse Down action that will make the entire field contents print? I even recreated the form in WORD so that when the user inputs text into the field, the contents of the form move down the page. My client didn't like that approach. I'm not a programmer and so I haven't been able to write my own script to handle the printing issue. I'm MAC based so using Livecycle isn't an option for me. Thanks!

    I'm using Acrobat Professional 9. I used to use Livecycle which was more flexible, but I no longer have a PC, only MAC and Adobe doesn't make Livecycle for the MAC. 
    The client doesn't want larger fields unfortunately. They have questions that require 2 or 3 pages of information to be entered into a small text field but they don't want large fields. If they're reviewing the answers online, it's fine - they can just scroll through the text fields and read the answers but they don't want the completed text fields to expand unless the form is printed.
    I've already set up my text fields to be multi-line and scrollable so that the client can review all of the text in the field if they are looking at the saved PDF online. The problem I'm having is that I need the entire contents of the text field to be visible ONLY when printed out. They don't want larger fields to show in the form. The client was quite specific about it. The form is also going to be used infrequently, so collecting the data and storing it on a server isn't something they're particularly interested in. The information is also confidential, so they do not want me to be collecting and storing the data and sending it back to them in another format. The easiest option I could see was to create a script tied to a PRINT button that printed out the complete text field.
    Thanks!

  • Update name, surname from display name - script needed

    Hello
    I'm moved from Postfix to Office365. My users has only display name field filled. This is a problem when we try to find an user, because only way is to find it when You will put name in search field.
    I decided to build a script that will first check if the user has "Name" is filled if not then we need to take  display name. Divide it (take first word into name and rest into
    surname). Next update users name and surname.
    I try to make such script but my skills are not enought to do it, so I ask You for help. I know that this is a piece of cake for You ;)
    Regards
    SLawek

    Hi,
    Prewritten scripts can be found in the repository here:
    https://gallery.technet.microsoft.com/scriptcenter
    If you don't find what you need and you can't write your own, you can request a script here:
    https://gallery.technet.microsoft.com/scriptcenter/site/requests
    Let us know if you have any specific questions.
    Good luck.
    Don't retire TechNet! -
    (Don't give up yet - 13,225+ strong and growing)

  • Tab bug in Pages − Some complex-script characters collapse all tabs on a line.

    This problem is somewhat serious, since it basically turns tabs into spaces on any line that contains certain very common characters in Devanagari.
    Basically, if you take the following text: "Hindi     हिन्दि     Hindi     हिन्दि" ...it will render in pages as: "Hindi हिन्दि Hindi हिन्दि"
    However, taking this text: "Handa     हन्द     Handa     हन्द" will display completely as intended.
    The culprit seems to be combining characters that move around inside a word -- in the above example, the Devanagari short "i" vowel ि  (which appears on the left side of the letter it's modifying). Another character that triggers this problem is the top-curl "r" − for example: "artha     अर्थ     artha     अर्थ" renders as "artha अर्थ artha अर्थ"
    This tab-collapsing happens immediately upon the appearance of the character on the line, and tab spacing is fully restored the moment the offending character is deleted. When "show invisibles" is turned on, the tab character is visible in all cases. Setting explicit tab-stops or changing text alignment has no effect.
    This is a pretty serious error, as it effectively prevents any use of tabs in Hindi, Marathi, and Sanskrit text. I suspect it's more pervasive than this, considering the similarity of other indic scripts.
    Is this a known issue? Can we expect a fix? I and other academics at my university already have to use Pages for all of our significant Devanagari work, given the lack of support in any other full-featured word processor on Mac OS. Having this ubiquitous formatting bug complicates things.

    These are user to user help forums, and nobody can tell you if or when Apple will fix any particular problem.  You need to report it to them using the feedback channel and/or bugreporter:
    http://www.apple.com/feedback/pages.html
    https://bugreport.apple.com
    Other major word processors with Devanagari support include Nisus Writer and OpenOffice.  I tried OO and it does not seem to have the tab problem.  Also TextEdit of course, but it has fewer features.
    PS I see this bug in 10.6 on my machine.  Did you just now discover it, or do you think it was not present in some earlier version of Pages?

  • Trying to form complex query - need help

    I have a fairly complex query that I need to join the results of to show actual and goal by day. The actuals are an aggregation of records that get put in every day, while the targets are a single entry in range format indicating an active range for which the target applies. I'm working on a query that will put things together by month and I'm running into a snag. Can someone please point out where appropriate naming needs to go to get this to come together?
    This one works:
    (select DATE_INDEX, SUM(LDS) as TTLLDS, SUM(TONS) as TTLTONS from
        (select DATE_INDEX, VEH_LOC, SUM(LDS) as LDS, SUM(WT) as TONS from
           (select c.DATE_INDEX, c.VEH_LOC, COUNT(j.LOAD_JOB_ID) as LDS,
                 CASE WHEN SUM(w.SPOT_WEIGHT) = 0 THEN SUM(j.MAN_SPOT_WT)
                      ELSE SUM(w.SPOT_WEIGHT)
                  END as WT
              from TC c, TC_LOAD_JOBS j, LOAD_RATES r, SPOT_WEIGHTS w
             where c.TC_ID = j.TC_ID and j.LOAD_RATE_ID = r.LOAD_RATE_ID
               and c.DATE_INDEX = w.DATE_INDEX and j.LOAD_RATE_ID = w.LOAD_RATE_ID
               and c.VEH_LOC in (select ORG_ID from ORG_ENTITIES where MNG_ORG_ID = 200)
               and c.DATE_INDEX between to_date('08/01/2010','MM/DD/YYYY') and to_date('07/31/2011','MM/DD/YYYY')
             group by c.DATE_INDEX, c.VEH_LOC
            union
            select c.DATE_INDEX, c.VEH_LOC, COUNT(j.JOB_ID) as LDS,
                 DECODE(SUM(j.AVG_SPOT_WEIGHT),0,SUM(r.BID_TONS),SUM(j.AVG_SPOT_WEIGHT)) as WT
              from TC_3RDPARTY c, TC_3RDPARTY_JOBS j, LOAD_RATES r
             where c.TC_ID = j.TC_ID and j.LOAD_RATE_ID = r.LOAD_RATE_ID
               and c.DATE_INDEX between to_date('08/01/2010','MM/DD/YYYY') and to_date('07/31/2011','MM/DD/YYYY')
               and j.FACTORY_ID in (select ORG_ID from ORG_ENTITIES where MNG_ORG_ID = 200)
             group by c.DATE_INDEX, c.VEH_LOC)
          group by DATE_INDEX, VEH_LOC)
      group by DATE_INDEX)Now I need to add in the following query:
    select (u.MACH_TPH_D+u.MACH_TPH_N)/2 as MTPH_TGT, (u.LABOR_TPH_D+u.LABOR_TPH_N)/2 as LTPH_TGT
         from UTIL_TARGET_LOADERS u
        where u.ORG_ID in (select ORG_ID from ORG_ENTITIES where MNG_ORG_ID = 200)The join needs to be based on VEH_LOC and DAY in the form:
       ... WHERE u.ORG_ID = x.VEH_LOC
              AND x.DATE_INDEX between u.START_DATE and NVL(u.END_DATE,sysdate)I had one that worked just fine when only one entity was involved; the complication arises in that this is a division-level report so I have to individually resolve the subordinates and their goals before I can aggregate. This is one of two queries I need to tie together using a WITH clause so I can pivot the whole thing and present it in month-by-month fashion. When I try to tie it together like the query below, I get: invalid relational operator.
    select ttls.DATE_INDEX, SUM(ttls.LDS) as TTLLDS, SUM(ttls.TONS) as TTLTONS, u.TARGET_LTPH, u.TARGET_MTPH
      from UTIL_TARGET_LOADERS u,
        (select DATE_INDEX, VEH_LOC, SUM(LDS) as LDS, SUM(WT) as TONS from
           (select c.DATE_INDEX, c.VEH_LOC, COUNT(j.LOAD_JOB_ID) as LDS,
                 CASE WHEN SUM(w.SPOT_WEIGHT) = 0 THEN SUM(j.MAN_SPOT_WT)
                      ELSE SUM(w.SPOT_WEIGHT)
                  END as WT
              from TC c, TC_LOAD_JOBS j, LOAD_RATES r, SPOT_WEIGHTS w
             where c.TC_ID = j.TC_ID and j.LOAD_RATE_ID = r.LOAD_RATE_ID
               and c.DATE_INDEX = w.DATE_INDEX and j.LOAD_RATE_ID = w.LOAD_RATE_ID
               and c.VEH_LOC in (select ORG_ID from ORG_ENTITIES where MNG_ORG_ID = 200)
               and c.DATE_INDEX between to_date('08/01/2010','MM/DD/YYYY') and to_date('07/31/2011','MM/DD/YYYY')
             group by c.DATE_INDEX, c.VEH_LOC
            union
            select c.DATE_INDEX, c.VEH_LOC, COUNT(j.JOB_ID) as LDS,
                 DECODE(SUM(j.AVG_SPOT_WEIGHT),0,SUM(r.BID_TONS),SUM(j.AVG_SPOT_WEIGHT)) as WT
              from TC_3RDPARTY c, TC_3RDPARTY_JOBS j, LOAD_RATES r
             where c.TC_ID = j.TC_ID and j.LOAD_RATE_ID = r.LOAD_RATE_ID
               and c.DATE_INDEX between to_date('08/01/2010','MM/DD/YYYY') and to_date('07/31/2011','MM/DD/YYYY')
               and j.FACTORY_ID in (select ORG_ID from ORG_ENTITIES where MNG_ORG_ID = 200)
             group by c.DATE_INDEX, c.VEH_LOC)
          group by DATE_INDEX, VEH_LOC) ttls
        where ttls.DATE_INDEX beween u.START_DATE and NVL(u.END_DATE,sysdate)
          and ttls.VEH_LOC = u.ORG_ID
      group by ttls.DATE_INDEXI know this is a nested mess, as it has to grab the production from two tables for a range of VEH_LOC values and sum and aggregate by day and VEH_LOC, then I have to try and match that to the targets based on VEH_LOC and day. My final query is to aggregate the whole mess of sums and averages by month.
    I'd appreciate it if someone can point me in the right direction.

    Figured it out.
    select ttl.DATE_INDEX, SUM(ttl.LDS) as TTLLDS, SUM(ttl.TONS) as TTLTONS,
         AVG((u.MACH_TPH_D+u.MACH_TPH_N)/2) as MTPH_TGT,
         AVG((u.LABOR_TPH_D+u.LABOR_TPH_N)/2) as LTPH_TGT
      from
        (select DATE_INDEX, VEH_LOC, SUM(LDS) as LDS, SUM(WT) as TONS from
           (select c.DATE_INDEX, c.VEH_LOC, COUNT(j.LOAD_JOB_ID) as LDS,
                 CASE WHEN SUM(w.SPOT_WEIGHT) = 0 THEN SUM(j.MAN_SPOT_WT)
                      ELSE SUM(w.SPOT_WEIGHT)
                  END as WT
              from TC c, TC_LOAD_JOBS j, LOAD_RATES r, SPOT_WEIGHTS w
             where c.TC_ID = j.TC_ID and j.LOAD_RATE_ID = r.LOAD_RATE_ID
               and c.DATE_INDEX = w.DATE_INDEX and j.LOAD_RATE_ID = w.LOAD_RATE_ID
               and c.VEH_LOC in (select ORG_ID from ORG_ENTITIES where MNG_ORG_ID = 200)
               and c.DATE_INDEX between to_date('08/01/2010','MM/DD/YYYY') and to_date('07/31/2011','MM/DD/YYYY')
             group by c.DATE_INDEX, c.VEH_LOC
            union
            select c.DATE_INDEX, c.VEH_LOC, COUNT(j.JOB_ID) as LDS,
                 DECODE(SUM(j.AVG_SPOT_WEIGHT),0,SUM(r.BID_TONS),SUM(j.AVG_SPOT_WEIGHT)) as WT
              from TC_3RDPARTY c, TC_3RDPARTY_JOBS j, LOAD_RATES r
             where c.TC_ID = j.TC_ID and j.LOAD_RATE_ID = r.LOAD_RATE_ID
               and c.DATE_INDEX between to_date('08/01/2010','MM/DD/YYYY') and to_date('07/31/2011','MM/DD/YYYY')
               and j.FACTORY_ID in (select ORG_ID from ORG_ENTITIES where MNG_ORG_ID = 200)
             group by c.DATE_INDEX, c.VEH_LOC)
          group by DATE_INDEX, VEH_LOC) ttl, UTIL_TARGET_LOADERS u
      where u.ORG_ID = ttl.VEH_LOC
        and ttl.DATE_INDEX between u.START_DATE and NVL(U.END_DATE,sysdate)
      group by ttl.DATE_INDEX, (u.LABOR_TPH_D+u.LABOR_TPH_N)/2

  • JPA: Complex query needed to load object / special processing on store

    I have what I think is a tricky situation with an ORM scenario, and I am wondering what I need to do to get JPA to work with this situation:
    I have a table that looks like:
    key_with_rev_id INTEGER (sequence based, unique pk)
    key_id INTEGER (sequence based)
    rev_id INTEGER (sequence based, with key_id forms unique index)
    del_flag VC(1)
    + various data fields
    The object would contain these attributes (preferably):
    key_id (as the "unique" id)
    max_rev_id (transient, defaults to null)
    + various data attributes
    When I load it -- for max_rev_id = null, it should basically do this:
    select <data fields> from revved_table
    where key_id = <object.key_id>
    and rev_id = (select max(rev_id) from revved_table where key_id = <object.key_id>)
    and del_flag is null or del_flag = 'N'
    The query is a little more complex when max_rev_id is not null, but same idea.
    Now then -- when I store the object, whether it is to insert or update, I want it to always insert rows, with the key_with_rev_id and rev_id values from the corresponding sequences. (On insert, it will also use another seq to populate key_id). When I delete, I also want to insert a new row, but set del_flag = 'Y'
    Is this too complex for JPA such that it would be a huge hassle, or is there an elegant way to set this up?
    My apologies for any unusual terminology in the above -- I am quite new to JPA.
    Thanks,
    ken clark

    Does anyone have any suggestions as to where to start looking?
    Thanks,
    ken

  • Help in profiling a complex application needed

    Hi,
    I have a rather complex, general, problem here I would like to solve using
    dtrace so any hint, advise, similar experience etc would be more than
    welcome.
    Basically, my company has created a complex database system for acquisition
    and management of reference stock market data and the process has several
    phases (this is my understanding of it): acquire the data from
    e.g. Bloomberg in their native format, transforms it in some universal
    format and then use that format to load it into a database where it can be
    analysed, processed etc using more or less (in house developed) standard
    SQL with calendar extensions (e.g every Friday, last Monday in month etc
    etc). There are several processes (servers) involved: data server,
    scheduler, database server etc etc.
    Now, when we have installed the product at one of our customers (running
    E6500 with 24CPUs and 20GB of RAM, all that on Solaris 8 --I think), our
    product was given a two hours window every day to do a certain amount of
    work and to process several GBs of data (don't have the figures) and
    everything was fine, since we were able to finish that in 90 minutes. But
    now, as the amount of data within database grows (although still within
    preallocated 80 or 100GB size -- split into 2GB files to work around (ex)
    large file problem), for the same amount of work the product in question
    needs something like 180 minutes -- which is 1 hour too much.
    My task is to try to find out where the bottleneck is and to give some
    suggestions for speeding things up. The customer claims that the
    application is I/O bound and prstat -m more or less confirms that (almost
    no CPU latency, large amount of voluntary context switches etc etc).
    How do I confirm this using dtrace? I can't run dtrace on their production
    system since it's Solaris 8 but I have set up a Solaris 10 (s10_60)
    machine that has all the components installed and will try to run similar
    kind of work there.
    Where do I start? What shall I look for? The problem is also that there is
    a lot of programs involved, a lot of IPC (shared memory, semaphores, pipes,
    sockets) and in general when the system is busy, it is quite busy.
    I guess in ideal world, we would call Sun and ask them to figure the
    problem themselves, but it is not an ideal world and the golden age of .com
    is gone :-(
    Thanks and bye, Dragan

    Where do I start? What shall I look for? The problem
    is also that there is
    a lot of programs involved, a lot of IPC (shared
    memory, semaphores, pipes,
    sockets) and in general when the system is busy, it is
    quite busy.Well, this is definitely the hard part. DTrace makes it much easier to ask questions of the system, but you're asking "what questions do I ask?" There are lots of valid ways to go about this, but I often start by by looking at how the physical resources on the system are being used: CPU, I/O, networking and so on. For starters, squeeze all of the idle out of the system: as long as there is idle in the system, you're obviously not going as fast as you could. You want to start asking questions like "why am I doing I/O?" or "why am I coming off CPU?" If you could post some mpstat/vmstat/iostat data, perhaps we could provide some more concrete directions...
    - Bryan
    Bryan Cantrill, Solaris Kernel Development. http://blogs.sun.com/bmc

Maybe you are looking for