Linking multiple tables and Trying to insert records into Detail

Hello,
I have been struggling with this one for years...
Work Order, Employee Labor, and Materials.  I then create a group headers using the Location field from the Work Order table.  I then create another Group, suppress the group name, and insert several fields from the Work Order table (work order number, wo description, status and completion date into Group 2 section.  Multiple rows of info are displayed.  I then enter some Employee Labor fields from the Labor table into the Details section (employee name, labor hours, pay rate, etc.).  I get several lines of employee labor transaction information grouped below each row of work order info from the Group 2 section.  So far, so good.
Now I attempt to bring a field into the Details section from the 3rd table (Materials).  The moment I introduce the record, the rows of employee labor are duplicated over and over.  In fact, there are multiple duplicate labor transaction rows (over and over).
What am I doing wrong???  I've tried every combination of Linking Order that I can think of...  I need help.
Please reply.
ps.  Let me know if I need to attach a screen shot.
Thank you
Robert

hi Robert,
this is a common issue when you add several details tables to a report. once you add the fields, then the sql generated will include those parent tables and you get a multiplier of records.
my recommendation to you would be to use a subreport for the materials table instead.
go to the Insert menu, choose Subreport and create a new subreport using the Wizard then add your current connection but this time only add the materials table. in the Linking tab, choose your Work order and then add the subreport to the Work order group header. now in the subreport add some fields from your materials table onto the subreport canvas.
what this is essentially doing is a subquery to the database and returning all associated materials records based on a filter for the work order.
the main report should not include any materials records and you can also remove this table from the database expert for the main report.
i hope this helps,
jamie

Similar Messages

  • Insert records into an Access

    I am trying to insert records into an Access document but
    when trying to execute the action page I get the following:
    Error Executing Database Query.
    [Macromedia][SequeLink JDBC Driver][ODBC
    Socket][Microsoft][ODBC Microsoft Access Driver] Too few
    parameters. Expected 1.
    The error occurred in
    C:\ColdFusion8\wwwroot\ASK\AskAction.cfm: line 17
    15 :
    16 :
    17 : values ('#trim(form.qname)#', '#trim(form.email)#',
    #DateVariable2#, #Val(form.Mathques)#, '#(form.quest)#')
    18 :
    19 : </cfquery>
    SQLSTATE 07002
    SQL insert into table1 (qname,
    email,qdate,recipient,question) values ('bill', '[email protected]',
    13-Oct-08, 0, '45x9 ')
    VENDORERRORCODE -3010
    DATASOURCE ques
    Resources:
    Check the ColdFusion documentation to verify that you are
    using the correct syntax.
    Search the Knowledge Base to find a solution to your problem.
    Browser Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0;
    SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.04506;
    InfoPath.2)
    Remote Address 0:0:0:0:0:0:0:1
    Referrer
    http://localhost:8500/ask/ASKform.cfm
    Date/Time 13-Oct-08 09:07 PM
    Stack Trace (click to expand)
    thanks,
    Steve

    what are your data types for the recipient and qdate columns?
    - you could try putting quotes around the date object, i always
    forget if they're needed or not with date objects

  • Using Crystal 2008 to insert records into a table

    Hi,
    We have a unique need to use Crystal to insert records into a table. We have managed to test a report that can write into a temporary table.  This is done by using sql command object  and uses  the following code :
    INSERT INTO TEMP_TABLE  (ORDERID)
    VALUES ({?orderid})   (-- where orderid a parameter).
    This test report asks for an order id and then inserts the record perfectly fine.
    Now moving on to the real report - This report basically prints orders in batches and we want to insert order id into a temporary table to ensure we don't print orders that were already printed. To do this we created a sub report "insert orders" that has the above insert command. The main report passes the orderid to subreport and the idea is that the subreport would insert each time an order is passed. So if main report printed 50 orders ids, the then it would do 50 inserts individually into the temp table. 
    This however is NOT working. The report runs fine but there is no insert.  Our hunch is that  Crystal is not committing after every order id is passed from the main report.  Not sure if we can set the AUTO COMMIT ON  as a default somewhere?
    Wondering if any one has attempted this or has any insights?
    Regards,
    Mohit.
    Environment is - Crystal 2008 and Oracle 11GR2, we are using Oracle drivers (and not odbc)

    Hmmm... I don't use Oracle but the syntax looks good...
    You've already tested it and I assume that you are using the same driver in the production report as you used in the test, so that shouldn't be an issue...
    how are you pulling the data? Is the final SELECT statement that pulls the report data in the same command as the INSERT script, or is the INSERT script in it's own command?
    The reason I ask... If you are trying to pass a multi-valued parameter to a command, it won't work. If you have the insert command as it's own command while the data is being pulled with linked tables or a separate command, it is possible that the report itself will execute as expected w/o passing a value to the insert script.
    If it's all in 1 command (as it should be), a bad parameter would fail in the final SELECT causing an error.
    Also... are rows null or empty string values being added to table when the report executes? This would be an indication that the command is being executed but isn't getting the parameter value.
    Jason

  • Exception while trying to insert data into Target Table

    Hi ,
    Im trying pick data from a table A which is in DB1 and trying to insert table B which is in DB2 .Below are the steps which I did.But im getting the exception
    *"Caused By: java.sql.SQLSyntaxErrorException: ORA-02019: connection description for remote database not found:"* .Can some one help me with this .
    Note : The DB that im using is Oracle 10g Express Edition and ODI studio is ODI 11.1.1.5.0
    1.Created a two Data Server -one for each Data base (DB1 and DB2)
    2.Created two Physical Schema under the respective Data Server
    3.Created two Logical Schema referring respective Physical Schema
    4.Created a two Models for each Logical schema and did Reverse Engineer
    5.Created an Interface , imported the Knowledge models and did the mapping between the Source and Target Data Source
    KM's used :
    Source data store-Staging Area-LKM Oracle to Oracle (DBLink)
    Target Properies-IKM Oracle Incremental Update
    I unchecked Stagin Area Different from Target .
    Thanks
    John

    Hi John,
    I think you need to create public database link then create public synonym
    After creating that, please check it from DB side it is working or not, then check from ODi end and go thru below URL hope this will helps you.
    https://forums.oracle.com/forums/thread.jspa?threadID=530074
    Thanks,
    Phani

  • Problem - Inserting Records into Hashed Tables

    Help for an ABAP Newbie...
    How do I insert records into a hashed table?
    I am trying the following, but get the error message,
    *You cannot use explicit or implicit index operations with types "HASHED TABLE" or "ANY TABLE".  "LT_UNIQUE_NAME_KEYS" has the type "HASHED TABLE".
    TYPES: BEGIN OF idline,
        id TYPE i,
        END OF idline.
      DATA: lt_unique_name_keys TYPE HASHED TABLE OF idline WITH UNIQUE KEY id,
            ls_unique_name_key LIKE LINE OF lt_unique_name_keys.
    " Create a record and attempt to insert it into the internal table.
    " Why does this cause a compilation error message?
    ls_unique_name_key-id = 1.
      INSERT ls_unique_name_key INTO lt_unique_name_keys.
    Thanks,
    Walter

    INSERT ls_unique_name_key INTO TABLE lt_unique_name_keys.

  • Can BO Enterprize SDK inserts records into user table

    From Infostore can we create a jsp script using Java SDK to inserts records into user table??
    Thanks
    Amar

    Hi Amar,
    I want to retrieve data/records from Infostore and insert into a user table using JSP script. Is it possible to do this?
    Infostore is a database used by BO Server. so any changes made in infostore through BO enterprise session is valid.
    Say u want to retrive on of report present in folder <my folder>.
    The you have to query for that. for eg.
    boinfostore.query("select * from ci_infoobjects where si_kind ='report' and si_foldername='my folder'");
    Create/add/insert any new information in infostore is done by functionalities provide by SDK.
    like adding the user or scheduling a report will add new object to infostore.
    If you directly access cms database and make any changes then , I am afraid you will end up with nightmare.
    So it is always recommneded to access infostore/ cms database only from bo session.
    For more information refer below link
    [http://devlibrary.businessobjects.com/BusinessObjectsXIR2SP2/en/devsuite.htm]
    then under Contents
    BusinessObjects Enterprise SDK >>  COM developer guide and API reference >> Query Language Reference
    do revert if any queries
    Thanks,
    Praveen.

  • Inserting records into Table with check table logic in place

    I want to insert records into a table, and have the check table to not allow invalid entries.  Is there a function out there that will allow this?  I am currently using the insert statement and it is working except that it is not giving an error when the value does not exist in the check table for the particular fields.
    INSERT INTO ZSD_XREF VALUES WA_XREF.
    That is the basic statement I'm using ZSD_XREF has several fields one being the material number field tied to the check table which happens to be MAKT file.  The insert statement is not validating the material numbers using the check table, or at least it is not giving an error.  Any ideas?

    Paul,
    Unfortunately, open SQL statements such as INSERT, UPDATE do not go through the check table logic as they directly hit the database layer. Check table checks are performed only if you go through application layer that is when you enter the same data through a screen.
    You have to do the checks yourself.
    Happy checking!!!
    Srinivas

  • ORA-03113 error occurs when trying to insert record using procedure

    I have a Database Block whose DML Data Target Type is Procedure. I have given the Insert Procedure Name, Insert Procedure Arguments and Insert Procedure ResultSet Columns. The procedure which is used to insert record into the table, resides in the database. The procedure for insert takes Table of records as argument. I am getting FRM-40735: INSERT-PROCEDURE trigger raised unhandled exception ORA-03113).
    This exception does not occur if the Procedure is place under Program Units. But, I want the procedure to be under Database Block. I am working on Oracle Forms 6i.
    Please help me out in resolving this.

    Hello,
    I think you should call the support for this kind of error.
    Francois

  • Inserting records into a table with all caps

    Hello
    I have a procedure that inserts records into a table. How do I ensure that the text values inserted are recorded all capital letters into the table?
    Thanks.

    You can use UPPER(..) function in your insert statement, so that values are converted to UPPER, before insert.
    If you want to check at table level, you can achieve that by writting a before insert trigger and in that trigger check
    IF UPPER(:new.<col>) != :new.<col> THEN
    RAISE_APPLICATION_ERROR(-20101,'Error: Not all values are in upper case')
    END IF;

  • Insert records into non base table

    Hi
    I would like to insert records into a table when a button is clicked. The table is a non base table. I am trying to save records displayed in a form into a history table which is not part of the form. I am using the following code stored in a program unit then called when the button is pressed. It doesn't generate any error but the records are not inserted. Can anyone please help.
    hist_id := 1;
    cust_name := :CUSTOMER.cust_name;
    loan_date := :LOAN.loan_date;
    return_date := LOAN.return_date;
    FORMS_DDL('INSERT INTO LOAN_HISTORY VALUES'||hist_id||','||cust_name||','||loan_date||','||return_date);

    Why do you need forms_ddl built in for a DML statement to be used in form?
    U can directly use insert.
    hist_id := 1;
    cust_name := :CUSTOMER.cust_name;
    loan_date := :LOAN.loan_date;
    return_date := LOAN.return_date;
    INSERT INTO LOAN_HISTORY VALUES (hist_id,cust_name,loan_date,return_date);
    It should work perfectly.

  • ORA-1013 when trying to insert data into the table

    Hi,
    While inserting record into a table, we are getting the following error:
    ORA-1013
    01013, 00000, "user requested cancel of current operation"
    I could not find any information in alert log also.
    We have a bitmap index on this table. However, we never got this error till now.
    Also i found that the tablespace who stores data has lot of space and tablespace which consists of the indexes is close to 90% full today ( i dont know what was the space available yesterday when there was error).
    I know that information i provided might be very less, but i gave as much information as i can provide.
    Can you please help me in trouble shooting this problem.
    Thank you
    Giridhar

    Sorry. i forgot to give version information
    Oracle version: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0
    OS: SunOS 5.10
    we got it only once yesterday. only for one table. not for any other tables.
    Thanks aalap for your quick response.
    Giridhar

  • Validations when inserting records into database using table control?

    hi , guru's.
          iam inserting records into database table through table control when i press insert i want check which record is existing and which is not . so please give me any sample code
    regards,
    satheesh.

    hi , arjun.
    please check this code.
        WHEN 'INSERT'.
        data: g_vcontrol_itab1 like table of zcust_call_rec,
              g_vcontrol_wa1 like g_vcontrol_wa.
         SELECT *  FROM zcust_call_rec
                   INTO CORRESPONDING FIELDS OF TABLE g_vcontrol_itab1
                   FOR ALL ENTRIES IN g_vcontrol_itab
                   WHERE kunnr = g_vcontrol_itab-kunnr AND budat = g_vcontrol_itab-budat.
            loop at g_vcontrol_itab into g_vcontrol_wa.
               read table g_vcontrol_itab1 into g_vcontrol_wa1
                    with table key  g_vcontrol_wa-kunnr = kunnr and g_vcontrol_wa-budat = budat.
                     if sy-subrc = 0.
                       delete g_vcontrol_itab.
                     endif.
            endloop.
          LOOP AT g_vcontrol_itab INTO g_vcontrol_wa.
            INSERT into zcust_call_rec values g_vcontrol_wa.
          ENDLOOP.
    with this iam getting error message like this.
              <b>g_vcontrol_wa-budat is not expected.</b>

  • Multiple tables and templates in a main window

    Hi,
    Is it possible to have multiple tables and templates in a main window of a smartform?
    If so then how they are positioned in the main window? Means which table to come first and which to be the next?
    Thanks in advance.........
    Prinan

    Hi!
    both tables and templates can be printed any number of times ina  main window.
    The tables as in sequence are printed...after ending with the first it gets on to the another.
    If u want to print it under some cdonditions you can do it using the condition tabs.As per it is a main window the dats gets flowing to the next page so as the order goes thae data goes on printed.
    Regards.

  • Dbms_xmlgen.newcontext query from multiple tables and ||

    I have two questions
    How do I get a dbms_xmlgen.context to query from multiple tables? I have been able to make it work with using one table only, but not with multiple tables.
    And how to get the || (concat) to work within my query for my output to an xml file?
    Here is my current query:
    create or replace function get_xml return clob is
    result clob;
    qryctx dbms_xmlgen.ctxHandle;
    SELECT DBMS_XMLGEN.getxml('select prefix, suffix, fiscal_yr
    FROM rcv.recv_accessions ra
    where ra.prefix = 8 and ra.fiscal_yr = 11')xml into result FROM dual;
    result := DBMS_XMLGEN.getXML(qryCtx);
    This is what I desire:
    SELECT DBMS_XMLGEN.getxml('select ra.prefix||'-'|| ra.suffix||'-'|| ra.fiscal_yr accession, ss.date_in, st.test
    FROM rcv.recv_accessions ra, ser.sero_samples ss, ser.sero_tests st
    where ra.prefix = 8 and ra.fiscal_yr = 11 and ss.raid = ra.id and st.ssid = ss.id')xml into result FROM dual;
    On this both the reference to multiple tables and the concat function cause errors.
    Thank you
    Edited by: user583094 on Mar 2, 2011 3:36 PM

    Hi,
    for the concat do I use xmlconcat?No, XMLConcat is used to concatenate XMLType fragments.
    The || operator will do fine, but you must escape any single quote inside the string :
    SELECT DBMS_XMLGEN.getxml(
    'SELECT ra.prefix ||''-''|| ra.suffix ||''-''|| ra.fiscal_yr as accession,
            ss.date_in,
            st.test
    FROM rcv.recv_accessions ra,
          ser.sero_samples ss,
          ser.sero_tests st
    WHERE ra.prefix = 8
    AND ra.fiscal_yr = 11
    AND ss.raid = ra.id
    AND st.ssid = ss.id'
    INTO result
    FROM dual;Or, use the quoting operator to define a custom string delimiter :
    SELECT DBMS_XMLGEN.getxml(
    q'{SELECT ra.prefix ||'-'|| ra.suffix ||'-'|| ra.fiscal_yr as accession,
            ss.date_in,
            st.test
    FROM rcv.recv_accessions ra,
          ser.sero_samples ss,
          ser.sero_tests st
    WHERE ra.prefix = 8
    AND ra.fiscal_yr = 11
    AND ss.raid = ra.id
    AND st.ssid = ss.id
    INTO result
    FROM dual;BTW, a good practice would be to use bind variables for the query. DBMS_XMLGEN can handle them nicely :
    CREATE OR REPLACE FUNCTION get_xml
    RETURN CLOB
    IS
    qryctx   DBMS_XMLGEN.ctxHandle;
    v_out    CLOB;
    qrystr   VARCHAR2(4000) :=
    'SELECT ra.prefix ||''-''|| ra.suffix ||''-''|| ra.fiscal_yr as accession,
            ss.date_in,
            st.test
    FROM rcv.recv_accessions ra,
          ser.sero_samples ss,
          ser.sero_tests st
    WHERE ra.prefix = :b_prefix
    AND ra.fiscal_yr = :b_fiscal_yr
    AND ss.raid = ra.id
    AND st.ssid = ss.id';
    BEGIN
    qryctx := DBMS_XMLGEN.newContext(qrystr);
    DBMS_XMLGEN.setBindValue(qryctx, 'b_prefix', '8');
    DBMS_XMLGEN.setBindValue(qryctx, 'b_fiscal_yr', '11');
    -- to generate empty elements if necessary :
    DBMS_XMLGEN.setNullHandling(qryctx, DBMS_XMLGEN.EMPTY_TAG);
    v_out := DBMS_XMLGEN.getXML(qryctx);
    DBMS_XMLGEN.closeContext(qryctx);
    RETURN v_out;
    END;

  • Servlet inserting record into postgresql through hibernate

    Hi
    I have developed a servlet. This servlet is inserting record into postgres sql through hibernate using eclispe ide. When I run my code then I find the following exception
    exception
    java.lang.NullPointerException
         hibernate.example.FirstExample.doGet(FirstExample.java:54)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    I have developed the following code
    package hibernate.example;
    public class Contact {
         private String firstName;
         private String lastName;
         private String email;
         private long id;
         public String getEmail() {
         return email;
         public String getFirstName() {
         return firstName;
         public String getLastName() {
         return lastName;
         public void setEmail(String string) {
         email = string;
         public void setFirstName(String string) {
         firstName = string;
         public void setLastName(String string) {
         lastName = string;
         public long getId() {
         return id;
         public void setId(long l) {
         id = l;
    **Now the servlet is**
    package hibernate.example;
    import java.io.IOException;
    import java.io.PrintWriter;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.hibernate.Session;
    import org.hibernate.SessionFactory;
    import org.hibernate.cfg.Configuration;
    public class FirstExample extends HttpServlet     {
         Session session = null;
         public String getServletInfo() {
              return "Servlet connects to PostgreSQL database and displays result of a SELECT";
         public void doGet(HttpServletRequest request, HttpServletResponse response)
         throws IOException, ServletException {
              try{
                   response.setContentType("text/html");
                   PrintWriter out = response.getWriter();
                   Configuration cfg = new Configuration().configure();
                   SessionFactory factory = cfg.buildSessionFactory();
                   session = factory.openSession();
                   out.println("Inserting Record");
                   Contact contact = new Contact();
                   contact.setId(6);
                   contact.setFirstName("Deepak");
                   contact.setLastName("Kumar");
                   contact.setEmail("[email protected]");
                   session.save(contact);
                   out.println("Done");
              catch(Exception e){
                   System.err.println(e.getMessage());
              finally{
                   session.flush();
                   session.close();
    **web.xml is**
    <web-app>
              <database>
                   <driver>
                   <type>org.postgresql.Driver</type>
              <url>jdbc:postgresql://127.0.0.1:5432/ali</url>
              <user>ali</user>
              <password>ali</password>
                   </driver>
              </database>
              <servlet>
              <servlet-name>FirstExample</servlet-name>
              <servlet-class>hibernate.example.FirstExample</servlet-class>
              </servlet>
              <servlet-mapping>
              <servlet-name>FirstExample</servlet-name>
              <url-pattern>/hb</url-pattern>
              </servlet-mapping>
    </web-app>
    **And contact.hbm.xml is**
    <?xml version="1.0"?>
    <!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
    <hibernate-mapping>
    <class name="hibernate.example.Contact" table="CONTACT">
    <id name="id" type="long" column="ID" >
    <generator class="assigned"/>
    </id>
    <property name="firstName">
    <column name="FIRSTNAME" />
    </property>
    <property name="lastName">
    <column name="LASTNAME"/>
    </property>
    <property name="email">
    <column name="EMAIL"/>
    </property>
    </class>
    </hibernate-mapping>
    **And hibernate.cfg.xml is**
    <?xml version='1.0' encoding='utf-8'?>
    <!DOCTYPE hibernate-configuration PUBLIC
    "-//Hibernate/Hibernate Configuration DTD//EN"
    "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
    <hibernate-configuration>
    <session-factory>
    <property name="hibernate.connection.driver_class">com.postgressql.jdbc.Driver</property>
    <property name="hibernate.connection.url">jdbc:postgresql://127.0.0.1:5432/ali</property>
    <property name="hibernate.connection.username">ali</property>
    <property name="hibernate.connection.password">ali</property>
    <property name="hibernate.connection.pool_size">10</property>
    <property name="show_sql">true</property>
    <property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
    <property name="hibernate.hbm2ddl.auto">update</property>
    <!-- Mapping files -->
    <mapping resource="contact.hbm.xml"/>
    </session-factory>
    </hibernate-configuration>
    Pleas tell me that where I have done the mistake and how can I resolove the error.

    ahmadgee wrote:
    Thank u very much.
    First I tried with out the servlet. I took a simple class. But it was displaying the null pointer exception.
    then you still have the problem. do you understand the root cause?
    After then I made a servlet. how was that going to help your null pointer exception?
    Now it is displaying error hibernate.cfg.xml not found.that's part of the problem. where is the servlet reading that file and initializing the session factory? how is it finding that file?
    i don't know where you have that .cfg.xml file, or where the recommended place is where hibernate expects to see it, but i'd bet it needs to be in the CLASSPATH, which means WEB-INF/classes.
    figure out why you get that NPE first, though. the servlet is only making things worse.
    %

Maybe you are looking for

  • Ipod Classic with Windows/32bits

    Does "Ipod Classic - Last Generation" work using Netbook with Windows/32bit?

  • How Do You Fix A 205 error on Install?

    I keep getting a 205 error (see this) when trying to run the creative cloud installer. The trouble shooting is next to useless in telling me the cause and how to fix it - as its gibberish to me. https://helpx.adobe.com/creative-cloud/kb/troubleshoot-

  • Apple's Application Uploader requires a MAC computer. Is there a solution

    The subject says it all. Is this a problem that will be fixed? If I have to buy a Mac, then I may as well develop apps on the Mac. Objective C isn't that difficult, but the price of a Mac is daunting when I'm already windows based. and in any case -

  • Need Help Setup Cisco RV042 vpn

    good day everyone, a month ago my boss purchase 4 pcs cisco rv042 vpn to be used in our small office and to our satelite office, with expectations of simple file sharing and remote troubleshooting and for better and safe data transfer. since the task

  • HP ScanJet Scanner 5370C Series

    I have just bought a new Desktop PC and find that my perfectly good ScanJet Scanner is not compatible with the OS [Windows 8 .1] is there anyone out there with better skills than myself who can advise on getting the scanner installed on my PC. Thanks