SQL: How to get the maximum value of loans

I have to display cod_acct_no, amt_disbursed, bal_book in table LOAN_MAST and maximum version of table LOAN_SCHEDULE CTR_STAGE_NO amt_instal. in other words; amt_instal of the most ctr_stage_no of table LOAN_SCHEDULE to display with the other value of LOAN_MAST column.

You could help me pls.

Data from these two tables are provided below:

Main table ready
INSERT INTO loan_mast
VALUES
('00057110000431  ',2000000,1010605.39)
/
INSERT INTO loan_mast
VALUES
('00057110000291  ',3500000,1212038.57)
/
INSERT INTO loan_mast
VALUES
('00057110000450  ',2000000,1179199.79)
/
INSERT INTO loan_mast
VALUES
('00057010001457  ',2000000,1555836.32)
/
INSERT INTO loan_mast
VALUES
('00057010001650  ',9500000,8060419.1)
/
INSERT INTO loan_mast
VALUES
('00057110050065  ',2000000,1742388.45)
/
INSERT INTO loan_mast
VALUES
('00057010001947  ',2000000,1933540.07)
/
INSERT INTO loan_mast
VALUES
('00057110050213  ',2000000,1978588.06)
/
INSERT INTO loan_mast
VALUES
('00037010001104  ',6175000,3241694.48)
/
INSERT INTO loan_mast
VALUES
('00037010001766  ',12000000,11715781.01)
/
INSERT INTO loan_mast
VALUES
('00037300050025  ',7500000,7472981.78)
/
INSERT INTO loan_mast
VALUES
('00037210000694  ',6500000,6588648.16)
/
INSERT INTO loan_mast
VALUES
('00017210000087  ',5000000,4105246.38)
/
INSERT INTO loan_mast
VALUES
('00017210000129  ',5000000,3478303.49)
/
INSERT INTO loan_mast
VALUES
('00017210000141  ',5000000,3685293.79)
/
INSERT INTO loan_mast
VALUES
('00017210000246  ',5000000,4029883.61)
/
INSERT INTO loan_mast
VALUES
('00017210000268  ',5000000,4499322.1)
/
INSERT INTO loan_mast
VALUES
('00017210000322  ',5000000,4966885.32)
/
INSERT INTO loan_mast
VALUES
('00017300050014  ',7000000,6625970.85)
/
INSERT INTO loan_mast
VALUES
('00017300050036  ',5700000,5687617.61)
/
INSERT INTO loan_mast
VALUES
('00017300050047  ',7500000,7527560)
/
INSERT INTO loan_mast
VALUES
('00017240000050  ',4300000,4300000)
/
INSERT INTO loan_mast
VALUES
('00017210000449  ',7000000,7000000)
/
INSERT INTO loan_mast
VALUES
('03017180001733  ',500000,335164.83)
/
INSERT INTO loan_mast
VALUES
('01117110050071  ',700000,625123.9)
/
INSERT INTO loan_mast
VALUES
('01077300050011  ',1500000,1447149.08)
/
INSERT INTO loan_mast
VALUES
('00927180002119  ',500000,441488.25)
/
INSERT INTO loan_mast
VALUES
('01507150051043  ',700000,633340.47)
/
INSERT INTO loan_mast
VALUES
('03317290050040  ',300000,273601.45)
/
INSERT INTO loan_mast
VALUES
('01027150051360  ',200000,179240.42)
/
INSERT INTO loan_mast
VALUES
('01067150052782  ',300000,270794.1)
/
INSERT INTO loan_mast
VALUES
('01137110050082  ',2000000,1786359.87)
/
INSERT INTO loan_mast
VALUES
('01107150050610  ',200000,191399.56)
/
INSERT INTO loan_mast
VALUES
('01117150051071  ',300000,271560.17)
/
INSERT INTO loan_mast
VALUES
('01017210001052  ',6800000,6609837.58)
/
INSERT INTO loan_mast
VALUES
('01157010001078  ',450000,425069.61)
/
INSERT INTO loan_mast
VALUES
('00017180001173  ',700000,484447.94)
/
INSERT INTO loan_mast
VALUES
('09997120004696  ',93099,64369.52)
/
INSERT INTO loan_mast
VALUES
('01067010001654  ',285000,255579.7)
/
INSERT INTO loan_mast
VALUES
('01017210001063  ',7000000,6930746)
/
INSERT INTO loan_mast
VALUES
('01017210001105  ',7000000,6934246)
/
INSERT INTO loan_mast
VALUES
('01017210001138  ',7000000,7000000)
/
INSERT INTO loan_mast
VALUES
('01017210001116  ',7000000,7000000)
/
INSERT INTO loan_mast
VALUES
('01017210001161  ',7000000,7000000)
/
INSERT INTO loan_mast
VALUES
('01017210001150  ',7000000,7000000)
/
INSERT INTO loan_mast
VALUES
('01017210001127  ',7000000,6930746)
/
INSERT INTO loan_mast
VALUES
('00067110050043  ',700000,602416.77)
/
INSERT INTO loan_mast
VALUES
('01147150052362  ',200000,178682.78)
/
INSERT INTO loan_mast
VALUES
('01167150051647  ',75000,60057.01)
/
INSERT INTO loan_mast
VALUES
('01017150053252  ',150000,125205.66)
/
INSERT INTO loan_mast
VALUES
('00917150050232  ',100000,91972.04)
/
INSERT INTO loan_mast
VALUES
('01017180003081  ',990000,663015.26)
/
INSERT INTO loan_mast
VALUES
('09997220000893  ',154160,138665.08)
/
INSERT INTO loan_mast
VALUES
('01017210000955  ',5000000,4510523.32)
/
INSERT INTO loan_mast
VALUES
('00087150001049  ',1000000,904601.41)
/
INSERT INTO loan_mast
VALUES
('01107010000288  ',300000,268703.55)
/
INSERT INTO loan_mast
VALUES
('00087150001038  ',1000000,906085.9)
/
INSERT INTO loan_mast
VALUES
('01107010000277  ',200000,184905.75)
/
INSERT INTO loan_mast
VALUES
('00017080050030  ',500000,450047.42)
/
INSERT INTO loan_mast
VALUES
('00037210000533  ',4000000,3346908.17)
/
INSERT INTO loan_mast
VALUES
('01117180000631  ',990000,712874.67)
/
INSERT INTO loan_mast
VALUES
('02007180001216  ',990000,792437.11)
/
INSERT INTO loan_mast
VALUES
('01957180000928  ',400000,320317.9)
/
INSERT INTO loan_mast
VALUES
('00037210000544  ',600000,518404.4)
/
INSERT INTO loan_mast
VALUES
('01117110050060  ',1000000,893034.07)
/
INSERT INTO loan_mast
VALUES
('00037180001877  ',800000,640405)
/
INSERT INTO loan_mast
VALUES
('01047150052651  ',320000,288850.72)
/
INSERT INTO loan_mast
VALUES
('01027160050103  ',100000,79915.86)
/
INSERT INTO loan_mast
VALUES
('01067150052759  ',150000,129601.15)
/
INSERT INTO loan_mast
VALUES
('01057150051287  ',800000,723681.12)
/
INSERT INTO loan_mast
VALUES
('03317290050021  ',400000,359312.25)
/
INSERT INTO loan_mast
VALUES
('01157150051316  ',500000,452300.73)
/
INSERT INTO loan_mast
VALUES
('00037150050598  ',700000,633221.03)
/
INSERT INTO loan_mast
VALUES
('01047150052673  ',150000,129610.95)
/
INSERT INTO loan_mast
VALUES
('01147150052384  ',400000,361840.54)
/
INSERT INTO loan_mast
VALUES
('01067150052802  ',150000,130840.94)
/
INSERT INTO loan_mast
VALUES
('01157150051338  ',300000,259202.22)
/
INSERT INTO loan_mast
VALUES
('01057150051307  ',400000,361840.54)
/
INSERT INTO loan_mast
VALUES
('00017110050160  ',500000,397640.38)
/
INSERT INTO loan_mast
VALUES
('01077150050910  ',100000,79915.86)
/
INSERT INTO loan_mast
VALUES
('00057150050702  ',400000,360841.83)
/
INSERT INTO loan_mast
VALUES
('01017150053271  ',150000,119955.86)
/
INSERT INTO loan_mast
VALUES
('01057150051329  ',400000,360029.85)
/
INSERT INTO loan_mast
VALUES
('01067150002665  ',500000,452300.73)
/
INSERT INTO loan_mast
VALUES
('01077150050921  ',250000,225526.17)
/
INSERT INTO loan_mast
VALUES
('00047150050693  ',200000,160494.64)
/
INSERT INTO loan_mast
VALUES
('01077080050026  ',100000,91150.55)
/
INSERT INTO loan_mast
VALUES
('01017150053293  ',150000,129675.2)
/
INSERT INTO loan_mast
VALUES
('09997040001950  ',2500000,2439161.01)
/
INSERT INTO loan_mast
VALUES
('09997120004685  ',75000,51855.74)
/
Table of loan from schedule+:
INSERT INTO loan_schedule
VALUES
('00017080050030  ',1,12426.29)
/
INSERT INTO loan_schedule
VALUES
('00017110050160  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('00017110050160  ',2,17702.2)
/
INSERT INTO loan_schedule
VALUES
('00017180001173  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('00017180001173  ',2,35116.22)
/
INSERT INTO loan_schedule
VALUES
('00037150050598  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('00037150050598  ',2,18158.39)
/
INSERT INTO loan_schedule
VALUES
('00037180001877  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('00037180001877  ',2,29122.98)
/
INSERT INTO loan_schedule
VALUES
('00037210000533  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('00037210000533  ',2,144609.59)
/
INSERT INTO loan_schedule
VALUES
('00037210000544  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('00037210000544  ',2,17625)
/
INSERT INTO loan_schedule
VALUES
('00047150050693  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('00047150050693  ',2,7331.21)
/
INSERT INTO loan_schedule
VALUES
('00057150050702  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('00057150050702  ',2,10157.38)
/
INSERT INTO loan_schedule
VALUES
('00067110050043  ',1,20017.91)
/
INSERT INTO loan_schedule
VALUES
('00087150001038  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('00087150001038  ',2,25940.56)
/
INSERT INTO loan_schedule
VALUES
('00087150001049  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('00087150001049  ',2,25940.56)
/
INSERT INTO loan_schedule
VALUES
('00917150050232  ',1,2937.5)
/
INSERT INTO loan_schedule
VALUES
('00927180002119  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('00927180002119  ',2,25083.02)
/
INSERT INTO loan_schedule
VALUES
('01017150053252  ',1,5422.86)
/
INSERT INTO loan_schedule
VALUES
('01017150053271  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('01017150053271  ',2,5422.86)
/
INSERT INTO loan_schedule
VALUES
('01017150053293  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('01017150053293  ',2,4406.25)
/
INSERT INTO loan_schedule
VALUES
('01017180003081  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('01017180003081  ',2,49664.37)
/
INSERT INTO loan_schedule
VALUES
('01017210000955  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('01017210000955  ',2,126967.14)
/
INSERT INTO loan_schedule
VALUES
('01027150051360  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('01027150051360  ',2,5980.03)
/
INSERT INTO loan_schedule
VALUES
('01027160050103  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('01027160050103  ',2,3615.24)
/
INSERT INTO loan_schedule
VALUES
('01047150052651  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('01047150052651  ',2,8125.9)
/
INSERT INTO loan_schedule
VALUES
('01047150052673  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('01047150052673  ',2,4406.25)
/
INSERT INTO loan_schedule
VALUES
('01057150051287  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('01057150051287  ',2,20752.45)
/
INSERT INTO loan_schedule
VALUES
('01057150051307  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('01057150051307  ',2,10376.23)
/
INSERT INTO loan_schedule
VALUES
('01057150051329  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('01057150051329  ',2,11960.05)
/
INSERT INTO loan_schedule
VALUES
('01067010001654  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('01067010001654  ',2,6855.16)
/
INSERT INTO loan_schedule
VALUES
('01067150002665  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('01067150002665  ',2,12970.28)
/
INSERT INTO loan_schedule
VALUES
('01067150052759  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('01067150052759  ',2,4406.25)
/
INSERT INTO loan_schedule
VALUES
('01067150052782  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('01067150052782  ',2,7618.03)
/
INSERT INTO loan_schedule
VALUES
('01067150052802  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('01067150052802  ',2,5422.86)
/
INSERT INTO loan_schedule
VALUES
('01077080050026  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('01077080050026  ',2,2485.26)
/
INSERT INTO loan_schedule
VALUES
('01077150050910  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('01077150050910  ',2,3615.24)
/
INSERT INTO loan_schedule
VALUES
('01077150050921  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('01077150050921  ',2,6348.36)
/
INSERT INTO loan_schedule
VALUES
('01077300050011  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('01077300050011  ',2,23289.97)
/
INSERT INTO loan_schedule
VALUES
('01107010000277  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('01107010000277  ',2,4550.62)
/
INSERT INTO loan_schedule
VALUES
('01107010000288  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('01107010000288  ',2,7215.96)
/
INSERT INTO loan_schedule
VALUES
('01107150050610  ',1,5188.12)
/
INSERT INTO loan_schedule
VALUES
('01117110050060  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('01117110050060  ',2,23528.29)
/
INSERT INTO loan_schedule
VALUES
('01117110050071  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('01117110050071  ',2,16469.8)
/
INSERT INTO loan_schedule
VALUES
('01117150051071  ',1,7782.17)
/
INSERT INTO loan_schedule
VALUES
('01117180000631  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('01117180000631  ',2,49664.37)
/
INSERT INTO loan_schedule
VALUES
('01137110050082  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('01137110050082  ',2,47056.57)
/
INSERT INTO loan_schedule
VALUES
('01147150052362  ',1,5875)
/
INSERT INTO loan_schedule
VALUES
('01147150052384  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('01147150052384  ',2,10376.23)
/
INSERT INTO loan_schedule
VALUES
('01157010001078  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('01157010001078  ',2,10764.62)
/
INSERT INTO loan_schedule
VALUES
('01157150051316  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('01157150051316  ',2,12970.28)
/
INSERT INTO loan_schedule
VALUES
('01157150051338  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('01157150051338  ',2,8812.5)
/
INSERT INTO loan_schedule
VALUES
('01167150051647  ',1,2711.43)
/
INSERT INTO loan_schedule
VALUES
('01507150051043  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('01507150051043  ',2,18158.39)
/
INSERT INTO loan_schedule
VALUES
('01957180000928  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('01957180000928  ',2,14561.49)
/
INSERT INTO loan_schedule
VALUES
('02007180001216  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('02007180001216  ',2,36039.68)
/
INSERT INTO loan_schedule
VALUES
('03017180001733  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('03017180001733  ',2,25083.02)
/
INSERT INTO loan_schedule
VALUES
('03317290050021  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('03317290050021  ',2,9833.81)
/
INSERT INTO loan_schedule
VALUES
('03317290050040  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('03317290050040  ',2,7375.36)
/
INSERT INTO loan_schedule
VALUES
('09997040001950  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('09997040001950  ',2,13864.94)
/
INSERT INTO loan_schedule
VALUES
('09997120004685  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('09997120004685  ',2,3495.59)
/
INSERT INTO loan_schedule
VALUES
('09997120004696  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('09997120004696  ',2,4339.15)
/
INSERT INTO loan_schedule
VALUES
('09997220000893  ',1,0)
/
INSERT INTO loan_schedule
VALUES
('09997220000893  ',2,3429.21)
/
Kind regards

Yamen

Hello

When there is a WHERE clause, it always comes after the FROM clause. (Joints and their conditions are part of the FROM clause).
Try this:

WITH     got_rnum    AS
(
     SELECT     cod_acct_no
     ,     amt_instal
     ,     ROW_NUMBER () OVER ( PARTITION BY  cod_acct_no
                               ORDER BY          ctr_stage_no       DESC
                       ) AS rnum
     FROM    loan_schedule
)
SELECT     m.cod_acct_no, m.amt_disbursed, m.bal_book
,     r.amt_instal             AS high_amt_instal
FROM     loan_mast     m
JOIN     got_rnum     r     ON     r.cod_acct_no     = m.cod_acct_no
                    AND     r.rnum          = 1
WHERE   m.cod_acct_stat = '8' ----------[this is condition is newly added to apply the same in production to fetch desired record]
;

Tags: Database

Similar Questions

  • Persistent for the subtraction of the background image collection (how to get the maximum value of each pixel in a series of images IMAQ)

    Hi all

    I have a system of LabVIEW which takes advantage IMAQ tools and features of the Vision Development Module.  A useful feature that I put in place is to be able to take a snapshot of the video stream and then subtract this single image among the subsequent images.

    What I want to do is to collect a series of images instead of one, and then create a unique image of these frameworks is just the maximum value of pixels in each pixel (a bit like a display persistent).

    It would probably be very easy to be implemented by converting the image to a table and then by doing math number on the table and then turning into an image, but I hope that someone here may know how to use the IMAQ/VDM tools to do this in a way more compact.

    Thank you very much

    MK

    How about using Max comparison IMAQ operation?

  • How to choose the maximum value in a column of a table by using the cursor and iteration

    Hello everyone
    I have a table loan_detail
    and a column inside loan_amount
    now I want to take the values in this table with the cursor, then using iteration that I want to take a max value of him using this slider
    Here is my table
    LOAN_AMOUNT
    
    100
    200
    300
    400
    500
    5600
    700
    I could make using the concepts of single loop, but when I tried to do by using the slider I wasn't able to do.
    Concerning
    Prost

    You can get the maximum value for a particular column in SQL, PLSQL needn't; Always avoid PLSQL so you can do it in SQL. But always as an example:

    declare
    number of Temp: = 0;
    Start
    for news in some loan_amt of loan_detail
    loop
    If (temp
    end if;
    end loop;
    dbms_output.put_line (temp);
    end;

    Edited by: Mahanam January 5, 2011 03:11

  • How to get the maximum number of iterations in the property of TS

    I was put the loopType from one step to the count of success/failure. For example "stop after 1 iterations pass or a maximum of 3 iterations. The maximum iteration is 3. What my qustion is how to get the maximum iteration of TS property by codes of trial during the race. Thank you very much!

    Corey Chen

    The OPPO test developer

    Hello

    It may be a hack, but RunState.Step.LoopWhileExpression has information.  It will return a string like: "RunState.LoopIndex."< 69="" &&="" runstate.loopnumpassed=""><>

  • How to get the maximum number of days in a month?

    How to get the maximum number of days in a month?

    I use a dateField. where I can get the month. Now, I want to get the maximum number of days in a month.

    How can I get it?

    Please help me. and thanks in advance... []

    NET. RIM. Device.API.util
    Class DateTimeUtilities

    getNumberOfDaysInMonth (int month, int year)
    Returns the number of days in the specified month

    It took me like 10 seconds to find it in the API, I guess you spent more time writing the post...

  • How to get the decimal value of a string of international currency

    Hi all

    How to get the decimal values to a string of international currency.

    Finally, we get to the real problem.

    You can use location functions or write your own using string functions already mentioned...

    http://developer.BlackBerry.com/native/documentation/Cascades/device_platform/internationalization/

  • DVT:pivotFilterBar - how to get the selected values of the filter

    Hi all

    I have a question: how to get the selected values from the pivot table filter bar programmatically?

    I tried to use
    pivotTable.getDataModel().getDataAccess().getValueQDR(startRow, startCol, DataAccess.QDR_WITH_PAGE);
    but to the edge of the side DATA INCORRECTESdeclarations page, it seems that it will return the cached values.

    Environment: JDev 11.1.1.3.0 without tasks.

    Thank you
    Miroslaw

    Hello

    You can retrieve the value selected in the PivotFilterBar through the PivotFilterBar model, instead of dataaccess:

    Download the template of the bar pivot filter instance
    QueryDescriptior queryDescriptor = (QueryDescriptor) pivotFilterBar.getValue ();

    retrieve a list of criterion, each of them is used to fill each lov in the pivot filter bar
    ConjunctionCriterion conjunctionCriterion = queryDescriptor.getConjunctionCriterion ();
    List criterionList = conjunctionCriterion.getCriterionList ();
    for (int i = 0; i)<_criterionList.size(); i++)="">
    AttributeCriterion = (AttributeCriterion) criterionList.get (i) criterion.

    _selected is the currently selected value
    Selected object = criterion.getValues () .get (0);

    System.out.println (_selected);
    }

    Hope that helps,
    Chadwick

  • How to get the RGB value of a pixel in a psd document using scripting Photoshop

    Hi, guys!    Does anyone know how to get the RGB value of a pixel in a psd document using scripts in Photoshop?  I myself have missed for a long time and could not resolve. I am very happy to hear your voice as soon as possible!

    Here is an example...

    var originalUnits = app.preferences.rulerUnits;
    app.preferences.rulerUnits = Units.PIXELS;
    var doc = activeDocument;
    var Colour1 = GetHexColour(eyeDropperRGB(1,doc.height-1));
    var Colour2 = GetHexColour(eyeDropperRGB(20,doc.height-5));
    var Colour3 = GetHexColour(eyeDropperRGB(40,doc.height-14));
    alert("Colour 1 = " +Colour1 + "\rColour 2 = " +Colour2 + "\rColour 3 = " +Colour3);
    var decColour = eyeDropperRGB(40,doc.height-14);
    alert("Red = " +decColour[0] + "\rGreen = " +decColour[1] + "\rBlue = " +decColour[2]);
    app.preferences.rulerUnits = originalUnits;
    function GetHexColour(reqHex){
    var out='';
    for(No in colours = reqHex){
     out = out.concat(zeroPad(d2h(reqHex[No]),2));
     }
    return out;
    };
    function eyeDropperRGB(x,y) {
     var x2 = x + 1;
     var y2 = y + 1;
     var out = new Array(3);
     activeDocument.selection.select([[x,y], [x2,y], [x2,y2], [x, y2]], SelectionType.REPLACE, 0, false);
     for(ch in list = ["Red", "Green", "Blue"]) {
     histogram = activeDocument.channels[list[ch]].histogram;
      for (i = 0; i <= 255; i++) {
       if (histogram[i]) {
        out[ch] = i;
        break;
       }
      }
     }
      return out;
    };
    function d2h(d) {return d.toString(16);}
    function zeroPad(n, s) {
       n = n.toString();
       while (n.length < s)  n = '0' + n;
       return n;
    };
    
  • How to get the return value from Java runtime.getRuntime.exec?

    I am running shell from a (GR 11, 2) Oracle database commands on aix.
    But, I would get a return value of a shell comand... as you get with "echo $?"

    I use a code like
    CREATE OR REPLACE JAVA SOURCE NAMED common."Host" AS
    import java.io.*;
    public class Host {
      public static int executeCommand(String command) {
        int retval=0;
        try {
            String[] finalCommand;
            finalCommand = new String[3];
            finalCommand[0] = "/bin/sh";
            finalCommand[1] = "-c";
            finalCommand[2] = command;
    
          final Process pr = Runtime.getRuntime().exec(finalCommand);
          pr.waitFor();
    }
       catch (Exception ex) {
          System.out.println(ex.getLocalizedMessage());
          retval=-1;
        }
        return retval;
    };
    /
    but I do not get a return value... because I don't know how to get the return value...

    Published by: user9158455 on 22-Sep-2010 07:33

    Hello

    Your pr.exitValue () has tried?

    I think you also need a finally block that destroys the sub-process

    Concerning
    Peter

  • How to get the greatest value of the width and/or height of two open images?

    Re: Photoshop CS6, worm 13.0.1 (x 32) on Win 7 SP1 (64-bit) 16 GB of RAM

    My Photoshop workflow processes repeatedly changing the games of two images of an irregularly shaped object, centered on a white background. After completing the changes, each canvas needs to be cropped, then the two resizing to square canvas of the same size.

    The question I have is the last step: How can I determine the largest single dimension to use as the px width, height px square open two images?

    The following script seems to work, but I don't know if I correctly selects active documents. Is app.activeDocument = app.documents [0] always the document being edited? And app.activeDocument = app.documents [1] no active document!

    I am a programmer of VBA/VB.Net with no experience in Javascript. I'd greatly appreciate some expert opinions on what follows, my first attempt at a Photoshop script.

    #target photoshop
    < menu > automate < / menu >
    Save the current configuration
    var savedRuler = app.preferences.rulerUnits;
    app.preferences.rulerUnits = Units.PIXELS;
    whole white background
    var backgroundC = new SolidColor();
    backgroundC.rgb.red = 255;
    backgroundC.rgb.green = 255;
    backgroundC.rgb.blue = 255;
    backgroundColor = backgroundC;
    get the maximum size of the first image
    app.activeDocument = app.documents [0] / / the value first image
    var h = app.activeDocument.height;
    var l = app.activeDocument.width;
    var maxDim = w;
    if(h>w) maxDim = h;
    measure the second image and then get the two images max dimension
    app.activeDocument = app.documents [1] / / for the second image
    H2 var = app.activeDocument.height;
    W2 var = app.activeDocument.width;
    if(W2>maxDim) maxDim = w2;
    if(H2>maxDim) maxDim = h2;
    resize image second
    app.activeDocument.resizeCanvas (maxDim, maxDim, AnchorPosition.MIDDLECENTER);
    resize the image first
    app.activeDocument = app.documents [0] / / the value first image
    app.activeDocument.resizeCanvas (maxDim, maxDim, AnchorPosition.MIDDLECENTER);
    clean
    app.preferences.rulerUnits = savedRuler;

    Try this

    #target photoshop
    //save the current setting
    var savedRuler= app.preferences.rulerUnits;
    var orig_display_dialogs = app.displayDialogs;
    app.preferences.rulerUnits = Units.PIXELS;
    app.displayDialogs = DialogModes.NO; // Set Dialogs off
    
    var defaultFolder = "~";
    var inputFolder = Folder.selectDialog("Choose a folder of images to process.", defaultFolder);
    var outputFolder = Folder.selectDialog("Choose a folder to export resized images to.", defaultFolder);
    
    var fileList = inputFolder.getFiles(/\.(nef|cr2|crw|dcs|raf|arw|orf|dng|jpg|jpe|jpeg|tif|tiff|psd|eps|png|bmp)$/i);
    if (fileList.length%2===0) { // even number of files
      // Loop through files
      for (var i = 0; i < fileList.length; i++) {
    
         app.open(fileList[i]); // Open First
         app.activeDocument.trim(TrimType.TOPLEFT);
         app.activeDocument.resizeImage(null,null,1200,ResampleMethod.NONE);
         var h = app.activeDocument.height;
         var w = app.activeDocument.width;
    
         i++;
         app.open(fileList[i]); // open second
         app.activeDocument.trim(TrimType.TOPLEFT);
         app.activeDocument.resizeImage(null,null,1200,ResampleMethod.NONE);
         var h1 = app.activeDocument.height;
         var w1 = app.activeDocument.width;
    
         var maxDim = Math.max (Math.max (w, w1), Math.max (h, h1)) +10;
    
         app.activeDocument.resizeCanvas (maxDim, maxDim, AnchorPosition.MIDDLECENTER); //resize
         // save second and close
         if (app.activeDocument.name.lastIndexOf(".")!=0 ) { var Name = app.activeDocument.name.substring(0, app.activeDocument.name.lastIndexOf(".")); }
         else {var Name =  app.activeDocument.name;}
         var saveFile = outputFolder + "/" + Name ;
         SaveAsJPEG(saveFile, 10);
         activeDocument.close(SaveOptions.DONOTSAVECHANGES);     // Close the just save 
    
         app.activeDocument.resizeCanvas (maxDim, maxDim, AnchorPosition.MIDDLECENTER); //resize
         // save and close First
         if (app.activeDocument.name.lastIndexOf(".")!=0 ) { var Name = app.activeDocument.name.substring(0, app.activeDocument.name.lastIndexOf(".")); }
         else {var Name =  app.activeDocument.name;}
         var saveFile = outputFolder + "/" + Name ;
         SaveAsJPEG(saveFile, 10);
         activeDocument.close(SaveOptions.DONOTSAVECHANGES);     // Close the just save
         }
      }
    else { alert("Odd Number of Files");}
    
    //clean up
    app.displayDialogs = orig_display_dialogs; // Reset display dialogs
    app.preferences.rulerUnits = savedRuler;
    ////////////////////////////////////////////////////////////////////////////////////////////////////////
    
    function SaveAsJPEG(saveFile, jpegQuality){
      var doc = activeDocument;
      if (doc.bitsPerChannel != BitsPerChannelType.EIGHT) doc.bitsPerChannel = BitsPerChannelType.EIGHT;
      jpgSaveOptions = new JPEGSaveOptions();
      jpgSaveOptions.embedColorProfile = true;
      jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
      jpgSaveOptions.matte = MatteType.NONE;
      jpgSaveOptions.quality = jpegQuality;
      activeDocument.saveAs(File(saveFile+".jpg"), jpgSaveOptions, true,Extension.LOWERCASE);
    }
    
  • How to get the fnd_profile.value in the host program

    Hi all

    How to get the FND_PROFILE. VALUE('ORG_ID') in the host program.

    I loved not below, but it failed.

    v_return =' $ORACLE_HOME/bin/sqlplus - s $FCP_LOGIN < < END

    set pagesize 0

    trigger the echo

    fnd_profile. Value ('ORG_ID');

    EXIT;

    END '

    echo $v_return

    but it error with the message: Retrun value SP-0734: unknown command beginning "fnd_profile...". »

    Kind regards

    UVA

    > but it error with the message: Retrun value SP-0734: unknown command beginning "fnd_profile...". »

    .. .who is the same thing that will happen if you run SQL * more and type "fnd_profile.value...". »

    Assuming that fnd_profile.value is a function, you must select from the something (say double) or assign to a variable.

  • How to get the peak value

    Can I know how to get the 2 peak values v1 and v2 and 2 duration times t1 t2.

    Since there is a small amplitude noise, difficult to use the Max simplely.

    May need to use a filter such as wavelets or TREE to Denoise it first. Can I know how to use, any Toolbox in labview. How do the curve smooth first.

    Thank you.

    I can't watch your vi now (I'm at work), but if your signals are long enough, you might consider a median filter.  You can set the number of points before and after use.  I found that it is useful for some smoothing problems (not all).

  • How to get the parameter values of a step type custom when I create file and adding a type of step seq

    I use lv 8.5 and teststand 4.0.

    I did a step type custom and recorded at the MyTypes.ini in pallets of type.

    I specified a default module by opening the properties of the custom step of *.ini type window, then I put some values of the parameters.

    T1) when I open teststand and I add the custom step type manaully in seq file, the labview module parameter values are represented.

    But, if to use file (create and add support prototype stage), the labview module parameter values has the default value.

    Using joint file, how to get the setting custom step type values I put in *.ini?

    Q2) each type of step are automatically by name through the use of LoadTypePaletteFilesEx. When I open teststand and I add the custom step type manaully in seq file, the module is loaded automatically. Inside the attachment, I use a prototype of charge and a fixed path where the module labview is to load the labview module.

    Can I load module automatically without using a prototype of charge or how can I get a dynamic path of type step?

    I solved Q1 for myself by using the mapping tab of the parameter within the configuration to the default module window.

    Everyone knows Q2?

    Thank you.

  • How to set the maximum value of the slide in run mode

    Hello

    I have a number of files to process, the files are going to be covered in the runtime. I want to use a slider that controls a single in the process at some point file. As the total number of files cannot be pre-be determined, I wonder how I can configure the maximum value of the slider when running (after I know how many files in the pool).

    Any help will be greatly appreciated.

    JACIE

    Right-click on the property and select change writing.  Now you can wire a constant to the property node.

  • How to get the lov value(true/false) that is running by pressing the F3 function key

    Hello

    I mapped key F3 function for list of values (lov), pressing F3 on the element of text (with associated lov) poster lov, but here the lov is implicitly run, so I am unable to get the value of lov(true/false), how to get the true or false value from the lov.

    I use Oracle forms 11 GR 2.

    What exactly do you mean by "the true or false value of the lov? Want to know if the user chose something from the lov. If so, you can create a KEY-LISTVAL-trigger on your textitem with something like

    IF SHOW_LOV('THE_NAME_OF_THE_LOV') THEN
      -- do something here
    END IF;
    

Maybe you are looking for

  • OSX does not boot sequence make

    Hello I have a MBP 15 "(early 2011). I7 2.2 GHz, 16 GB at 1333 MHz DDR3 RAM and it runs OSX El Capitan 10.11.3 Version. A few years ago I have moved the "old" SATA HDD to DVD Bay using an adaptation set and installed an SSD as drive system (and added

  • Loop in Skype

    Get out me of this loop P L E A S E:-Windows Live Messenger connection / "a newer version is available" / Download latest version / "information Skype: previous installation is not complete." Reboot to complete before running Skype set up "/ reboot /

  • my system restore does not work, nothing is changed

    I have vista home premium and my system restore does not work no matter how, I try

  • resizing a window

    When I resize a window and reposition it on the desktop, the system does not, remember the size and position. How to save the settings. I thought it was automatic in Windows.

  • Can I alphabetize list of Windows mail contacts?

    With Windows Mail, when I create mail and click on the button 'To' my contacts do not appear in alphabetical order. Can contacts, when listed here, classified in alphabetical order to save me time?