Populate field1 in table, based on dropdown value of a field2 in same row

Hi Experts,
I have created an offline interactive Adobe form and need help with java-script on events. I will describe my scenario below -
I have written an SE38 report program which will generate the PDF. To pre-populate fields in the PDF, I have a structure Default_Values which has a few internal tables. One of the internal tables Employees has 2 fields Emp_Code and Emp_Name. I have written code to obtain a list of employees and populate this internal table Empoyees. I call the Adobe form and along with other parameters, pass this structure Default_Values. Thus all the default values along with the internal table Employees pre-populated with the Employee Code and Employee Names have been passed to the Context.
In the Adobe form I have a table with 10 lines with Employee details (6 columns, 2 of which are Emp_Code and Emp_Name)
In this table control, the column Employee Name is a drop down list. For this column, under List Items, I have created a binding to the internal table Employees with default values. This binding Items looks like this - $record.DEFAULT_VALUES.EMPLOYEES.DATA[*] with Item Text and Item Value having the value EMP_NAME.
When I test the form, I can see all the Employee Names in the drop down list in the column Employee Name of the table control.
My requirement is that when a user selects an Employee Name from the drop-down list, the field Emp_Code for that row in the table control should be automatically populated with the corresponding value of Emp_Code  depending on the Emp_Name which the user has selected.
I am new to Java-scripts and Adobe forms. I have searched this and other forums, however I couldn't find the right code which I can place in either the Change or Exit event of the drop-down to accomplish this.
Can someone please provide me with sample code to achieve this.
Any help will be greatly appreciated.
Thanks in advance.
Regards,
Neha

Hi Neha,
I would prefer not to use FormCalc for this requirement.
Array Processing shall be done in Java Scripting and you simply cannot have two different scripting language elements in the same scripting block.
First create a table type parameter in the interface or GT_* type in Global variable and pass all the necessary entries of dropdown to the table type parameter. Once included in the context it shall be available in your data view of the form.
To access any repeating instance node of the form in the data view, use te following script -
var theFields = xfa.resolveNodes(
                  "xfa.datasets.data.data.CUSTOMERS.DATA[*].NAME");
assuming that you have a table named CUSTOMERS in the Data View.
For more details on XFA Data Model refer to
[http://help.adobe.com/en_US/livecycle/es/lcdesigner_scripting_reference.pdf]
Hope these inputs help.
Regards,
Rohit

Similar Messages

  • CAML Query to get specific item in folder based on dropdown value using Javascript client object model

    Hi,
    I am using the Javascript Client object model.
    I have a custom list and a custom document library.
    Custom list contains 2 columns - dlName , dlValue
    The document library contains 2 folders - "folder1" ,  "folder2" and contains some images.
    The image name starts with the "dlValue" available in the custom list
    I am using a visual webpart and using javascript client object model.
    I am trying to achieve the below functionality:
    1) Load a dropdown with the custom list.
    2) set the image based on the value in dropdown.
    I have achieved the first option, I have set the dropdown, but not sure how to query the folder and set the image.
    Below is the code i have used so far:
    //In Visual webpart
    <select id="ddlTest" >
    </select>
    <br/>
    <div id="PreviewLayer">
    <img id="imgPlaceHolder" runat="server" alt="Image" title="imgPlaceHolder" src=" " />
    </div>
    // In Javascript file
    function RenderHtmlOnSuccess() {
    var ddlTest = this.document.getElementById("ddlTest");
    ddlTest.options.length = 0;
    var enumerator = this.customListItems.getEnumerator();
    while (enumerator.moveNext()) {
    var currentItem = enumerator.get_current();
    var dropdownValue = currentItem.get_item("dlValue");
    ddlTest.options[ddlTest.options.length] = new Option(currentItem.get_item("dlName"), dropdownValue);
    setImage(dropdownValue); // Not sure how to query the folder and set the image based on value.
    // Also if dropdown value is changed, corresponding image should be shown
    How to query the folder and based on dropdown value, show the image? Also, how to handle the dropdown value change?
    Thanks

    Hi,
    Here are two links for your reference:
    Example of how to Get Files from a Folder using Ecmascript \ Javascript client object model in SharePoint 2010
    http://sharepointmantra.wordpress.com/2013/10/19/example-of-how-to-get-files-from-a-folder-using-ecmascript-javascript-client-object-model-in-sharepoint-2010/
    SP2010 JSOM Client Object Model: How to get all documents in libraries including all folders recursively
    http://sharepoint.stackexchange.com/questions/70185/sp2010-jsom-client-object-model-how-to-get-all-documents-in-libraries-including
    In SharePoint 2013, we can also use REST API to achieve it.
    http://msdn.microsoft.com/en-us/magazine/dn198245.aspx
    Thanks,
    Dennis Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Dennis Guo
    TechNet Community Support

  • Update a table based on Min value of a column of a Another Table.Pls Help.

    Dear All,
    Wishes,
    Actually I need update statement some thing like below scenario...
    Data in table is like below:
    I wrote a query to fetch data like below ( actually scenario is each control number can have single or multiple PO under it ) (i used rank by to find parent to tree like show of data)
    Table: T20
    Control_no        P_no  Col3
    19950021     726473     00
    19950036      731016     00
    19950072     731990     00
                     731990 01
    19950353     734732     00
                     734732 01
    19950406     736189     00
                 736588     01
                 736588     02
                 736588     03                
    Table : T30
    Control_no      P_no              col3
    19950021     726473 
    19950036     731016
    19950072     731990     
                 731990     
    19950353     734732     
                  734732     
    19950406     736189     
                  736588     
                  736588     
                   736588     
      Now requirement is I need to update Table T30's col3 (which do have values in T20 but not this table) in such a way that , It should take MIN (COL3) from T20 and then update that value to related Col3)
    Better I can explain through below new data format in T30 after update:
    After update it should like:
    Table : T30
    Control_no       P_no    col3 (this is updated column)
    19950021     726473   00  -- as this is min value for Pno 726473 belongs to Control NO 199950021 in Table T20 above
    19950036     731016   00  -- as this is min value for Pno 726473 belongs to Control NO 199950021 in Table T20 above
    19950072     731990   00  -- see here..both Pno should updated as '00' as MIN value col3 in Table T20 related to this
                 731990      00     record is '00'  (out of 00,01 it should select 00 and update that value here)
    19950353     734732      00  -- same again both Pno should updated as '00' as MIN value col3 in TableT20 related to this
                 734732      00     record is '00'  (out of 00,01 it should select 00 and update that value here)
    19950406     736189      00  -- As there is single col3 value in T20, 00 should be updated here.
                 736588      01  --  Here it should update col3 as '01' since for this pno(736588)
                 736588      01  --  Here too it should update col3 as 01 per requirement ,minimum value of this pno in T20
                 736588      01  --     same here too.. Sorry if my post formatting is not good...
    Hope i am clear in my requirement..(update T30 col3 based on min value of col3 of related records)
    Please suggest some update sql for this...(ideas would be great)
    I am using oracle 10 g version soon will be migrated to 11g..
    Regards
    Prasanth
    Edited by: Onenessboy on Oct 20, 2010 12:13 PM
    Edited by: Onenessboy on Oct 20, 2010 12:15 PM

    Onenessboy wrote:
    I am really sorry, my post so nonsense in look..
    I used to use for actuall code..
    the out put i tryped, i used [pre] , [/pre] but still does not look good..
    hmm..thanks for your suggestion hoek..
    so any ideas about my requirement...I would suggest spending a bit more time trying hoek's suggestion regarding {noformat}{noformat} tags instead of repeatedly asking for more help.
    Because to understand your requirement, people are going to have to read it first.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Inserting rows into table Based on Column Values.

    Hi,
    I am trying to inserting rows into a table based on Column.
    Id      Name        
    Data
    N 105.1.1
    http://www.example.com/New/105.1.1
    U 105.1.2               http://www.example.com/Used/105.1.2
    S 105.1.3               http://www.example.com/Sold/105.1.3
    I want a table like this. 
    I want to insert Data column value based on Id and Name Columns
    If Id = N and Name = 105.1.1 then Data value should be insert as   http://www.example.com/New/105.1.1
    If Id = U and Name = 105.1.2 then Data value should be  insert as  http://www.example.com/Used/105.1.2
    If Id = S and Name = 105.1.3 then Data value should be insert as   http://www.example.com/Sold/105.1.3
    Can you please help us to write query to insert above Data Column values based on Id and Name Columns.

    INSERT INTO tbl (col) SELECT
    CASE WHEN id='N' and Name='105.1.1 ' THEN 'http://www.example.com/New/105.1.1'
              WHEN id='U' and Name='105.1.2 ' THEN 'http://www.example.com/New/105.1.2'
    END col
    FROM anothertbl
    Sorry , cannot test it right now.
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Join  a Parent Table with 2 Child table based on a value

    Dear Guru's
    We have a Parent Table and 2 Child table . The Parent Table has a column like seqtype with only 2 possible values C and S . If the Value is C , then the details are available in Child 1 table and if the Value is S then the Details are in Child 2 table
    How can we query the Data from this type of arrangement ? I am little bit confused and hit a road block
    Will the following query will work ?
    Select
    from Parent P , Child C1, Child C2
    where P.seqtype = C1.Seqtype
    and P.seqtype = C2.Seqtype
    With Warm Regards
    ssr

    You didn't mention the column names in two child tables. Whether the columns are same in 2 tables of these are different.
    If the columns are same better to go and change your design to have only one child table. However if stiil business stops you having one table you can use UNION ALL (Assuming you want to fetch same column information from two child tables) like below:
    SELECT p.col1
          ,c1.col2
          ,c1.col3
          ,c1.col4
      FROM parent     p
          ,child      c1
    WHERE p.seqtype = c1.seqtype
    UNION ALL
    SELECT p.col1
          ,c2.col2
          ,c2.col3
          ,c2.col4
      FROM parent     p
          ,child      c2
    WHERE p.seqtype = c2.seqtype Regards
    Arun

  • Read Internal Table based on Multiple Values for Key Field

    Hi Gurus,
    i have one query can you tell me how read an internal table it_kna1 for multiple values of land1 DE US IND etc.
    i had tried as below but i could not can you try and let me knwo at the earliest.
    here i want read the values with DE or US and want further prosess them.
    REPORT  YC001.
    tables kna1.
    select-options: cust for kna1-kunnr.
    data: begin of it_kna1 occurs 0,
            kunnr like kna1-kunnr,
            name1 like kna1-name1,
            land1 like kna1-land1,
            end of it_kna1.
    select kunnr name1 land1 into table it_kna1 from kna1 where kunnr in cust.
    read table it_kna1 with key land1 = ( 'DE' OR 'US' ) .
    can anybody suggest me some solution.
    Thanks,
    Jeevi.

    This should be what you need:
    REPORT ztest NO STANDARD PAGE HEADING LINE-SIZE 80 MESSAGE-ID 00.
    TABLES kna1.
    SELECT-OPTIONS: cust FOR kna1-kunnr.
    DATA: BEGIN OF it_kna1 OCCURS 0,
            kunnr LIKE kna1-kunnr,
            name1 LIKE kna1-name1,
            land1 LIKE kna1-land1,
          END OF it_kna1.
    DATA: itab_index LIKE sy-tabix.
    SELECT kunnr name1 land1
      INTO TABLE it_kna1
      FROM kna1
      WHERE kunnr IN cust.
    SORT it_kna1 BY land1.
    READ TABLE it_kna1 WITH KEY
      land1 = 'DE'
      BINARY SEARCH.
    itab_index = sy-tabix.
    WHILE sy-subrc = 0.
      itab_index = itab_index + 1.
      WRITE: /001 it_kna1-kunnr, it_kna1-land1, it_kna1-name1.
      READ TABLE it_kna1 INDEX itab_index.
      IF it_kna1-land1 <> 'DE'.
        sy-subrc = 99.
      ENDIF.
    ENDWHILE.
    SKIP 1.
    READ TABLE it_kna1 WITH KEY
      land1 = 'US'
      BINARY SEARCH.
    itab_index = sy-tabix.
    WHILE sy-subrc = 0.
      itab_index = itab_index + 1.
      WRITE: /001 it_kna1-kunnr, it_kna1-land1, it_kna1-name1.
      READ TABLE it_kna1 INDEX itab_index.
      IF it_kna1-land1 <> 'US'.
        sy-subrc = 99.
      ENDIF.
    ENDWHILE.
    Rob

  • Binded based on dropdown values in a flowable table

    Can someone please help me with my practice form?  I am just started learning to make a fillable pdf form. I made my practice form patterned after the Purchase Order Form sample that came with livecyle installation.  I want my table to automatically display the unit price when I select an item from the dropdown list.  I managed to do that by using below script.  The problem comes in when I am adding rows my selection keeps on reverting back to the first item on the dropdown list or on my first selection on the first row. Should I add something on below script.  Please help.
    RefreshmentOrderform.RefreshmentOrder.details.detail[0].item::change - (JavaScript, client)
    unitprice.rawValue = this.boundItem(xfa.event.newText);
    unitprice.value = xfa.event.newText;

    Hi,
    The problem you are having is because the id values of the drop down are duplicated, if I choose cherry slice I get an id of 3 (which is meant to mean $3.00) but this is also the id of Ambassador (as well as Brownies and Coffee).  So similar problem with Chocolate Tarts going to Assorted Mini Cookies.
    So you need to keep the id unique.  At first I thought you should set the id to 1,2,3,4,.. and have a table lookup for the price, but I liked your idea of keeping it all in the drop down control, so if you changed the make them unique, something like 1:3.00, 2:1.50, 3:3.00, ... you could strip of the part before the colon by changing your change event code to;
    unitprice.rawValue = this.boundItem(xfa.event.newText).split(":")[1];
    Which turns the id into an array and takes the second element.
    Also, there are some run time errors in your form.  In Acrobat (or Reader) you should turn on "Show console on errors and messages", which is under Preferences ... JavaScript.
    The second line in your change event causes a runtime error as the value property of a numeric field is its default value and to correctly reference it you need to use;
      unitprice.value.oneOfChild.value
    But you don't need that line at all in this case.
    There is also a problem with the initialise script in numServiceChargerate, which looks like it is a problem moving from FormCalc in some parts of the form to JavaScript in others, I would try and stick with one or the other.
    Good luck
    Bruce

  • Input field validation in a Table based on the value of other column

    Hi all
    I have a table with 2 columns. column1 is of text view and  column2 is Input field.
    The user should not be allowed to enter a value  in the column2 ( input field) greater than the value populated in column1(textview).
    So for Eg; if the column1 is populated with value 100, The user should not be able to enter a number greater than 100 in the column2  input field.
    Please let me how this can be achieved.
    I appreciate the help.
    Thanks

    Hi,
    Let me make sure u r working with table control.
    First u have to create a event(VALIDATE) to do the validation.
    Inside the event,
    1. First get the current index where user has pointed the curson
    2. Once u get the index read the internal table with index value.
    3. Now u can compare the col1 and col2 values and populate the error message.
    1. DATA : lo_elt TYPE REF TO if_wd_context_element,
                   l_index type i.
    lo_elt = wdevent->get_context_element( name = 'CONTEXT_ELEMENT' ).
         CALL METHOD LO_ELT->GET_INDEX( RECEIVING  MY_INDEX = l_index.
    above code should be written inside the event.
    Thanks,

  • Insert values to one table based on a value inserted into another table

    Hi,
    I've got a form based off a report which creates a new project. I've added an additional process to this form to insert four new values into another table as soon as the new project is created and the PK for that project is generated. This was working last week (of course!) and now seems to not work at all. It's complaining that the PK I was getting from my first insert was null. Here is one the the statements in my process I'm trying to run:
    insert into week_group values(week_group_seq.nextval, (SELECT trunc(NEXT_DAY(SYSDATE, 'FRIDAY')) FROM dual), 0, '', :P45_PROJECT_SEQ, sysdate, :APP_USER);
    The complaint I get that it's getting null where :P45_PROJECT_SEQ should be.
    Thoughts?
    Thanks,
    Jon

    Hi Andy,
    Thanks for the tip. Those two values didn't match and I updated them so they do and I'm still getting a "cannot insert NULL..." error.
    When I turn on debug I see that I'm getting the PK and I see the value. Here's my debug output:
    0.24: ...Process "Get PK": PLSQL (AFTER_SUBMIT) declare function get_pk return varchar2 is begin for c1 in (select PROJECT_SEQ.nextval next_val from dual) loop return c1.next_val; end loop; end; begin :P45_PROJECT_SEQ := get_pk; end;
    0.25: ...Session State: Saved Item "P45_PROJECT_SEQ" New Value="252"
    0.25: ...Process "Process Row of PROJECT": DML_PROCESS_ROW (AFTER_SUBMIT) #OWNER#:PROJECT:P45_PROJECT_SEQ:PROJECT_SEQ|IUD
    0.26: ...Session State: Save "P45_PROJECT_SEQ" - saving same value: "252"
    0.26: ...Process "reset page": CLEAR_CACHE_FOR_PAGES (AFTER_SUBMIT) 45
    0.27: Nulling cache for application "120" page: 45
    0.27: ...Process "Add Week Groups": PLSQL (AFTER_SUBMIT) insert into week_group values(week_group_seq.nextval, (SELECT trunc(NEXT_DAY(SYSDATE, 'FRIDAY')) FROM dual), 0, '', :P45_PROJECT_SEQ, sysdate, :APP_USER); insert into week_group values(week_group_seq.nextval, (SELECT trunc(NEXT_DAY(SYSDATE, 'FRIDAY') +
    0.28: Encountered unhandled exception in process type PLSQL
    0.28: Show ERROR page...
    0.28: Performing rollback...
    I notice that when it runs my process "Add Week Groups" it's not displaying all of the SQL. But the SQL is fine, it's right here:
    insert into week_group values(week_group_seq.nextval, (SELECT trunc(NEXT_DAY(SYSDATE, 'FRIDAY')) FROM dual), 0, '', :P45_PROJECT_SEQ, sysdate, :APP_USER);
    Hmmm....what about the "reset page" action in the last of the 0.26 lines?
    Thanks,
    Jon

  • Create a variable in one table based on a value on another.

    I have two existing tables, say TABLE1 and TABLE2.  I need to create a key variable in TABLE2 and insert values for that  variable from TABLE1 i.e. create an explicit relationship between the tables using a key variable.  There exists a relationship
    between the tables in that for each record in TABLE1 there are 28 records in TABLE2 and the records are arranged in sequential order. So:
    TABLE1 TABLE2
    REQUIREMENT
    RECORD 1 -->
    RECORDS 1 to 28 Copy key variable from RECORD1 in TABLE1 into RECORDS 1 to 28 in TABLE2
    RECORD 2 -->
    RECORDS 29 to 56 Copy key variable from RECORD2 in TABLE1 into RECORDS 29 to 56 in TABLE2
    RECORD 3 -->
    RECORDS 57 to 84 Copy key variable from RECORD3 in TABLE1 into RECORDS 57 to 84 in TABLE2
    RECORD n--> RECORDS (n-1) * 28 + 1 to n * 28
    Copy key variable from RECORD n in TABLE1 into RECORDS (n-1) * 28 + 1 to RECORDS n * 28 in TABLE2
    Please help if you can.  I am prepared to give any additional information when asked.

    TABLE1:
    USE [LFS_APRIL_2015]
    GO
    /****** Object:  Table [dbo].[HOUSING37854]    Script Date: 04/30/2015 15:52:37 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    SET ANSI_PADDING ON
    GO
    CREATE TABLE [dbo].[HOUSING37854](
    [BatchNo] [float] NULL,
    [District] [float] NULL,
    [URBAN_RURAL] [float] NULL,
    [HHNUM] [float] NULL,
    [Cluster] [float] NULL,
    [Final_Result_Code] [float] NULL,
    [zBarcode] [float] NULL,
    [Person_NUMBER] [float] NULL,
    [HH1] [float] NULL,
    [HH2] [float] NULL,
    [HH6] [float] NULL,
    [HH4] [float] NULL,
    [HH3] [float] NULL,
    [HH5] [float] NULL,
    [HH7] [float] NULL,
    [HH8] [float] NULL,
    [HH9a] [float] NULL,
    [HH9b] [float] NULL,
    [HH9c] [float] NULL,
    [HH9d] [float] NULL,
    [HH9e] [float] NULL,
    [HH9f] [float] NULL,
    [HH9g] [float] NULL,
    [HH9h] [float] NULL,
    [HH9i] [float] NULL,
    [HH9j] [float] NULL,
    [HH9k] [float] NULL,
    [HH9l] [float] NULL,
    [HH9m] [float] NULL,
    [HH10a] [varchar](1) NULL,
    [HH10b] [varchar](1) NULL,
    [HH10c] [varchar](1) NULL,
    [ED_Number] [float] NULL
    ) ON [PRIMARY]
    GO
    SET ANSI_PADDING OFF
    GO
    TABLE2:
    USE [LFS_APRIL_2015]
    GO
    /****** Object:  Table [dbo].[LISTING37854]    Script Date: 04/30/2015 15:47:15 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[LISTING37854](
    [HL1] [float] NULL,
    [HL3] [float] NULL,
    [HL4] [float] NULL,
    [HL5] [float] NULL,
    [HL6] [float] NULL,
    [HL7] [float] NULL
    ) ON [PRIMARY]
    GO
    Essentially The Housing table, TABLE1, lists households and the Listing table, TABLE2, lists members of the household and there are always 28 lines in the Listings although most of them may be just a number since almost no household will have 28
    members.  The Listings that is jut a number will be deleted,  but to know where the listing for the next household starts I need to create the linking variable in Listings table.  The is absolutely no doubt that the relationship that I specified
    in the first post above is as specified.

  • Trying to change caption based on dropdown value

    Two elements are involved:
    Dropdown list called TransactionType - possible values are "A" "B" or "C"
    Checkbox chkVerification
    I have created the following javascript for the change event of the dropdownbox TransactionType
    form1.#subform[0].TransactionType::change - (JavaScript, client)
    if(this.rawValue == "A"){chkVerification.caption.value.text.value = "Verification A"}
    else if(this.rawValue == "B"){chkVerification.caption.value.text.value = "Verification B";}
    When I check the script syntax it comes up without any errors, but when I change the value in the drop down the caption of the checkbox never changes.
    What am I missing here?
    By using the app.alert function I think I can see that I need to trigger the script as xfa.event.newText  but the caption isn't changing.
    I've also tried this :
    form1.resolveNode("chkVerification.caption.value.#text").value = "Verification A";
    Is what I'm trying to do even possible?

    Hi Steve,
    Its a bit of an old thread already, but I am facing similar problems to what Albert was facing.
    My form is already configured to use 1)dynamic XML form as default data type and 2)Preview as Interactive form.
    The techinique I am trying to use is also xfa.resolveNode("form1.page1.cb.caption.value.#text").value = "Abc";
    However, it doesn't seem to work. On test, no code is ran after that line, which means that element could be invalid, but I've checked and it seemed ok.
    Language used is Javascript and not FormCalc too. Any idea how I can tackle this?
    Thanks!

  • Joining 3 tables based on the Value from 1 Table

    Dear Oracle Guru's
    I have a Table called Resourcemaster , which stores the details of Resources for the project , The Resources can be of 2 types either our own employees as well as Hired Developers from other consultancies. The following is the proposed Resourcemaster table structure
    Resourcemaster
    Project_id
    Resource_ID
    Resource_type (E - Employees /H - Hired)
    Resource_code
    Employeemaster
    Emp_code
    Emp_Name
    Emp_address
    Hiredresourcemaster
    Hired_code
    Hired_Name
    Hired_Address
    I need to query the resourcemaster , my result should be containing Project id, resource id , Resource type, Resource Name and Resource Address. for which the details are in the above 3 tables . How these 3 tables can be joined and the join is based on the condition, if the resource type is E then resource code = Emp_code from employee master or if the resource type is H then resource_code = Hired_code.
    I am not clear how to join them in a single query and i got stuck
    Kindly Clarify me
    With Warm Regards
    ssr

    ssr wrote:
    I have a Table called Resourcemaster , which stores the details of Resources for the project,So this table should really be called PROJECT_RESOURCES :-)
    The Resources can be of 2 types either our own employees as well as Hired Developers from other consultancies. So you have a table called RESOURCES (id [PK], code [UK?], name, address, resource_type [E or H])
    And the PROJECT_RESOURCES table is this: (project_id [FK to PROJECTS], resource_id [FK to RESOURCES])
    And by modelling your data like this, you'll also find that querying because much easier.
    Hope this helps.
    Regards,
    Rob.

  • How to retrive new logical column based on flag values in table.

    Hi,
    i have two tables in rpd
    1.file table contains the coulmns------->date,file_count,record_count,cldm_stg,cmsa_stg,archive_stg
    2.rejection table columns---------> are same as above
    both have same common columns.my requirement is publish a dashboard like:
    date | land_files count |alnd_recordscount| target_files count|target_records count|Rejection filecount|rejection record count
    These report ineed retrive from those two tables.based on flag values.taget countcomes when all stg values set to ='y'
    i.e(cldm_stg='y' and cmsa_stg='y'and archive_stg='y') if not then it will be in rejection file.
    Please give solution how to achive my output.
    nQSError: 14026] Unable to navigate requested expression: Target_record:[DAggr(FILE_CONTROL.Target_record by [ FILE_CONTROL.FILE_NAME, REJECTED_FILES.FILE_NAME, REJECTED_FILES.NO_OF_ROWS, File_landing.NO_OF_ROWS, File_landing.FILE_LOAD_DATE] SB FILE_CONTROL)]. Please fix the metadata consistency warnings. (HY000)
    Edited by: user8767586 on Jan 12, 2010 4:29 AM

    Tanks for ypur reply .only two tables are there named as above.i taken file_control as a fact table.
    and i create one new tablecalled target in bmm layer taking logical source as file_control(fact table). and iset the where clause for the new table.and i create a new measure called target_file and target_records.in where clause my query is like
    dwbidb."".AUDIT_PROD.FILE_CONTROL.ARCHIVE_STATUS = 'Y' AND dwbidb."".AUDIT_PROD.FILE_CONTROL.CMSA_STATUS = 'Y' AND dwbidb."".AUDIT_PROD.FILE_CONTROL.LND_STATUS = 'Y' AND dwbidb."".AUDIT_PROD.FILE_CONTROL.SCRIPT_STATUS = 'Y' AND dwbidb."".AUDIT_PROD.FILE_CONTROL.STG_STATUS = 'Y'
    please tell me if this is right way to achive mt report. and tell me difference between fragmentation and whereclause.for my requrement i ahve to follow which method either fragmentation or whereclause.and in rpd there are no errors and warnings.but in answers i get a follwing error
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 14026] Unable to navigate requested expression: TARGET_FILECOUNT:[DAggr(TARGET.TARGET_FILECOUNT by [ TARGET.FILE_NAME] SB TARGET)]. Please fix the metadata consistency warnings. (HY000)
    SQL Issued: SELECT TARGET.FILE_LOAD_DATE saw_0, TARGET.TARGET_FILECOUNT saw_1, TARGET.TARGET_FILECOUNT saw_2 FROM AUDIT_PROD ORDER BY saw_0.
    Please tell me to achive my report.
    Regards
    Edited by: user8767586 on Jan 12, 2010 5:21 AM
    Edited by: user8767586 on Jan 12, 2010 5:21 AM
    Edited by: user8767586 on Jan 12, 2010 5:24 AM

  • Update table based on ID reference comparing each column and value

    Hi,
    Through UI user can update any information and click save. In backend i will be receiving only ID as reference . Based on the ID value i should update multiple tables wherever i have the reference tables. Here i will not get the values or column name updated.
    I just get a ID to find which row is updated.
    I should do a comparision now. 
    I have a history table where i get the row before updation. and i get a row after updation from current data i.e. from ssdb_Railroad[This will be updated by java after updation we will get the ID inorder to update remaining tables]. Now i need to compare
    both the table column values and know which column is updated and after getting the value i should update reference tables.
    Below is the structure for comparision table , History table and Main table.
    Create table Comparision_History (
     ID   int IDENTITY(1,1) PRIMARY KEY,
     InsertUser_UpdateUser varchar(50),
     Old_ColVal  varchar(100),
     New_ColVal  varchar(100),
     TableName   varchar(100),
     [Action]     varchar(50),
     InsertDate_UpdateDate Datetime NOT NULL DEFAULT getdate()
    CREATE TABLE SSDB_Railroad_History (
        ID         int IDENTITY PRIMARY KEY,
    SCAC       varchar(4) ,
    Name       varchar(50) NOT NULL,
    RailroadID int NOT NULL UNIQUE,
    RC2Key
      varchar(50),
    NOTES      varchar(1000),
    [Action]   varchar(50),
    InsertDate_UpdateDate  Datetime NOT NULL DEFAULT getdate(),
    InsertUser_UpdateUser  varchar(50),
    CREATE TABLE SSDB_Railroad (
        ID   int IDENTITY(1,1)PRIMARY KEY,
    SCAC varchar(4) UNIQUE,
    Name varchar(50) NOT NULL,
    RailroadID int NOT NULL UNIQUE,
    RC2Key
    varchar(50),
    InsertDate Datetime NOT NULL DEFAULT getdate(),
    UpdateDate Datetime,
    InsertUser varchar(50),
    UpdateUser varchar(50)
    Here SSDB_Railroad table and History table needs to be compared and get a updated value and it should be inserted in a comparision table. as well as it should be updated in reference tables.
    Please help me with the code.
    Thanks in Advance
    Deepa

    Hi Deepa_Deepu,
    According to your description, personally, the merge function can meet your requirements. Usually, we can synchronize two tables by updating or inserting rows in a target table based on differences found in the source tables. Just as your description, when
    the value of ID and InsertDate_UpdateDate in the source table matches a value, update them in the target table. When the values does not match, the source row is inserted into the target table.
    For more information, see: using MERGE to perform UPDATE and INSERT operations on a target table by using a derived source table.
    http://msdn.microsoft.com/zh-cn/library/bb510625.aspx
    Regards,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • Update table based on values from other table

    Hi,
    I am trying to update one table based on the values of another table. Since you can't use From in update statements, how do you execute this?
    For example i have to tables, Table A and Table B. I want to update a column or columns in Table A based on another value in Table B:
    So if the column in Table B was 1 then column in Table A would be Yes, if Table B was 2, then Table A would be Yes, if Table B was 3 then Table A would be N/A and so on...
    Any help would be appreciated.
    thanks,
    scott

    SQL> select * from t1;
    ID ST
    1
    2
    3
    SQL> select * from t2;
    NO
    1
    2
    3
    4
    SQL> update t1 set status=(select decode(no,1,'Y',2,'N','NA') from t2 where t1.id=t2.no);
    3 rows updated.
    SQL> select * from t1;
    ID ST
    1 Y
    2 N
    3 NA
    Daljit Singh

Maybe you are looking for

  • Ipad mini stop working

    Ipad stopped working. It will not turn on, respond to power source, or connect to computer. I tried to resent the ipad but nothing is happening, just blank screen.I also purchesed a new cord but that wasn't the problem. What is wrong and how can I fi

  • Performance in Sun Java Communication Suite 5 between Solaris 9 and 10

    Somebody knows which is the best Operation System to deploy the Sun Java Communication Suite? in performance terms? I have and old Sun Fire 280R with two 750 Mhz Processors, 3 GB Ram, and an A1000 Storage. Thanks a lot, Andres.

  • Why is iPhoto suddenly missing from OX 10.8.5?

    I rarely use iPhoto but today I tried to open it and it is inexplicably missing from my computer. I have a MacBook Air from a couple of years ago and I'm running OX 10.8.5. I'm holding off of Mavericks until problems are resolved and my IT guy says i

  • Reg: Inforecord price

    Dear All, I have change the purchase prices for the some material. The price change succeeded, but the all effective prices were revised to 1/100 of the old prices. The effective price field does not allow the manual input. Please provide me the solu

  • Where is the constructor?

    Hi, I am going through the Swing tutorials and the first sample appication has thrown me for a loop (no pun intended.) In the following code there is an inner class to SwingApplication but why isn't there a constructor such as SwingApplication (); im