View criteria condition needs to check value in column from another VO

Hi All,
My Jdev version - 11.1.1.6
My use case is as follows-
2 view objects say EmpVO and DeptVO which have view link with deptId as the foreign key attribute. I need to show the distinct list of departments along with a column which contains the employee names separated by comma for the particular department in the corresponding row. Hence, for DeptVO I use the query as follows -
-          SELECT deptId,
-                 deptName,
-                 (SELECT listagg (empName, ',') WITHIN GROUP (ORDER BY empName)
-                            emp_names
-                    FROM EMP_TABLE emp
-                   WHERE emp.deptId = dept.deptId)
-                    emp_names
-            FROM DEPT_TABLE
This gives me the result on screen as follows -
DeptId          DeptName          EmpNames
101               HR                    emp1,emp2
102               Finance             emp3,emp4,emp5
Now, my requirement is that there should be a search on department which should also contain an LOV (with search icon) for the employee names i.e. if user selects emp4 from the LOV, department table should list the record for 102.
For this , I added an LOV on the EmpNames attribute of DeptVO (to map the values from EmpVO) and added a view criteria based on which I added a query panel on screen and the relevant partialTrigger attribute so that the department table should reflect the search results. I tried 2 options in the View Criteria of DeptVO i.e.
1. Added an Item 'EmpNames = '. WIth this, EmpNames attribute appear with Searh icon in the query panel(which is required) but it does not display the right department record bcz it tries to match exactly with values like 'emp3,emp4,emp5'
2. If I add Item 'EmpNames CONTAINS ' , EmpNames search will work from query panel i.e. if I enter the value as emp4, department 102 will be shown in the results table but there is no Search icon on the EmpNames field in query panel. The component actually becomes an inputText.
It would be of great help if you can guide on a better way to achieve this use case. Please let me know if there needs to a change in the approach or if any other details are needed.
Regards,
Ansh

Hi Timo,
Thanks for this. I have already implemented this part. Here, in the example there's an LOV on department id and form is on employee entity. However, my use case is a different one. I need to search for department which should contain a search criteria for employee in the form of LOV.
Could you suggest some possible solution?
Regards,
Ansh

Similar Messages

  • Need to check the data flow from R/3 to BW server.

    Hi BI experts,
    This query is regarding need to check the data flow from R/3 to BW server.
    As of now I have some set of reports which I would need to take up in BW. The requirement is  to go through the list of transaction codes for reports in R/3 and find out if there are already  any existing objects in BW system which I can use for these reports.
    So, can u plz help me.

    Depends what are your Tcode or Reports users run in R/3 and they want the same in BW.Then in BI Content we have Out of the box Delivered reports.You can activate those Load data and use it.
    Gimme T-codes you have I can send you Standard reports in BI or Cube you can get these from.
    ~AK

  • Need Help in Next value of column to another column

    Hi,
    I am creating view in oracle 10g in which i have 1 custom column who's value are the next value of the another column.
    E.g.
    C 1 -----C2 ------ custom-C3
    10 -------1 --------------2
    10 ------ 2 ------------- 3
    10 -------3 ------------- 3
    11 -------1 ------------- 2
    Now is there any function in oracle which gives me to generate "custom-c3"
    which gives the data for next value of column 2
    Thanks.

    Hi Frank,
    Thank you so much......its working fine in 10 g.....
    but for the last row of its coming emply or null but i want value of c2 if its last value.
    e.g
    C 1 -----C2 ------ custom-C3
    10 -------1 --------------2
    10 ------ 2 ------------- 3
    10 -------3 ------------- 3
    11 -------1 ------------- 2
    In the above the value of c1 is 10 i.e last one then value of c3 should be value of c2 i.e. 3.
    Can you use IF function?
    Thanks.
    Message was edited by:
    user650690

  • Set value in ViewObject from another ViewObject

    Hello,
    I am creating a program and have the following problem: I Have three view Objects say like: A, B and C. A is the master class and has a view link to B an C. But now I am facing the following problem. When I create a new A and then B, in B a value is automatically retrieved from A (something like a before insert trigger but then programmatically from the (specific) entity object). (There isn't a commit yet!) Then when I create a new C. I want to show the value that was calculated in B shown in C. But there can be multiples rows in B so I want only the value from B from the row that is currently selected.
    Has anybody an idea/solution to solve this?
    Thanks in advance!

    Hello,
    I have a some like problem in adf bc.
    Let me explain you what I want to do.
    I have two tables. Message and MessageProperties. Message table is connected with itself as same as Employee table of HR. Means a Message can have various child message. MessageProperties contains the message properties. A message can have various properties. I want to show the message only if it has a particular value in MessageProperties,then its properties,its child message. If its child message have the same value in MessageProperties,then it shows that. Likewise it should give me a tree structure with its all properties
    Let me explain you step by step what I have done for this.
    1> I have created a view MessageView with two entities i.e Message and MessageProp and include the value attribute of MessageProp in it.
    2> I have created the default MessagePropView from MessageProp Entity.
    3> In MessageView I have modified the query which you have given.
    4> I have created the Bind variables.
    5> I have created a view criteria and in that view criteria I have included Message_Id=:Bind_MessageId and Value=:Bind_Value.
    6> I have created an association connecting Message.Message_Id and Message.Parent_Id(1 to * cardinality) because a message can be a parent of many messages.
    7> I have created a viewlink between Message and MessageProp using Message_Id.
    8> I have created a view link between Message and Message using the association which I have created in step 6.
    9> I have created the Application Module. In that,my Data Model looks like
    ---MessagePropView2
    ---MessageView1
    ---------MessagePropView1
    ---------MessageView2
    10> Then I have created the service interface. In service interface view instances,I include these two view and select the GetByKey operation from basic operations.
    11> From View Criteria find operations I have included the view criteria which I have created in message view in step 5.
    12> Then I run the AppModuleServiceImpl.java and select the view criteria operation which I have created in step 11.
    13> There I find two bind variables i.e. Bind_MessageId and Bind_Value. I give the values there.
    But it checks whether that message Id(Bind_MessageId) which I have given have that value(Bind_Value) or not. If it has then it shows only that message along with its properties but it is not showing me its childs and their properties.
    I want to show only those child message who have the MessageProp.value as (Bind_Value).
    I hope you understand with the scenario.
    I'll be very thankful to you if any help me to do this.
    Thanks in advance.

  • Using a .bat file to use Values in Registry from another Registry

    I recently starting working in an IT Department and for years my superiors/co-workers have always had a piece of software called "cyt.exe".
    When ever I logged in someones computer as Admin, this software allowed me to log out with their username still in the log in text box. We recently upgraded a large quantity of systems to Wins7 and WinEmbedded7 and that program no longer works due to the
    registry change.
    Currently the best I could to for replicating that software function as .bat file is:
    call reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI" /v LastLoggedOnSAMUser /t REG_SZ /d "domain/username" /f
    call reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI" /v LastLoggedOnUser /t REG_SZ /d "doamain/username" /f
    pause
    When I log out, it leaves the user name and password blank which is OK but I need to take it one step further. I need the values of:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI
    "LastLoggedOnSAMUser"="domain\username"
    "LastLoggedOnUser"="domain\username"
    to match the values that are in
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\SessionData\1
    "LoggedOnSAMUser"="domain\username"
    "LoggedOnUser"="domain\username"
    Any suggestions on what I need to change in my code to manipulate the registry to match those values without having to manually input them?

    - Vegan Fanatic
    "can you fix the cyt.exe program, that would be the best option long term"
    Well the cyt.exe program hasn't been updated since 2000 (version 2.3 and 2.5 were the latest versions) so I can only assume the developer has abandoned the project. The reason why it doesn't work anymore is because of the registry change going from XP to
    Vista/Win7/Win8.
    Once I have my own batch file, it will be easier to tweak it as needed when an operating system changes then it is to rely/wait on someone else to update a very specific piece of software that only has one small purpose that has most likely been forgotten.
    As much as I would like to modify the existing program, I don't have any software I can use to re-program it and I doubt I have enough knowledge or experience to tweak it correctly.
    - Frederik Long
    "You need to experiment either with reg query / reg add or reg export / reg import. Each of these commands has inbuilt help, e.g. reg import /?."
    From what I tested, the export/import copies the file and its values and placed them where I asked it too. That is not what I need. I need the values ONLY and placed within the file I need which has a different name from the file I exported from.

  • Checking whether field-symbol from another program is assigned?

    Hi all
    I'm attempting to access a FS from another program.
    As the FS can be assigned, or unassigned within that program, how do I checked for that in my calling program?
    e.g. calling program;
    FIELD-SYMBOLS: <fs> TYPE STANDARD TABLE.
    DATA: lv_var(40) type c.
    lv_var = '(ZTGT_PROG)<read_fs>'.
    ASSIGN (lv_var) TO <fs>.   " statement might dump...

    Hi
    Go through this doc and use accordingly
    Field Symbols
    Field symbols are placeholders or symbolic names for other fields. They do not physically reserve space for a field, but point to its contents. A field symbol cam point to any data object. The data object to which a field symbol points is assigned to it after it has been declared in the program.
    Whenever you address a field symbol in a program, you are addressing the field that is assigned to the field symbol. After successful assignment, there is no difference in ABAP whether you reference the field symbol or the field itself. You must assign a field to each field symbol before you can address the latter in programs.
    Field symbols are similar to dereferenced pointers in C (that is, pointers to which the content operator * is applied). However, the only real equivalent of pointers in ABAP, that is, variables that contain a memory address (reference) and that can be used without the contents operator, are reference variables in ABAP Objects.
    All operations programmed with field symbols are applied to the field assigned to it. For example, a MOVE statement between two field symbols moves the contents of the field assigned to the first field symbol to the field assigned to the second field symbol. The field symbols themselves point to the same fields after the MOVE statement as they did before.
    You can create field symbols either without or with type specifications. If you do not specify a type, the field symbol inherits all of the technical attributes of the field assigned to it. If you do specify a type, the system checks the compatibility of the field symbol and the field you are assigning to it during the ASSIGN statement.
    Field symbols provide greater flexibility when you address data objects:
    If you want to process sections of fields, you can specify the offset and length of the field dynamically.
    You can assign one field symbol to another, which allows you to address parts of fields.
    Assignments to field symbols may extend beyond field boundaries. This allows you to address regular sequences of fields in memory efficiently.
    You can also force a field symbol to take different technical attributes from those of the field assigned to it.
    The flexibility of field symbols provides elegant solutions to certain problems. On the other hand, it does mean that errors can easily occur. Since fields are not assigned to field symbols until runtime, the effectiveness of syntax and security checks is very limited for operations involving field symbols. This can lead to runtime errors or incorrect data assignments.
    While runtime errors indicate an obvious problem, incorrect data assignments are dangerous because they can be very difficult to detect. For this reason, you should only use field symbols if you cannot achieve the same result using other ABAP statements.
    For example, you may want to process part of a string where the offset and length depend on the contents of the field. You could use field symbols in this case. However, since the MOVE statement also supports variable offset and length specifications, you should use it instead. The MOVE statement (with your own auxiliary variables if required) is much safer than using field symbols, since it cannot address memory beyond the boundary of a field. However, field symbols may improve performance in some cases.
    check the below links u will get the answers for your questions
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3860358411d1829f0000e829fbfe/content.htm
    http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/field_sy.htm
    http://searchsap.techtarget.com/tip/1,289483,sid21_gci920484,00.html
    Syntax Diagram
    FIELD-SYMBOLS
    Basic form
    FIELD-SYMBOLS <fs>.
    Extras:
    1. ... TYPE type
    2. ... TYPE REF TO cif
    3. ... TYPE REF TO DATA
    4. ... TYPE LINE OF type
    5. ... LIKE s
    6. ... LIKE LINE OF s
    7. ... TYPE tabkind
    8. ... STRUCTURE s DEFAULT wa
    The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas. See Cannot Use Untyped Field Symbols ad Cannot Use Field Symbols as Components of Classes.
    Effect
    This statement declares a symbolic field called <fs>. At runtime, you can assign a concrete field to the field symbol using ASSIGN. All operations performed with the field symbol then directly affect the field assigned to it.
    You can only use one of the additions.
    Example
    Output aircraft type from the table SFLIGHT using a field symbol:
    FIELD-SYMBOLS <PT> TYPE ANY.
    DATA SFLIGHT_WA TYPE SFLIGHT.
    ASSIGN SFLIGHT_WA-PLANETYPE TO <PT>.
    WRITE <PT>.
    Addition 1
    ... TYPE type
    Addition 2
    ... TYPE REF TO cif
    Addition 3
    ... TYPE REF TO DATA
    Addition 4
    ... TYPE LINE OF type
    Addition 5
    ... LIKE s
    Addition 6
    ... LIKE LINE OF s
    Addition 7
    ... TYPE tabkind
    Effect
    You can define the type of the field symbol using additions 2 to 7 (just as you can for FORM parameters (compare Defining the Type of Subroutine Parameters). When you use the ASSIGN statement, the system carries out the same type checks as for USING parameters of FORMs.
    This addition is not allowed in an ABAP Objects context. See Cannot Use Obsolete Casting for FIELD SYMBOLS.
    In some cases, the syntax rules that apply to Unicode programs are different than those for non-Unicode programs. See Defining Types Using STRUCTURE.
    Effect
    Assigns any (internal) field string or structure to the field symbol from the ABAP Dictionary (s). All fields of the structure can be addressed by name: <fs>-fieldname. The structured field symbol points initially to the work area wa specified after DEFAULT.
    The work area wa must be at least as long as the structure s. If s contains fields of the type I or F, wa should have the structure s or at least begin in that way, since otherwise alignment problems may occur.
    Example
    Address components of the flight bookings table SBOOK using a field symbol:
    DATA SBOOK_WA LIKE SBOOK.
    FIELD-SYMBOLS <SB> STRUCTURE SBOOK
    DEFAULT SBOOK_WA.
    WRITE: <SB>-BOOKID, <SB>-FLDATE.
    Related
    ASSIGN, DATA
    Additional help
    Declaring Field Symbols
    Reward points if useful
    Regards
    Anji

  • I need help modifying my iWeb site from another Mac than the one it was designed on:

    I did exactly as directed in the Help file "to Modify your site from another computer", but when I click on the Domain file it launches iWeb to start a new website without anything from the site I created. The Macs are a mirror image of each other with the same iWeb version 3.0.4. I am transitioning from my MacBook to my new iMac, so the laptop files were all transferred to the iMac by the Apple Store when I bought it. The only difference is that the laptop is OS 10.6.8, and the new iMac is OS 10.7.5. After the transfer of all the files at the store, I proceeded to make the website on the laptop, but now need to work on the website from my iMac...but I need help getting the file to work on the iMac.
    PLEASE HELP!
    Thanks!

    The trick that solved it for me was the last note about how to make the hidden folder appear (due to Lion OS 10.75):
    Note for OS X Lion users :
    To show the hidden Library folder in the Home Directory (Cmd-Shift-H) hold the Option (=Alt) key when choosing theGo menu in the Finder.
    Thanks!

  • I need to view the available commands and alias on my macbook. also i need to check system log history from terminal

    I think I am missing some stuff in the commands. I need it to show a list of all available to me and alias ....any suggestions?
    <Edited by Host>

    rockymountainblues,
    do you mean commands as in items in the Applications folder, or commands as in things that would be run from within Terminal? What sort of stuff do you think is missing from the commands?
    By aliases, do you mean aliases within the shell that Terminal executes?
    To check your system log history from Terminal, log in as an administrative user and go to /var/log. You should see several files with names that begin with system.log — the ones that end in .gz are inactive and compressed. The file named just system.log is the one that’s currently active.

  • Convert data values in columns to another value based on a math formula

    ISSUE:
    I have a database of emergency incidents with descriptive data and longitude and
    latitude. I would like to make a google map out of the information but unfortunately
    the X Y coordinates are projected in Florida State Plane West in feet. Google maps
    requires WGS84 longitude and latitude in decimal degrees.
    PROBLEM:
    I have written some code in Transact SQL that will convert the values. But I am at a loss as to how to do the following:
    1.) plug in the X Y values from my database using an sql SELECT statement.
    2.) apply the formula to convert from State Plane to WGS84 to these X Y values
    3.) output the results.
    In other words, I have the data and I have the formula, but I am not figuring out how to plug the data into the formula and output the results. I am missing how to tie it all together.
    CODE:
    DECLARE @Easting DECIMAL(18,10);
    --SET @Easting = CAST(I_MapX AS DECIMAL(18,10));
    DECLARE @Northing DECIMAL(18,10);
    --SET @Northing = CAST(I_MapY AS DECIMAL(18,10));
    DECLARE @m2sft DECIMAL(10,10);
    SET @m2sft = 1200.0/3937.0;
    DECLARE @N0 DECIMAL(3,2);
    SET @N0 = 0.0;
    DECLARE @E0 DECIMAL(18,11);
    SET @E0 = 656166.6666666665;
    DECLARE @S0 DECIMAL(12,5);
    SET @S0 = 2692050.5001/@m2sft;
    DECLARE @K0 DECIMAL(18,18);
    SET @K0 = 0.9999411764705882;
    DECLARE @a DECIMAL(10,2);
    SET @a = 6378137.0/@m2sft;
    DECLARE @e DECIMAL(18,17);
    SET @e = 0.0818191911198883;
    DECLARE @ePrime DECIMAL(18,17);
    SET @ePrime = 0.08208852110265381;
    DECLARE @r DECIMAL(18,10);
    SET @r = 6367449.14577/@m2sft;
    DECLARE @V0 DECIMAL(15,12);
    SET @V0 = 0.005022893948;
    DECLARE @V2 DECIMAL(15,12);
    SET @V2 = 0.000029370625;
    DECLARE @V4 DECIMAL(15,12);
    SET @V4 = 0.000000235059;
    DECLARE @V6 DECIMAL(15,12);
    SET @V6 = 0.000000002181;
    DECLARE @L0 DECIMAL(4,2);
    SET @L0 = 82.0;
    DECLARE @w DECIMAL(18,10);
    SET @w = (@Northing - @N0 + @S0)/(@k0*@r);
    DECLARE @of DECIMAL(18,10);
    SET @of = @w + (sin(@w)*cos(@w))*(@V0 + @V2*power(cos(@w),2) + @V4*power(cos(@w),4) + @V6*power(cos(@w),6));
    DECLARE @Rf DECIMAL(18,10);
    SET @Rf = @k0*@a/sqrt((1 - power(@e,2)*power(sin(@of),2)));
    DECLARE @EPrime2 DECIMAL(18,10);
    SET @EPrime2 = @Easting - @E0;
    DECLARE @Q DECIMAL(18,10);
    SET @Q = @EPrime2/@Rf;
    DECLARE @tf DECIMAL(18,10);
    SET @tf = tan(@of);
    DECLARE @nf DECIMAL(18,10);
    SET @nf = @ePrime*cos(@of);
    DECLARE @B2 DECIMAL(18,10);
    SET @B2 = -0.5 * @tf * (1 + POWER(@nf,2));
    DECLARE @B4 DECIMAL(18,10);
    SET @B4 = -1/12*(5 + 3 * POWER(@tf,2) +POWER(@nf,2) * (1-9 * POWER(@tf,2)) - 4 * POWER(@nf,4));
    DECLARE @B6 DECIMAL(18,10);
    SET @B6 = 1/360*(61 + 90*POWER(@tf,2) + 45*POWER(@tf,4) + POWER(@nf,2)*(46 - 252*POWER(@tf,2) - 90*POWER(@tf,4)));
    DECLARE @Latitude DECIMAL(18,10);
    SET @Latitude = (@of + @B2*POWER(@Q,2)*(1 + POWER(@Q,2)*(@B4 + @B6*POWER(@Q,2))))*180/(PI());
    DECLARE @B3 DECIMAL(18,10);
    SET @B3 = -1/6*(1 + 2*POWER(@tf,2) + POWER(@nf,2));
    DECLARE @B5 DECIMAL(18,10);
    SET @B5 = 1/120*(5 + 28*POWER(@tf,2) + 24*POWER(@tf,4) + POWER(@nf,2)*(6 + 8*POWER(@tf,2)));
    DECLARE @B7 DECIMAL(18,10);
    SET @B7 = -1/5040*(61 + 662*POWER(@tf,2) + 1320*POWER(@tf,4) + 720*POWER(@tf,6));
    DECLARE @L DECIMAL(18,10);
    SET @L = @Q*(1 + POWER(@Q,2)*(@B3 + POWER(@Q,2)*(@B5 + @B7*POWER(@Q,2))));
    DECLARE @Longitude DECIMAL(18,10);
    SET @Longitude = (@L0 - (@L/cos(@of))*180/(PI()))*-1;
    SELECT
    I_EventNumber
    FROM Incident
    WHERE I_tTimeDispatch > 'May 7, 2012'
    SAMPLE DATA:
    Here is some raw data in order to get you started. Please notice the MapX and MapY
    coordinates are VARCHAR because they are Florida State Plane projections. The goal is
    to take these and turn them into WGS84 longitude and latitude expressed as decimal
    degrees to be used in Google maps. NOTE: I can convert from VARCHAR to DECIMAL. I just can't figure out where to plug my database columns into the sql query to output a result.
    CREATE TABLE Incidents
    I_EventNumber VARCHAR(20)
    I_MapY VARCHAR(15)
    I_MapX VARCHAR(15)
    INSERT INTO Incident
    VALUES
    (FCW69, 0815312, 0672298)
    , (FCW70, 0833311, 0697870)
    , (FCW71, 0807747, 0699684)
    , (FCW72, 0801252, 0689469)
    , (FCW73, 0853491, 0692350)

    Here's a way to get the results, all as part of a single extensive query (this would probably be more suited for defining a VIEW, where you could join on the input table with the VIEW to incorporate the computed values.
    If you instead had a business situation where you might need to execute this logic from many different places, rewriting as a user defined function might be better.  Anyway, for the answer plus a demonstration of the power of CROSS APPLY to generate
    interim working values...
    Create_Sample_Data:
    Declare @Incident TABLE
    I_EventNumber VARCHAR(20), I_MapY VARCHAR(15), I_MapX VARCHAR(15)
    INSERT INTO @Incident
    VALUES
    ('FCW69', '0815312', '0672298')
    , ('FCW70', '0833311', '0697870')
    , ('FCW71', '0807747', '0699684')
    , ('FCW72', '0801252', '0689469')
    , ('FCW73', '0853491', '0692350') /* This insert is SQL 2008 syntax only.. do multiple inserts or a UNION for 2005 */
    AsQuery:
    Select *
    from @INCIDENT
    Cross Apply
    Select
    N0 = 0.0,
    E0 = 656166.6666666665,
    K0 = 0.9999411764705882,
    e = 0.0818191911198883,
    ePrime = 0.08208852110265381,
    V0 = 0.005022893948,
    V2 = 0.000029370625,
    V4 = 0.000000235059,
    V6 = 0.000000002181,
    L0 = 82.0,
    Easting = CAST(I_MapX AS DECIMAL(18,10)),
    Northing = CAST(I_MapY AS DECIMAL(18,10))
    ) as CAStatic
    Cross Apply
    Select m2sft = 1200.0/3937.0,
    EPrime2 = Easting - E0
    ) as CAComputed1
    Cross Apply
    Select S0 = 2692050.5001/m2sft,
    r = 6367449.14577/m2sft,
    a = 6378137.0/m2sft
    ) as CAComputed2
    Cross Apply
    Select
    w = (Northing - N0 + S0)/(k0*r)
    ) as CAComputed4
    Cross Apply
    Select
    [of] = w + (sin(w)*cos(w))*(V0 + V2*power(cos(w),2) + V4*power(cos(w),4) + V6*power(cos(w),6))
    ) as CAComputed5
    Cross Apply
    Select
    Rf = k0*a/sqrt((1 - power(e,2)*power(sin([of]),2))),
    tf = tan([of]),
    nf = ePrime*cos([of])
    ) as CAComputed6
    Cross Apply
    Select
    Q = EPrime2/Rf,
    B2 = -0.5 * tf * (1 + POWER(nf,2)),
    B4 = -1/12*(5 + 3 * POWER(tf,2) +POWER(nf,2) * (1-9 * POWER(tf,2)) - 4 * POWER(nf,4)),
    B6 = 1/360*(61 + 90*POWER(tf,2) + 45*POWER(tf,4) + POWER(nf,2)*(46 - 252*POWER(tf,2) - 90*POWER(tf,4)))
    ) as CAComputed7
    Cross Apply
    Select
    Latitude = ([of] + B2*POWER(Q,2)*(1 + POWER(Q,2)*(B4 + B6*POWER(Q,2))))*180/(PI()),
    B3 = -1/6*(1 + 2*POWER(tf,2) + POWER(nf,2)),
    B5 = 1/120*(5 + 28*POWER(tf,2) + 24*POWER(tf,4) + POWER(nf,2)*(6 + 8*POWER(tf,2))),
    B7 = -1/5040*(61 + 662*POWER(tf,2) + 1320*POWER(tf,4) + 720*POWER(tf,6))
    ) as CAComputed8
    Cross Apply
    Select
    L = Q*(1 + POWER(Q,2)*(B3 + POWER(Q,2)*(B5 + B7*POWER(Q,2))))
    ) as CAComputed9
    Cross Apply
    Select
    Longitude = (L0 - (L/cos([of]))*180/(PI()))*-1
    ) as CAComputedLatLong
    Notice that each subsequent CROSS APPLY depends on a "working value" column being defined in some previous cross apply, or the working query.  There are a few other options, such as leaving off the very last Cross Apply, and computing Longitude as part
    of the main query at the beginning, but it works either way.
    EDIT: P.S. - By the way, this query is based on the formula in the original poster's query.  My formula matches that formula, and I bet it's right (as far as the lat/long conversion), but it could be the formula for Soylent Green, and I wouldn't know any
    better... :-)

  • Inserting a db row from a form with a value passed in from another page

    We have a report (P1) on a table (T1). P1 has a link column (C), and C is the PK on T1. Clicking on a link (i.e., a row) in report P1, takes us to form (P2). P2 is used to allow the user to insert a new row into T1, with the constraint that one of the columns (X) in T1 must have the same value as X had in the linked row on P1. Also, X is a NOT NULL attribute.
    What we are doing is:
    First, passing C to P2 by setting the link name=P2_X_C and the link value=#C#
    Second, in P2, we are setting form element P2_C via a SQL statement:
    SELECT X
    FROM T1
    WHERE C = :P2_X_C
    P2 displays nicely. We set P2_C to display only, and allow the user to enter values for the other columns. The value displayed for X is not NULL and correctly matches the value from P1. However, when we hit the CREATE button on P2, we get error: ORA-01400: cannot insert NULL into "T1"."X". Unable to process row of table T1.
    APEX seems to have an "issue" with having a value in a form "set" and transmitted to the DB on INSERT.
    Any help would be greatly appreciated.

    Hi,
    1 For "Display Only" items that you are not populating directly from a database column, if you want to save the value, you have to ensure that Save Session State is set to Yes and these items are not actually submitted with the page. The same sort of thing would apply to Disabled or Read-Only items as browsers do not submit these items - though these are more tricky to deal.
    2 Passing the PK value is the most common way of identifying which record contains the values you need. Passing other values is also typical - eg, for applying filters for calendars or searches or for setting flags.
    3 For database columns, which should be based on the underlying table's data, you can use the Default Value settings - though be aware that these values do not exist in session state until the page is submitted. That's ok if you don't need to use the value anywhere else on your page
    Andy

  • Change the value of column from select and insert different

    Hi All,
    I have written a procedure where i am selecting values from some table and inserting in a new table. The code is below
    If you see the line 54 in code, you will find the combined_bu_code is is coming from one procedure and the value of BU is stored in prod.SEM_BACKLOG_LOG table. I have to check, if the combined_bu_code is coming as PWR then insert as POWER in BACKLOG_OTD_NEW table not as PWR.
    Looking for a help on this. Thanks in advance
    Regards
    Edited by: User_Apex on Jun 23, 2011 3:03 AM
    Edited by: User_Apex on Jun 23, 2011 3:53 AM

    Hi Martin,
    sorry i wrote wrong at that time
    If you see my code you will find alias of prod.SEM_BACKLOG_LOG is 'a' not 'b' and BU is coming from 'a'
    I just want a if startement to be written in this column "SMTC_OTD_CHART.get_combined_bu_code (a.BU)COMBINED_BU_CODE" that if the a.BU is PWR insert as POWER in the BACKLOG_OTD_NEW table
    Regards
    Edited by: User_Apex on Jun 23, 2011 3:02 AM

  • How to search tables and views used in the code of oracle fmb 6i from another form???

    Hii guys, this is a very interesting question and i hope that it will have ample amount of answers.
    My requirement is to know the number of tables and views and backend functions/procedures which are used in the code written in the oracle forms 6i,
    all i want is to display whole views, tables or functions/procedures which are written  in the code of a particular fmb, i do have the path of that fmb and i want to read the code and search through it's entire code for the tables/views/backend procedures/functions written in the code. So how to search through the entire code of a particular form (6i) and make it display through another form.
    I am using oracle forms 6i.
    Please help me out....
    With Regards:
    Ankit Chandra

    Here is a modified dealForm.jsp that merges the 2 steps - both symbol submission and Yahoo convert is done by it. Play with it and add your DB code to it:
    <html>
    <head><title>IPIB Database Selection</title></head>
    <body bgcolor="#DFDFFF">
    <H1><CENTER>IPIB Database Selection</CENTER></H1>
    <font size=4>
    <%@ page language="java" %>
    <%@ page import="java.net.*,java.io.*,java.util.*" %>
    <%
    String symbol = request.getParameter("symbol");
    if (symbol != null) {
    String urlString = "http://finance.yahoo.com/download/javasoft.beans?SYMBOLS=" + symbol + "&format=ab";
    try {
    URL url = new URL(urlString);
    URLConnection con = url.openConnection();
    InputStream is = con.getInputStream();
    InputStreamReader isr = new InputStreamReader(is);
    BufferedReader br = new BufferedReader(isr);
    String line = br.readLine();
    StringTokenizer tokenizer = new StringTokenizer(line,",");
    String name = tokenizer.nextToken();
    name = name.substring(1, name.length()-2);
    String price = tokenizer.nextToken();
    price = price.substring(1, price.length()-2);
    %>
    <p>
    Original line from yahoo <%= line %>
    </p> <p>
    Name: <%= name %>
    </p> <p>
    Price: <%= price %>
    </p> <p>
    Pub DB processing code from dealLoad.jsp here
    </p>
    <%
    } catch (IOException exception) {
    System.err.println("IOException: " + exception);
    } else { %>
    <form action="dealForm.jsp"method="GET">
    <p>Enter Symbol: <input size="20" name="symbol">
    <inputtype="submit" value="Submit">
    </p></form>
    <% } %>
    </font>
    </body>
    </html>

  • How to get the value of column from previous row to current row?

    Hi All,
    I am facing a critical problem in SQL query (for reporting purpose (COGNOS)). please reply to my query.
    REQUIREMENT: i want to retrive value of a column (this is not a table column, this will be calculated based expression) from previous row to current row.
    EXAMPLE:
    TABLE NAME: i have to join multiple tables. so, i am not mentioning table names here.
    DISPLAY COLUMNS in the report: item, loc, sku, beginval (not table column), endval (not table column, this will calculated based on some expressions), etc. Here, first time the value of BEGINVAL will be taken from some x column name of x table. ENDVAL will calculated based on the expression. For the next row onwards, BEGINVAL will become the value of ENDVAL and the value of ENDVAL will be calculated based on the expression and this expression uses the value of BEGINVAL.
    my report will look like below.
    ITEM LOC SKU BEGINVAL ENDVAL
    1 HYD 1-HYD 10 10+1+2 (13)
    2 HYD 2-HYD 13 13+1+2 (16)
    3 SEC 3-SEC 16 16+1+2 (19)
    4 SEC 4-SEC 19 19+1+2 (22)
    etc....
    in the above output, BEGINVAL and ENDVAL columns are not part of any table. they are alias column names.if you observe intially BEGINVAL will be assigned to some value, but from subsequent rows, BEGINVAL will become the ENDVAL of previous row.
    Please help me on how to write this query?

    Hi, please find the detail description of the problom.
    DDL (table scripts)
    ITEM
    CREATE TABLE ITEM
    ITEM VARCHAR2(50 CHAR) NOT NULL,
    DESCR VARCHAR2(50 CHAR) DEFAULT ' ' NOT NULL,
    UOM           VARCHAR2(50 CHAR)
    SKU
    CREATE TABLE SKU
    ITEM VARCHAR2(50 CHAR) NOT NULL,
    LOC VARCHAR2(50 CHAR) NOT NULL,
    OH float
    SKUPROJSTATIC
    CREATE TABLE SKUPROJSTATIC
    ITEM VARCHAR2(50 CHAR) NOT NULL,
    LOC VARCHAR2(50 CHAR) NOT NULL,
    STARTDATE DATE
    VehicleLoad
    CREATE TABLE VEHICLELOAD
    LOADID VARCHAR2(50 CHAR) NOT NULL,
    DESCR VARCHAR2(50 CHAR) DEFAULT ' ' NOT NULL,
    SHIPDATE DATE DEFAULT TO_DATE('01/01/1970','MM/DD/YYYY') NOT NULL,
    ARRIVDATE      DATE
    VEHICLELOADLINE
    CREATE TABLE VEHICLELOADLINE
    LOADID VARCHAR2(50 CHAR) NOT NULL,
    ITEM VARCHAR2(50 CHAR) NOT NULL,
    QTY float(126)
    DML scripts
    I can't provide the the DML scripts, because its very huge data.
    Main QUERY is below.
    below is the query which i have to write and execute.
    select
    i.item,
    i.descr,
    i.unitsperpallet,
    sp.loc,
    sp.startdate,
    'Crucial_IND',
    LAG (EndBal,1,0) OVER (ORDER BY STARTDATE) BeginBal,
    SP.FCSTCUSTORDERS CustOrders,
    SP.COMMITINTRANSOUT,
    SP.RECARRIV,
    SP.TOTINTRANSIN,
    (BeginBal - sp.FCSTCUSTORDERS - sp.COMMITINTRANSOUT + sp.TOTINTRANSIN ) EndBal,
    'CuttingQty',
    VLL.QTY,
    vl.source,
    vl.arrivdate,
    vl.shipdate,
    vl.loadid,
    s.oh
    from item i, skuprojstatic sp, sku s, VehicleLoad vl, VehicleLoadLine vll
    where sp.item = i.item
    and s.item=i.item
    and sp.item =s.item (+)
    and sp.loc = s.loc (+)
    and vll.item = s.item
    and vll.loadid = vl.loadid
    and to_char(sp.startdate ,'mm/dd/yyyy') = to_char(vl.arrivdate,'mm/dd/yyyy')
    and sp.loc = vl.dest (+)
    order by sp.startdate
    problem description: in the above query, BeginBal and EndBal is what i am looking for. when i execute this query, oracle throwing an error saying that alias names can't be used as expressions. For the first row, the BeginBal should be the value sku.OH and for the subsequent rows, this value will be the previous row value of EndBal.

  • Retrieving numeric values of a column from another table..

    Hi there, so i have the following query that returns a label and a value from a database table:
    select key_field,value_field from table1 where some_id = 'id1' and key_field is not null;
    This will return a result in which the key_field may or may not be numeric, which is fine:
    key_field | value_field
    2 | street
    6 | dog
    car | mazda
    5 | tea
    1 | unknown
    I have another table table_num_vals where the value for those numeric fields are stored:
    key_field | display_field
    2 | address
    6 | animal
    5 | drink
    I want to be able to return the non-numeric fields as they were, all numeric fields translated if it can be found, and if not then leave the original number, desired result:
    key_field  | value_field
    address | street
    animal | dog
    car | mazda
    drink | tea
    1 | unknown
    I tried doing the following:
    select display_field from table_num_vals where key_field in (
        with numericCol as (
            select key_field from table1 where some_id = 'id1' and key_field is not null;
        ) select case when regexp_like(key_field,'^[[:digit:]]') then key_field else '' end from numericCol
    It gives me the labels for the ids that it can find.. (address, animal, drink) but then I can't seem to put it all together with the original query.. could someone please help?
    Thanks in advance,

    Yes you are right .. Thank you so much
    I let it work using
    select student_ID, Level from Student where Level ='Graduate'
    But when i run different kind of form to Graduate_Student table and try to create a new row , I cant see the Student_ID  !  I see it only if I use Form using SQL but this one doesn't add/delete/update record.
    I am new to oracle apex, sorry for that.

  • Passing field values to form from another form

    Hi,
    I have multiple detail table for a master table. The master table is project table and the details tables are all related to the project table. In the portal forms we cannot have a form based on multiple child tables. So I am trying to enter one detail table at a time. I have created a master-detail table based on project table and a detail table (cost table). After I enter data in this MD form I want to carry the projectid to another form based on another detail table (resource table) on the next page. I want to navigate to this next form by clicking on a next button after I have entered data on the previous MD form.
    The projectid is a hidden field in the first MD form and is generated by a database sequence. I understood that there is many ways to send field values to a form:-
    1. By creating a moduleid link on the next button. This link will have the projectid value
    2. By calling the form from a PL/SQL procedure on the CALL/GO of the first MD form.
    I am not sure how to get the 'projectid' value generated from the sequence and pass it to the link or a procedure. Will the projectid value be stored in the session ? How do I get it ?
    Is the above way of entering multiple detail tables feasable ? Please advice.

    Hi,
    I have multiple detail table for a master table. The master table is project table and the details tables are all related to the project table. In the portal forms we cannot have a form based on multiple child tables. So I am trying to enter one detail table at a time. I have created a master-detail table based on project table and a detail table (cost table). After I enter data in this MD form I want to carry the projectid to another form based on another detail table (resource table) on the next page. I want to navigate to this next form by clicking on a next button after I have entered data on the previous MD form.
    The projectid is a hidden field in the first MD form and is generated by a database sequence. I understood that there is many ways to send field values to a form:-
    1. By creating a moduleid link on the next button. This link will have the projectid value
    2. By calling the form from a PL/SQL procedure on the CALL/GO of the first MD form.
    I am not sure how to get the 'projectid' value generated from the sequence and pass it to the link or a procedure. Will the projectid value be stored in the session ? How do I get it ?
    Is the above way of entering multiple detail tables feasable ? Please advice.

Maybe you are looking for

  • Permission problems with external hard drive

    Hello there, I'm writting you from Paris but my french is just not good enough to really explain my problem. I'm no computer expert so i might not use the right name for stuff but i will try to be as clear as possible. I have a macbook pro 13" from e

  • Using Apple TV for the first time: STUMPED

    Hi there I bought an apple tv (with the cords) recently and have tried to set it up. I basically just plugged it into the tv using the HDMI cable and have put the tv on the correct input but nothing shows.. or happens.. Is there a button i am suppose

  • Error in converting Spool to HTML format.

    Hi Gurus, I am reading SPool and converting that into HTML formt. Please do find below code for the same. Submit report to convert the spool to HTML format   SUBMIT rspolst2 EXPORTING LIST TO MEMORY AND RETURN   WITH rqident = p_spoolno.   CALL FUNCT

  • New Rows in WAD with Free text characteristic

    I have created an input ready query and one of the characteristic (based on InfoObject 0POSTXT) created is to enter a free text for the given row.  In row selection there are also few more characteristics with master data already created. If I use BE

  • Airport Extreme Utility Disc is not compatible with OS 10.. help please

    I recently purchased the Airport Extreme (model A1301)  (second hand)  to use with my new imac. I didnt realise till I tried to set it up that the disc that comes with it to install the airport utility isnt compatible with OS 10.8.3 version that I am