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>

Similar Messages

  • Error while inserting record into database using BPEL

    I am trying to read from an xml file using a File Adapter and insert the values read into a database (by invoking a database adapter).
    I formed the BPEL Process in the following manner:
    1.Receive activity to receive the values read from the file
    2.Assign activiuty to assign the values read to the Database input variable
    3.Invoke activity to invoke the Database adapter.
    The process deploys fine although with a warning : Trying to assign incompatible types.
    But when the process is executed, it is faulting at the invoke stage.
    The error i am getting is :
    <messages><input><InvokeDBInput><part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="EmployeesCollection"><EmployeesCollection xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/top/SaveToDB">
    <ns0:Employees xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/filetoDB D:\Smita\Software\jdevstudio10133\jdev\mywork\FileToDatabase\filetoDB\emp.xsd" xmlns="http://xmlns.oracle.com/filetoDB" xmlns:ns0="http://xmlns.oracle.com/pcbpel/adapter/db/top/SaveToDB">
         <Name>John Smith</Name>
         <Email>[email protected]</Email>
         <Department>Finance</Department>
         <Designation>Accountant</Designation>
         <Grade>5</Grade>
    </ns0:Employees>
    </EmployeesCollection>
    </part></InvokeDBInput></input><fault><bindingFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="code"><code>null</code>
    </part><part name="summary"><summary>file:/D:/product/10.1.3.1/OracleAS_1/bpel/domains/default/tmp/.bpel_FileToDBTest1_3.5_1558cd90a5c3c9708cd747f1b3638054.tmp/SaveToDB.wsdl [ SaveToDB_ptt::insert(EmployeesCollection) ] - WSIF JCA Execute of operation 'insert' failed due to: Mapping Not Found Exception.
    The mapping [Name] for descriptor [class bpel___localhost_default_FileToDBTest1_3_5__MD5_02e1d439ab7f9c7430b64c2a306ee77c_.SaveToDB.Employees] could not be found. The input xml record had an element [Employees/Name].
    ; nested exception is:
         ORABPEL-11627
    Mapping Not Found Exception.
    The mapping [Name] for descriptor [class bpel___localhost_default_FileToDBTest1_3_5__MD5_02e1d439ab7f9c7430b64c2a306ee77c_.SaveToDB.Employees] could not be found. The input xml record had an element [Employees/Name].
    Make sure that the input xml is valid relative to the xsd and that the mapping exists in the Mappings.xml. If an old version of the descriptor without this mapping has been loaded by the database adapter, you may need to bounce the app server. If the same descriptor is described in two separate Mappings.xml files, make sure both versions include this attribute/mapping.
    </summary>
    </part><part name="detail"><detail>null</detail>
    </part></bindingFault></fault></messages>
    The xml and xsd files i have used are these:
    XML File (Employee.xml ) :
    <?xml version="1.0" encoding="UTF-8"?>
    <person xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/filetoDB D:\Smita\Software\jdevstudio1013\jdev\mywork\FileToDatabase\filetoDB\emp.xsd" xmlns="http://xmlns.oracle.com/filetoDB">
         <Name>John Smith</Name>
         <Email>[email protected]</Email>
         <Department>Finance</Department>
         <Designation>Accountant</Designation>
         <Grade>5</Grade>
    </person>
    Schema file : (emp.xsd) :
    <?xml version="1.0"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://xmlns.oracle.com/filetoDB"
    xmlns="http://xmlns.oracle.com/filetoDB"
    elementFormDefault="qualified">
    <xs:element name="person">
    <xs:complexType>
    <xs:sequence>
         <xs:element name="Name" type="xs:string"/>
         <xs:element name="Email" type="xs:string"/>
         <xs:element name="Department" type="xs:string"/>
         <xs:element name="Designation" type="xs:string"/>
         <xs:element name="Grade" type="xs:integer"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element></xs:schema>
    can someone help me out?

    I figured where i was going wrong...added a transform activity after the assign activity to map the file input fieds to the database columns. Now it works fine.

  • 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.

  • Insert Records into database table.

    Hello Friends,
                         I am trying to insert set of records from an Internal table into Database table.
    INSERT SPFLI FROM TABLE ITAB ACCEPTING DUPLICATE KEYS.
    This is my statement. But It inserts only one record in to SPFLI table.
    Cheers
    Senthil

    Hi Sentil,
    USE THIS STATEMENT.
    MOVE-CORRESPONDING ITAB TO SPFLI.
    SPFLI-MANDT = SY-MANDT.
    MODIFY SPFLI.
    thy this....
    <b>reward if useful</b>
    regards,
    sunil kairam.

  • Cannot INSERT records into Partitioned Spatial Table and Index

    I am trying to tune our Spatial Storage by creating partitioning our spatial_entity table and index. I used the World Geographic Reference System (GEOREF) creating a partition for each 15 x 15 degree grid square assigning a partition key of decimal longitude, decimal_latitude. The build went OK, however when trying to insert a data record I receive an ORA-14400: Inserted partition key does not map to any partition.
    I validated the CREATE(s), and all appears correct, but obviously something is not correct, which is prompting for expert help in this forum.
    I would be very grateful for your help.
    Below are the code snippets for the table and index, and an insert statement.
    CREATE TABLE spatial_entity
         geoloc_type VARCHAR2 (60 BYTE) NOT NULL
    ,entity_id NUMBER NOT NULL
    ,metadata_xml_uuid VARCHAR2 (40 BYTE) NOT NULL
    ,geoloc MDSYS.sdo_geometry NOT NULL
    ,nee_method CHAR (1 BYTE) NOT NULL
    ,nee_status CHAR (1 BYTE) NOT NULL
    ,decimal_latitude NUMBER (15, 6) NOT NULL
    ,decimal_longitude NUMBER (15, 6) NOT NULL
    PARTITION BY RANGE (decimal_longitude, decimal_latitude)
         PARTITION p_lt_0_90s
              VALUES LESS THAN (1, -90)
         ,PARTITION p_lt_0_75s
              VALUES LESS THAN (1, -75)
         ,PARTITION p_lt_0_60s
              VALUES LESS THAN (1, -60)
         ,PARTITION p_lt_0_45s
              VALUES LESS THAN (1, -45)
         ,PARTITION p_lt_0_30s
              VALUES LESS THAN (1, -30)
         ,PARTITION p_lt_0_15s
              VALUES LESS THAN (1, -15)
         ,PARTITION p_lt_0_0
              VALUES LESS THAN (1, 0)
         ,PARTITION p_lt_0_15n
              VALUES LESS THAN (1, 15)
         ,PARTITION p_lt_0_30n
              VALUES LESS THAN (1, 30)
         ,PARTITION p_lt_0_45n
              VALUES LESS THAN (1, 45)
         ,PARTITION p_lt_0_60n
              VALUES LESS THAN (1, 60)
         ,PARTITION p_lt_0_75n
              VALUES LESS THAN (1, 75)
         ,PARTITION p_lt_0_90n
              VALUES LESS THAN (1, maxvalue)
    CREATE INDEX geo_spatial_ind ON spatial_entity (geoloc)
    INDEXTYPE IS mdsys.spatial_index
    PARAMETERS ('layer_gtype=MULTIPOINT TABLESPACE=GEO_SPATIAL_IND') LOCAL
    (PARTITION p_lt_0_90s,
    PARTITION p_lt_0_75s,
    PARTITION p_lt_0_60s,
    PARTITION p_lt_0_45s,
    PARTITION p_lt_0_30s,
    PARTITION p_lt_0_15s,
    PARTITION p_lt_0_0,
    PARTITION p_lt_0_15n,
    PARTITION p_lt_0_30n,
    PARTITION p_lt_0_45n,
    PARTITION p_lt_0_60n,
    PARTITION p_lt_0_75n,
    PARTITION p_lt_0_90n,
    INSERT INTO spatial_entity
         geoloc_type
         ,entity_id
         ,metadata_xml_uuid
         ,geoloc
         ,nee_method
         ,nee_status
         ,decimal_latitude
         ,decimal_longitude
    VALUES
                   'BATCH'
                   ,0
                   ,'6EC25B76-8482-4F95-E0440003BAD57EDF'
                   ,"MDSYS"."SDO_GEOMETRY"
                        2001
                        ,8307
                        ,"MDSYS"."SDO_POINT_TYPE" (32.915286, 44.337902, NULL)
                        ,NULL
                        ,NULL
                   ,'M'
                   ,'U'
                   ,32.915286
                   ,44.337902
    Thank you for you help.
    Dave

    Thank you for your quick reply. I did not post the entire CREATE script as it is quite long. The portion of the script that is applicable to the INSERT is:
    ,PARTITION p_lt_45e_90s
              VALUES LESS THAN (23, -90)
         ,PARTITION p_lt_45e_75s
              VALUES LESS THAN (23, -75)
         ,PARTITION p_lt_45e_60s
              VALUES LESS THAN (23, -60)
         ,PARTITION p_lt_45e_45s
              VALUES LESS THAN (23, -45)
         ,PARTITION p_lt_45e_30s
              VALUES LESS THAN (23, -30)
         ,PARTITION p_lt_45e_15s
              VALUES LESS THAN (23, -15)
         ,PARTITION p_lt_45e_0
              VALUES LESS THAN (23, 0)
         ,PARTITION p_lt_45e_15n
              VALUES LESS THAN (23, 15)
         ,PARTITION p_lt_45e_30n
              VALUES LESS THAN (23, 30)
         ,PARTITION p_lt_45e_45n
              VALUES LESS THAN (23, 45)
         ,PARTITION p_lt_45e_60n
              VALUES LESS THAN (23, 60)
         ,PARTITION p_lt_45e_75n
              VALUES LESS THAN (23, 75)
         ,PARTITION p_lt_45e_90n
              VALUES LESS THAN (23, maxvalue)
    Or, I do not fully understand. Are you indicating that I must explcitly state the longitude in each clause,
    e.g ,PARTITION p_lt_45e_45n
              VALUES LESS THAN (45, 45)
    ,PARTITION p_lt_45w_45n
              VALUES LESS THAN (-45, 45)
    If so, that answers the question of why it cannot find a partition, however an Oracle White Paper "Oracle Spatial Partitioning Best Practices" Sept 2004, discusses multi column partitioning such as represented by this problem, and gives an INSERT statement example of :
    CREATE TABLE multi_partn_table (in_date DATE,
    geom SDO_GEOMETRY, x_value NUMBER, y_value NUMBER)
    PARTITION BY RANGE (X_VALUE,Y_VALUE)
    PARTITION P_LT_90W_45S VALUES LESS THAN (1,-45),
    PARTITION P_LT_90W_0 VALUES LESS THAN (1,0),
    PARTITION P_LT_90W_45N VALUES LESS THAN (1,45),
    PARTITION P_LT_90W_90N VALUES LESS THAN (1,MAXVALUE
    and as I am writing this I am seeing that I failed to include the longitude and latitude in the SDO_GEOMETRY clause, so it does appear tht I need to explicitly state the longitude valuues.
    What is your judgement sir?
    Dave

  • Facing low Performance when iterating records of database using cursor

    Hi ,
    i inserted nearly 80,000,000 records into a database, by reading a file whose size is nealry 800MB, in 10 minutes.
    when i am iterating the records using Cursor with Default lock mode , it is taking nearly 1 hour.
    My Bdb details are as follows
    Environment : Non transactional , non locking
    Database : Deferred write.
    Cache : 80% of JVM ( -Xms=1000M -Xmx=1200m )
    Could you please explain why it is taking such a long time ? did i make any mistakes on settings ?
    Thanks
    nvseenu
    Edited by: nvseenu on Jan 15, 2009 5:47 AM

    Hello Gary,
    StoredMap is a convenience API wrapper for a Database. It has the same performance and multi-threading characteristics as a Database. You don't need to synchronize a StoredMap, or use Database to get better performance.
    The lock conflicts are the thing to focus on here. This is unrelated to the topic discussed earlier in this thread.
    How many threads are inserting and how many performing queries?
    What other work, other than inserting and reading, are these threads performing?
    Does any thread keep an iterator (which is a cursor) open?
    How large are the data items in the map?
    What is the resolution of the timestamp? Milliseconds?
    I don't think the exception you posted is complete. Please post the full exception including the cause exception.
    I can't tell from the exception but it looks like multiple insertion threads are conflicting with each other, not with the query threads. If you test only the insertions (no queries), do the lock conflicts still occur?
    One possibility is that multiple insertions threads are using the same timestamp as the key. Only one thread will be able to access that key at a time, the others will wait. Even so, I don't understand why it's taking so long to perform the inserts. But you can easily make the key unique by appending a sequence number -- use a two part key {timestamp, sequence}.
    Please upgrade to JE 3.3 in order to take advantage of the improvements and so we can better support you. We're not actively working with JE 3.2, which is very outdated now.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Can not insert record into database

    Hi:
    I have problem with inserting a record into oracle database .
    can some one please give some help?
    I created a project which connected to a external database. My project is on one of the tables called family.
    I followed the steps in the example "TwoPageCrudTable" from "Technical Articles & Tips". I have 3 pages: family,
    family_create and family_update.
    In page family: I have one table which bound to family table in db.
    In page family_create, I have a bunch of text fields
    In page family_update, I also have a lot of text fields which are bound to the fields of the family table.
    In each of the page, there is a dataprovider, they all refer to the same rowset in the sessionbean.
    Here is my code of create button:
    public String create_action() {
    if ( familyDataProvider.canAppendRow() ) {
    try {             
    RowKey rowKey = familyDataProvider.appendRow();
    familyDataProvider.setCursorRow(rowKey);
    familyDataProvider.setValue("family.familyID", rowKey, fid.getText());
    // familyDataProvider.setValue("family.countryoforigin", rowKey, counOrigin.getText());
    // familyDataProvider.setValue("family.ELOD", rowKey, elod.getValue());
    // familyDataProvider.setValue("family.power", rowKey, power.getValue());
              familyDataProvider.commitChanges();
    } catch (Exception e) {
    error("Cannot append new family: " + e);
    } else {
    error("Cannot append a new row");
    return "created";
    FamilyID is the primary key of the family table which is type of String. There are also some other
    fields with String or Number. I tried to insert a new record with value in all the fields and with
    only some of the fields, neither succeeded. I also did a search in this forum and tried some of the
    suggestions, no help. So could anybody help me to find the problem? Thanks in advance.

    It keeps giving me the error:
    java.lang.IllegalArgumentException: FAMILY.FAMILYID
    Does anybody know what is the problem? Thanks!

  • Error with date field when inserting records into sql server from webdynpro

    Dear SDN's,
    I am trying to insert the records into sql server through my webDynpro program.
    I have created a date field in a dictionary with the datatype date.
    In my webdynpro program to insert the date i am following the below format.
    String dateString = "2006/12/10";
          java.util.Date d=new java.util.Date(dateString);
          java.sql.Date <b>date</b> = new java.sql.Date(d.getTime());
    int i=stmt.executeUpdate("INSERT INTO TRAVEL_HEADER(TRQID,PROJECTID,<b>REQDT</b>,ADVCE,ETADV,PURTR) values(21, '555-1212', '" + <b>date</b> + "', 5000, '20060501','hi')");
    when i try to execute it, it gives the following error.
    <b>com.sap.sql.log.OpenSQLException: The SQL statement "INSERT INTO "TRAVEL_HEADER" ("TRQID","PROJECTID","REQDT","ADVCE","ETADV","PURTR") VALUES (21,'555-1212','2006-12-10',5000,'20060501','hi')" contains the semantics error[s]: - type check error: new value (element number 3 (CHAR)) is not assignable to column  >>REQDT<< (DATE)</b>
    Please correct me.
    Your help will be appreciated.
    Regards,
    Sireesha.B

    Hi,
    int i=stmt.executeUpdate("INSERT INTO TRAVEL_HEADER(TRQID,PROJECTID,REQDT,ADVCE,ETADV,PURTR) values(21, '555-1212', 'date', 5000, '20060501','hi')");
    try like this.
    I Think in SQL the general format to take date as input like this.
    INSERT INTO X VALUES ('10/30/56')
    thaks,
    Lohi.

  • Inserting data into database using service callout

    Hi,
    Im using 3 service callout for calling 3 database projects in osb. Im getting output from first two service call outs. In last service callout i have to insert data into data base which is output from service callout. im getting fault while inserting data. Can any body help me with any samples for inserting data into data base which is output from another service callout
    BEA-382513: OSB Replace action failed updating variable "body": com.bea.wli.common.xquery.XQueryException: Error parsing XML: {err}XP0006: "element {http://www.w3.org/2003/05/soap-envelope}Body { {http://www.w3.org/2004/07/xpath-datatypes}untypedAny }": bad value for type element {http://xmlns.oracle.com/pcbpel/adapter/db/POC/NRICHMENT/}OutputParameters { {http://www.w3.org/2001/XMLSchema}anyType }

    Hi prabu,
    I tried with several inputs but im getting same error. How to map to data base input of third service call out with output values of second service call out?
    Any sample blogs

  • Dump when Inserting records in Info type Tables through PA30

    Hi Experts,
    I am facing a issue in the transaction PA30 where in any changes made and saved leads to Runtime error (Inserting records in Infotype tables ).
    Error Line : insert (dbname) from  <prel_db>
    The Structure is the same but the data mismatch with the data types like
    Field NUMC(4) is filled with 00 instead of 0000
    Field DATE and TIME are Blank instead of 00000000 or 000000.
    Similarly facing the same issue in few other fields.
    The issue is same as the below thread and tried the solution given by Taher kanchwala by changing the data in the debugger and it worked.
    DBIF_RSQL_INVALID_REQUEST error while inserting records in infotype tables
    BUT i am not sure about the changes that needs to be done for fixing this issue permanently as it is mentioned to change at the configuration level.
    Any suggestions or solutions to this issue??
    Regards,
    AyyamPerumal

    Hi Nabheet,
    Thanks for your time. No enhancements are done.
    The issue is in the below statement where dbname is PA2001 and the field symbol <prel_db> has the structure of PA2001.
    insert (dbname) from  <prel_db>
    But the data is not matching with the data types like NUMC, DATE, TIME..
    Even the DOCSY and DOCNR which should been generated at this point is also not generated.
    On correcting this and giving dummy doc values, records are inserted.
    Attaching screen shots for your reference. Any solutions to this??
    Thanks and regards,
    Ayyamperumal

  • How to Insert Data in Ztable Using table Control

    Hi All,
      Please give some ideas of how to store the data from table control into the ztable database.
    There is a table control in which the end user enters the data manually and clicks the save button. Then, the data from the table control will go and store in the ztable.
    regards
    Vicky Kumar

    Hi Vicky,
    are you talking about ABAP transaction SE11 or about creating tables in the SAP HANA directly, i.e. in the HANA Modeler perspective?
    Cheers,
      Jasmin

  • 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.

  • Entity Framework doesn't save new record into database

    Hy,
    I have problem with saving new record into database using Entity Framework.
    When I run program, everything seems normal, without errors . Program shows existing, manually added records into the database, and new one too. But new one isn't save into database after running program.
    I've got no idea where's problem. There is code for add new record, show existing.
    Thanks for help!!
    // add new record
    using (var db=new DatabaseEntitiesContext())
    var person = new Table()
    First_Name = "New_FName",
    Second_Name = "New_SName",
    PIN = "4569"
    db.Tables.Add(person);
    db.SaveChanges();
    //show all records
    using (var db=new DatabaseEntitiesContext())
    var selected = from x in db.Tables
    select x;
    foreach (var table in selected)
    Console.WriteLine("{0}{1}{2}",table.First_Name,table.Second_Name,table.PIN);

    Hi BownieCross;
    If you are using a local database file in your project the following may be the cause.
    From Microsoft Documentation:
    Issue:
    "Every time I test my application and modify data, my changes are gone the next time I run my application."
    Explanation:
    The value of the Copy
    to Output Directory property is Copy
    if newer or Copy
    always. The database in your output folder (the database that’s being modified when you test your application) is overwritten every
    time that you build your project. For more information, see How
    to: Manage Local Data Files in Your Project.
    Fernando (MCSD)
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects
    and unknown namespaces.

  • How to Insert Hastables Into Database Through JDBC

    hi all,
    I have place the Data from the Hashtables Into the Database.I can place it by Iterating through the Hastables.I would Like to Place the Entire Hashtable Itself Into the Database.
    Can Any one tell me how?
    bye.

    Hi,
    Can anyone help me out how to insert image into
    database using struts...with dao n dto classes?If it matters whether or not you are using struts then you might have something wrong.
    Make sure you separate the database logic out.
    I know these types of questions are asked frequently, you might want to search the forum for additional examples.
    Here is a good one:
    http://forum.java.sun.com/thread.jspa?threadID=620455&messageID=3495899

  • 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

Maybe you are looking for

  • Upgrade stopped on phase MAIN_NEWBAS/PARCONV_UPG

    Hello, We are Upgrading our SAP CRM System from 5.0 to 7.0 (Ramp-Up version) / Oracle 10 / Windows 2003 The upgrade process stops with the following error: "Checks after phase MAIN_NEWBAS/PARCONV_UPG were negative" The Principal Errors are this: (PAR

  • Using MM-SUS create invoice can't change price

    Dear All,    We used MM-SUS create invoice,we want to change the item price,how to do it?

  • Why won't  my Mac OSX 10.9.1 read the latest version of adobe flash player?

    HELP! I am trying to take skills assessment test for future employment but my Mac wont read the latest version of adobe flash player. Is there a bug in the newest version?

  • My Photoshop CS6 stopped working.

    I have Win 7 and my PS CS 6 worked fine for months but now has stopped opening any files or creating new ones. Instead it just freezes without any errors warnings. I do have CS5 PS still installed and it still works fine. All other CS6 programs work

  • Gestures for iPad 1. Very poor Apple.

    Apple anticipated this outrage about tossing the original supporters od the IPad under the bus. So what is the response Apple? Why? Without the first buyers of the iPad, the second gen never exists. You know this. We are not telling you anything you.