Insert into rules

Hi,
I have a query that joins several tables and I want to insert the result into a temp table.
The tables I am doing the joins from are all indexed but I have not indexed the table I created as a temp.
The query takes about 5 minutes but the insert into takes a lot longer.
see below the sql. Hope the format is legible
What do I have to consider?
DROP TABLE database.TEMP1
create table database.TEMP1
src_fl_cd               CHAR(5),
excl_typ_cd          CHAR(1),
cntct_typ_cd          CHAR(15),
taxpayer_id          DECIMAL(9,0),
eff_dt               DATE,
vld_email_until_dt      DATE,
ssn_flag               VARCHAR2(1),
ACCT_flag               VARCHAR2(1),
EMAIL_IND_FLAG          VARCHAR2(1)
INSERT INTO database.TEMP1
select x.src_fl_cd,
x.excl_typ_cd,
x.cntct_typ_cd,
y.taxpayer_id,
z.eff_dt,
z.vld_email_until_dt,
case when x.excl_typ_cd = 'N' and x.cntct_typ_cd ='email' then 'N' else 'Y' END,
NULL,
NULL
from
database.cust_cntct x,
select b.cust_ref_ky,
a.taxpayer_id
from database.table1 a,
dtabase.table2 b
where a.taxpayer_id = b.tin_num
) y,
database.src_fl_typ_expir z
where x.cust_ref_ky = y.cust_ref_ky
and x.excl_typ_cd = 'N'
and x.cntct_typ_cd = 'email'
and x.src_fl_cd = z.src_fl_cd

Hallo,
is your table really temporary ? (Youre create table statement has not keyword "TEMPORARY" an COMMIT - Rule).
It exists performance problems with insert of huge amount of data in temporary table. You can try to use "normal" table instead of "temporary" and compare performance.
Once more, I am not sure, that you really use temporary table
Regards
Dmytro

Similar Messages

  • Manipulation of the size of an image inserted into an Image Field

    Hi,
    I'm learning LiveCycle Designer ES 8.2 as I go. My apologies for the lengthy post but I'm trying to give you as much background as possible.
    I'm are trying to design a form that will allow us to automate data entry (by importing fields into our Access dbase instead doing the data entry by hand).  However, at the end of the day, I also need an electronic pdf file of the same form and a printed paper copy.  Things have been going well until working with the Image Field.
    The form is fairly complicated - 4 pages long.  We're collecting extensive data on specific locales (location, what was seen there, who did the work, etc). On one page, three different images (maps) are needed, each one showing different details on the site's location.  [Please note these images will not be imported into the database but must appear in the electronic pdf and on the paper copy.] The people who fill out the forms are expected to do so using Adobe Reader (the form will have extended rights so that they can save the data they enter on the form).  They would then email us the form as an xml file.  Once we receive the form, we have to add some additional information and then the finalized paper copy and electronic pdf would be made.  We have already done this successfully with much simpler forms, none of which have needed Image fields.
    Here's my problem - one of the three maps required is a standard 1:50000 scale topographic map which shows things like contour lines and latitude/longitude lines.   For accuracy and comparison reasons, having the standard 1:50000 scale is very important to us, so we can make absolutely certain the submitter has the right location.  If the dot plotted on the map is out just a few millimeters, we're looking at an error that represents 100s of meters on the ground.
    The current form exists in Word - we have never had any rules about the image formats used (jpg, gif, etc) or the resolution, as long as the image was clear.  The only rule was that the scale of the topographical map image HAD to be at 1:50000 scale.  This gets very tricky because Word will automatically mess with the physical appearance of the image, based on its resolution.  In most cases, the submitter simply readjusted the image within Word, stretching/resizing it manually until the scale was correct.  Another option was to use an image in the emf file format so that Word didn't readjust the image's appearance based on its resolution. Whatever method they used was fine by us, as long as the scale was correct.
    So far, after playing with all the "sizing" options of the Image field, along with embedding or not embedding the file, I do not see any way to control the physical size of the image. On our form, the three image fields are different sizes, with 2 of them being small (~2x3 inches) and the 3rd being large (~7x7 inches). Regardless of the settings I chose for each image field, the program simply resizes the topographic map whatever Image field it was inserted into,  making the same image appear physically smaller or larger at will.  I cannot correct the scale by resizing it, like I can in Word.   Instead, when I try to select the image, all I am asked is if I wish to insert another image.  Inserting an .emf file format into the field doesn't work - it only shows a blank screen instead of the image.
    Is there a way for the user to adjust the image's physical size in the form, after inserting it (like they can do in Word)?  Demanding that everyone use a standardized resolution or image format also seems highly unlikely to work - there are too many submitters and too many programs that can be used to make the image (some are making them using GIS programs, others are scanning the bought topographic print).  I'd appreciate any help you can give me on this.  I have had very little luck tracking down discussions on Image fields and how they work best within LiveCycle.  Any comments would be helpful!

    Hi,
    I have an example here that is intended to demonstrate the difference between Positioned and Flowed subforms: http://assure.ly/i8pSdy.
    This shows how you can use a slider to change the dimensions of the image object.
    I have extended this to an example with buttons to scale the image: http://assure.ly/i8ZI5Y
    This may not be fine enough for your purposes, but it may give you some ideas.
    Good luck,
    Niall
    Assure Dynamics

  • Import parametes and insert into database table suggestions

    experts need suggestions
    created a table with 3 fields.
    zstable.
    field dataelement type length
    kunnr  kunnr      char  10       key field
    name   dname      char   30      key field
    aedat aedat        dats  8
    aenam  aenam       char  12
    now i am creating a function modlue with two input parameters
    1)kunnr
    2)name
    i want to update this two fields into table zstable.
    1. so suggest me the best way to do this.
    Delcarations in import options which one of the below is best and why?
    name type char30
    kunnr type kunnr
    or
    name like zstable-name
    kunnr like zstable-kunnr
    or
    kunnr type zstable-kunnr
    name type zstable-name.
    2. inserting into table
    the data that we recieve from the import parameters need to be inserted into the zstable.
    please suggest me the appropriate statement  waht i need to code for this.
    insert kunnr name into zstable.
    can i ignore the third field as it is not the key field?
    3. before inserting do i need to check whether kunnr and uname is initial ie import parametrs?
    4. suppose if i delcared two input parameters  in function module zfuntion say vbeln and posnr.
      and source code
    insert vbeln and posnr into zstable.
    now i am calling from the program
    zreport.
    call function 'ZFUNCTION'.
    EXPORT
    NAME =
    KUNNR =
    Will the above statement updates the blank records into the table zstable?.

    Hi,
    1) I think the best is either refer directly to data element or to table field. This is beacuse once any change is made to this data element it will automatically reflect in your parameters. For table fields it is a bit less safier but still correct. Golden rule - always try to refer to DDIC components like data elements.
    name type dname
    kunnr type kunnr
    2) You need to provide all key fields. I recommend to use MODIFY as it would hanlde both INSERT (if yet no such record exists ) and UPDATE (if already exists).
    data: wa_zstable type zstable. "declare work area
    wa_zstable-kunnr = kunnr.  "pass parameters here
    wa_zstable-name = name.
    modify zstable from wa_zstable.
    3) good practise, for this use
    if kunnr is initial and  
       name is initial.
      "modify ...
    endif.
    "or if parameters are set as OPTIONAL, then use
    if kunnr is supplied and
       name is supplied.
    endif.
    4) No, the statment you want to use
    insert vbeln and posnr into zstable.
    is only used for FIELD GROUPS, not DB table. Please refer [INSERT|http://help.sap.com/abapdocu/en/ABAPINSERT_DBTAB_SHORTREF.htm] for correct syntax.
    You can alternatively use somthing like
    UPDATE zstable SET vbeln = ...
                                            posnr = ...
                                     WHERE ...
    This will update fields VBELN and PONR for all records fullfilling WHERE condition. These however musn't be key fields, only non-key fields can be udpated.
    Regards
    Marcin

  • Build a sql query fro different table and insert into a table

    Hi I have a requirement ,
    i have some table 1 table which holds rules which rules i have to apply on the sql query
    2 table will hold table name and column name and transformation
    with these help of 2 tables i want to build a sql quey and the sql query need to be insert into another  table.

    Hi Karthick,
    I am not going to build Dynamic Data Model.
    i already have table 1 contains rules let's say COUNT,
    and another table contain source table name , column name , Target table name, Source Table name like that
    so with the help of these 2 tables i want to build Sql query and going to insert into 3rd table.

  • INSERT INTO with SELECT CASE

    Hi all,
    I've this problem: insert into Table_A some values from Table_B... with one derivated/calculated filed.
    Example
    INSERT INTO Table_A (id_part, vendtype, origin, proven, desc)
    SELECT id_p, vendt, origin, proven, <calculate/derivated_field_desc>
    FROM Table_BThe rules for calculate the field desc inserted on Table_A are 1. IF vendt='V' AND origin='N' AND proven!='04' THEN ---> desc='TRANSFER'
    2. IF vendt='M' AND origin='N' AND proven!='04' THEN ---> desc='IMPORTED'
    3. IF proven='04' THEN ---> desc='BAD'So what I use in <calculate/derivated_field_desc> on my INSERT INTO statement??
    Can I use a SELECT CASE WHEN... or only DECODE is a right solution?
    Edited by: trebbia on 15-nov-2010 12.51

    Ok,
    I prefer use select case when... because trasform my rules in DECODE statement is more difficult
    So I write: INSERT INTO Table_A (id_part, vendtype, origin, proven, desc)
    SELECT id_p, vendt, origin, proven, SELECT CASE WHEN vendt='V' AND origin='N' AND proven!='04' THEN 'TRANSFER'
                                                    WHEN vendt='M' AND origin='N' AND proven!='04' THEN 'IMPORTED'
                                                    WHEN proven='04 THEN 'BAD'
                                                    END
    FROM Table_BObtain this error:
    40/56 PL/SQL: ORA-00936: missing expression
    33/1 PL/SQL: SQL Statement ignored
    PS: I use '<' '>' and not '!=' in my code... here not prompted correctly '<''>'
    Edited by: trebbia on 15-nov-2010 13.04
    Edited by: trebbia on 15-nov-2010 13.06

  • Conditional Insert into staging table by using sqlloader

    Hi,
    In Oracle apps I'm submitting a concurrent program programmatically which will call sqlloader and insert into a staging a table.
    This table consists of 30 columns.Program has one input parameter.If parameter value = REQUIRED Then it should insert into first three columns of staging table.If it's APPROVED then it should insert into first 10 columns of the same table.
    Data file is pipe delimited file which may or may not have all possible values :For Required,I many not have all three column values

    >
    I think you understood the thinks wrongly. OP marked UTL_FILE as the correct answer, which is again a server side solution.
    >
    Perhaps you failed to notice that the answer now marked correct was posted AFTER mine. I'm not clairvoyant and OP did not state whether a server side or client side solution was appropriate.
    I stand by my comments. Using an external table is an alternative to sql loader but, as I said, simply using an external table instead of sql loader doesn't address OPs problem.
    >
    And IMO, external table will be faster than UTL_FILE
    >
    I'd be more concerned with why OP wants to write a procedure to parse flat files, deal with data conversion errors and perform table inserts when Oracle already provides that functionality using either external tables or sql loader.
    I would suggest loading the file into a new staging table that can hold all of the columns that might be contained in the flat file. Then the appropriate data can be moved to OPs staging table according to the required business rules.
    Sounds like we each think OP should reconsider the architecture.

  • Concatenating strings to form an INSERT INTO

    I am trying to build an insert statement by concatenating
    strings. Basically, this is what I'm doing:
    <cfset string1 = "INSERT INTO #tablename# (">
    <cfset string1 = string1 & #colname#>
    <cfset string1 = string1 & ") ">
    <cfset string2 = "VALUES ('">
    <cfset string2 = string1 & #coldata#>
    <cfset string2 = string1 & "') ">
    <cfquery name="insert" datasource="db">
    #string1##string2#
    </cfquery>
    So if I exchange the <cfquery> tags for
    <cfoutput> I get a valid INSERT statement:
    INSERT INTO Habitat (AREA, ARTID, BIOTOP) VALUES (43, 37,
    'text')
    But when I have the <cfquery> tag I get this error:
    Syntax error (missing operator) in query expression
    '''text'''.
    I have tried changing the ('#coldata#') to (''#coldata'') and
    also tried ("#coldata#") and (""#coldata#"") but I get errors all
    the time...
    So. How do I do this?

    quote:
    Originally posted by:
    Newsgroup User
    To build the form - even dynamically - you need to know what
    you're
    building, so you have that information at the time you're
    adding your form
    fields. You know the order the fields are displayed, the data
    types and
    business rules (you say you're validating the values), and
    the input
    controls used to capture the data.
    Ditto you *must* know the structure of the table you're
    storing the data
    in
    Hehe, looks like someone got a bit curious. ;-)
    I do know a few things. I have a base table that contains a
    column with the table-names of all tables which are part of the
    application. Whenever a new table is created, it is added to this
    list so it can be loaded with all the others.
    I have a form that loads tables with their structures from
    the database, and lets the user change both column names,
    datatypes, table names, whatever... Assuming of course that the
    existing data in the table doesn't conflict with the proposed
    change. All form elements are given names from table-names or
    column-names and datatype from the database stored alongside.
    Tricky thing was to make sure the "insert into" gets the right
    columns and values for that table since the form items are thrown
    out in any order and multiple tables are treated in the same form.
    But now I got it all figured out. :-)

  • Performance - inserts into tables.

    Hi All,
    I am using Oracle 11g R2 and I am preparing some performance tests for our application. This application will load a lot of data (around 10 millions of rows per day) in a couple of Oracle tables with CLOB data types and varchar data types.
    I would like to know if you have any advices on setting up the tables in order to increase the performance of the inserts into theses tables (use of ASM ? changing table parameters like initrans, etc.)
    Many thanks !

    Hi,
    I'm not sure if I can be any more specific than this, but ok, I'll try.
    It's a bad habit to start any database activity by tweaking the parameters. Of course, there are exceptions to this rule, but generally you either don't need to touch parameters at all, or you modify them based on evidence from performance tests. So here is what I would do:
    - take requirements
    - take a test environment that has enough similarity to production
    - build a simiple test -- X sessions doing Y inserts per second concurrently, where X and Y will be derived from your requirements
    - see if insert time is within the target goal
    - if not, look at response time profile -- where does the process spend more time? how can this time be reduced. in particular, if you see contention-related waits, then you may need to tweak initrans or some other parameters
    If you do it this way, you'll be able to understand and trust your results. If you just collect a bunch of opinions from guys you never met and who never saw your system, who knows what you'd get.
    Best regards,
      Nikolay

  • How to capture insert into wf_notifications table

    we are building a custom app, which needs to know as soon as a row in insterted into the wf_notifications table, and we want to avod creating a on insert trigger on this table.
    Is there a way to figure out that a row is being inserted into this table without having to write a trigger.
    Thanks
    Tapash

    Oracle Workflow raises a business event oracle.apps.wf.notification.send as soon a notification record is created in WF_NOTIFICATIONS table. This business event has parameters such as NOTIFICATION_ID, RECIPIENT_ROLE etc. If you have access to the notification id you may access all other information from WF_NOTIFICATIONS table.
    You may create a subscription to this business event with On Error -> Skip property so that in case of an error, your subscription does not impact the normal processing of seeded subscriptions. You may have a PLSQL rule function in the subscription to process the logic required when the notification is created.
    Please refer to Oracle Workflow Developer Guide for more information on using Business Event System.
    Hope this helps.
    Vijay

  • How to copy the XY graph on labview front panel and insert into Excel using labview

    Hi all,
    The XY graph display on LV front panel after test. How can I copy this XY graph and insert into excel file?
    Thank you very much for your help.
    Khanh

    KPRO wrote:
    Hi,
    I refer to insert it into excel since report is in excel format, but if it's too hard to do so I can save it in another format.
    Either way, will labview support this? Anyway, thank you very much for your quick reply.
    Khanh
    You are already using the Report Generation Toolkit?  There is the "Append Control Image to Report.vi" that would make this easy.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Wird 2010 - Mailings / Write & Insert Fields / Rules / ASK....

    I am creating form letters, and the mailings tab, write & insert fields / Rules / Ask... input the rule in the letter, and when creating the letter it asks the questions, I prefill the answer in the box, and when it completes, the answers are not being
    input into the letter.  I have tried Alt + F9 and no resolve.  It is prefilling my other mail merge options.  Please help, I have about 70 letters to create with this Ask box needed on alot of them.

    An ASK field only populates a bookmark; you must then insert a cross-reference to that bookmark for the response to appear. An alternative is to use a FILLIN field.
    Cheers
    Paul Edstein
    [MS MVP - Word]

  • How can I insert into a table other than the default table in a form

    Hi,
    I want to insert into a table with some fields value of a form of another table. I have written insert code On successful submission of that form, but after submit it gives the following error
    An unexpected error occurred: ORA-06502: PL/SQL: numeric or value error (WWV-16016)
    My code is like this
    declare
    l_trn_id number;
    l_provider_role varchar2(3);
    l_provider_id varchar2(10);
    begin
    l_trn_id := p_session.get_value_as_number(p_block_name=>'DEFAULT',p_attribute_name=>'A_TRANSACTION_ID');
    l_provider_id := p_session.get_value_as_varchar2(p_block_name=>'DEFAULT',p_attribute_name=>'A_PROVIDER1');
    l_PROVIDER_ROLE := p_session.get_value_as_varchar2(p_block_name=>'DEFAULT',p_attribute_name=>'A_PROVIDER_ROLE1');
    if (l_provider_role is not null) and (l_provider_id is not null) then
    insert into service_provider_trans_records(service_provider_id,transaction_id,role_type_id)
    values(l_provider_id, l_trn_id, l_provider_role);
    commit;
    end if;
    end;
    Where 'PROVIDER1' and 'PROVIDER_ROLE1' are not table fields.
    How can do that or why this error comes ? Any idea?
    Thanks
    Sumita

    Hi,
    When do you get this error? Is it while running or while creating the form.
    Here is a sample code which inserts a non-database column dummy into a table called dummy. This is done in successful procedure.
    declare
    l_dummy varchar2(1000);
    begin
    l_dummy := p_session.get_value_as_varchar2(p_block_name=>'DEFAULT',
    p_attribute_name=>'A_DUMMY');
    insert into sjayaram903_1g.dummy values(l_dummy);commit;
    end;
    Please check in your case if the size of the local variable is enough to hold the values being returned.
    Thanks,
    Sharmila

  • Insert into sap r/3 table

    hi,guruvulu
    this is the program...............to insert the data into sap r/3 table
    but record is not inserting....any commit i have to write in my program?
    Created on Feb 20, 2007
    TODO To change the template for this generated file go to
    Window - Preferences - Java - Code Style - Code Templates
    package comm;
    @author sapusr006
    TODO To change the template for this generated type comment go to
    Window - Preferences - Java - Code Style - Code Templates
    Example2.java
    Property of SAP AG, Walldorf
    (c) Copyright SAP AG, Walldorf, 2000-2005.
    All rights reserved.
    //import java.sql.Connection;
    //import java.sql.PreparedStatement;
    import com.sap.mw.jco.IFunctionTemplate;
    import com.sap.mw.jco.IRepository;
    import com.sap.mw.jco.JCO;
    @version 1.0
    @author  SAP AG, Walldorf
    public class Fm {
      // The MySAP.com system we gonna be using
         static final String SID = "R3";
    // static String query="insert into BAPI_COMPANYCODE_GETLIST values(?,?)";
      // The repository we will be using
      IRepository repository;
                                 //ESTABLISHING A CONNECTION TO SAP
      public Fm()
        try {
          JCO.addClientPool( SID,            // Alias for this pool
                             10,             // Max. number of connections
                             "800",          // SAP client
                             "RFCTEST",      // userid
                             "welcome",      // password
                             "EN",           // language
                             "10.10.88.170", // host name
                             "01" );
           //   Create a new repository
          //    The repository caches the function and structure definitions
          //    to be used for all calls to the system SID. The creation of
          //    redundant instances cause performance and memory waste.
            repository = JCO.createRepository("MYRepository", SID);
        catch (JCO.Exception ex) {
          System.out.println("Caught an exception: \n" + ex);
                               // RETRIEVES AND DISPLAY A  ZHR INFOTYPE OPERATION
      public void salesOrders()
        JCO.Client client = null;
        try {
          // Get a function template from the repository
             //System.out.println("goes to sales order");
          IFunctionTemplate ftemplate = repository.getFunctionTemplate("ZHR_INFOTYPE_OPERATION");
          System.out.println("hai");
               if(ftemplate != null) {
            // Create a function from the template
           JCO.Function function = ftemplate.getFunction();
           JCO.ParameterList paralist=function.getImportParameterList();
                             paralist.setValue("0000000011","PERNR");
                             paralist.setValue("UPD","ACTIO");
                             paralist.setValue("A","TCLAS");
                             System.out.println("hello");
                             paralist.setValue("20061215","BEGDA");
                             System.out.println("hello");
                             paralist.setValue("20061215","ENDDA");
                             paralist.setValue("1","OBJPS");
                             paralist.setValue("LTA","SUBTY");
              System.out.println("SETTING VALUES");
            // Get a client from the pool
              client = JCO.getClient(SID);
              System.out.println("goes to sales order");
              //function.getImportParameterList().setValue("QUERY_TABLE","ZHRJ2EETEST");
                //EXECUTING THE FUNCTION
               client.execute(function);
              System.out.println("after exeucting the function");
                 // NO OF IMPORT PARAMS IT DISPLAY
                             //STRUCTURE
                              JCO.Structure returnStructure =
                                                                              function.getExportParameterList().getStructure("RETURN");
                              String structure=returnStructure.toString();
                              System.out.println(structure);
                                                                                    JCO.Table sales_orders = function.getTableParameterList().getTable("PROPOSED_VALUES");
                             System.out.println("after function");
                               System.out.println("proposed111"+sales_orders.getNumRows());
                                                                                    sales_orders.firstRow();
                                    sales_orders.appendRows(3);
                                 sales_orders.setValue("0582","INFTY");
                                 sales_orders.setValue("P0582-AMTEX","FNAME");
                                  sales_orders.setValue("200.00","FVAL");
                                  sales_orders.nextRow();
                                  sales_orders.setValue("0582","INFTY");
                                  sales_orders.setValue("P0582-JBGDT","FNAME");
                                  sales_orders.setValue("20061215","FVAL");
                                  sales_orders.nextRow();
                                  sales_orders.setValue("0582","INFTY");
                                  sales_orders.setValue("P0582-JENDT","FNAME");
                                  sales_orders.setValue("20061215","FVAL");
                                  System.out.println("proposed222"+sales_orders.getNumRows());
                                                                                    /*for (int i = 0; i <sales_orders.getNumRows(); i++) {
                                  sales_orders.setRow(i);
                                  System.out.println(sales_orders.getString("INFTY"));
                     JCO.Table sales_orders1 = function.getTableParameterList().getTable("MODIFIED_KEYS");
                             System.out.println("modified"+sales_orders1.getNumRows());
                                                                                    sales_orders1.setRow(1);
                               sales_orders1.appendRows(1);
                               sales_orders1.setValue("0000000011","PERNR");
                               sales_orders1.setValue("0582","INFTY");
                               sales_orders1.setValue("LTA","SUBTY");
                               sales_orders1.setValue("1","OBJPS");
                               sales_orders1.setValue("20061215","BEGDA");
                               sales_orders1.setValue("20061215","ENDDA");
                             System.out.println("modified222"+sales_orders1.getNumRows());
                                                                                    System.out.println("execute222"+sales_orders1.getNumRows());
                                                                                    for (int i = 0; i <sales_orders1.getNumRows(); i++) {
                                  sales_orders.setRow(i);
                                  System.out.println("hia"+sales_orders1.getString("SUBTY"));
                                                                                    System.out.println("NO OF ROWS ARE:---"+ sales_orders.getNumRows());
               String fieldName[]=new String[sales_orders.getFieldCount()];
               System.out.println("THE COLUMNS IN THE TABLE ARE:--"+sales_orders.getFieldCount());
               // sales_orders.firstRow();
               //COLUMNS NAMES
               System.out.println(fieldName.length);
               for (int iCtrst = 0;iCtrst < sales_orders1.getFieldCount();iCtrst++) {
                        fieldName[iCtrst] = sales_orders1.getName(iCtrst);
                        System.out.println(fieldName[iCtrst]);
            if (sales_orders.getNumRows() > 0) {
              // Loop over all rows
               do {
                     System.out.println("----
                     //int r=1;
                // Loop over all columns in the current row
                for (JCO.FieldIterator e = sales_orders.fields(); e.hasMoreElements();)
                       JCO.Field field = e.nextField();
                       String compcode=field.getString();
                       //pst.setString(r,compcode);
                       System.out.println(field.getName() + ":\t" + field.getString());
                      // r++;
                   }//for
                    // i=pst.executeUpdate();
                } while(sales_orders.nextRow());
            else {
              System.out.println("No results found");
            if (sales_orders1.getNumRows() > 0) {
                // Loop over all rows
                 do {
                       System.out.println("----
                       //int r=1;
                  // Loop over all columns in the current row
                  for (JCO.FieldIterator e = sales_orders1.fields(); e.hasMoreElements();)
                             JCO.Field field1 = e.nextField();
                         //String compcode=field1.getString();
                         //pst.setString(r,compcode);
                         System.out.println(field1.getName() + ":\t" + field1.getString());
                        // r++;
                                                                                    }//for
                      // i=pst.executeUpdate();
                  } while(sales_orders1.nextRow());
              else {
                System.out.println("No results found");
               System.out.println("modified"+sales_orders1.getNumRows());
               System.out.println("modified"+sales_orders.getNumRows());
            //if
           /* if(i>=1)
                 System.out.println("\t\t\tUpdated ORACLE successfully");
          else {
            System.out.println("FUNCTION MODULE not found in backend system.");
          }//if
        catch (JCO.AbapException ex) {
          System.out.println("Caught an exception: \n" + ex);
        }catch(Exception en){en.printStackTrace();}
        finally {
                   JCO.releaseClient(client);
      protected void cleanUp() {
          JCO.removeClientPool(SID);
      public static void main(String[] argv)
        Fm e=new Fm();
       // e.systemInfo();
        e.salesOrders();
        e.cleanUp();
    output:
    TABLE: MODIFIED_KEYS
    TABLE: PROPOSED_VALUES
    IMPORT         ACTIO
    IMPORT         BEGDA
    IMPORT         DIALOG_MODE
    IMPORT         ENDDA
    IMPORT         LUW_MODE
    IMPORT         MASSN
    IMPORT         NO_ENQUEUE
    IMPORT         NO_EXISTENCE_CHECK
    IMPORT         OBJPS
    IMPORT         PERNR
    IMPORT         PERSG
    IMPORT         PERSK
    IMPORT         PLANS
    IMPORT         SEQNR
    IMPORT         SPRPS
    IMPORT         SUBTY
    IMPORT         TCLAS
    IMPORT         WERKS
    EXPORT          HR_RETURN
    EXPORT          RETURN
    EXPORT          RETURN1
    appending
    NO OF ROWS ARE:---3
    THE COLUMNS IN THE TABLE ARE:--4
    INFTY:     0582
    FNAME:     P0582-AMTEX
    FVAL:     200.00
    SEQNR:     00
    INFTY:     0582
    FNAME:     P0582-JBGDT
    FVAL:     20061215
    SEQNR:     00
    INFTY:     0582
    FNAME:     P0582-JENDT
    FVAL:     20061215
    SEQNR:     00
    PERNR:     00000011
    INFTY:     0582
    SUBTY:     LTA
    OBJPS:     1
    SPRPS:     
    ENDDA:     2006-12-15
    BEGDA:     2006-12-15
    SEQNR:     000

    hi jagadesh,
    ur code is very length to see.
    see the following code ,
    JCO.Function objFunction =
                   this
                        .objIRepository
                        .getFunctionTemplate("BAPI_MATERIAL_AVAILABILITY")
                        .getFunction();
              objFunction.getImportParameterList().setValue(strPlant, "PLANT");
              objFunction.getImportParameterList().setValue(strMaterial, "MATERIAL");
              objFunction.getImportParameterList().setValue(strQuantity, "UNIT");
              this.objClient.execute(objFunction);
              JCO.Structure ret =
                   objFunction.getExportParameterList().getStructure("RETURN");
              String strRetMsg = ret.getString("MESSAGE");
    System.out.println(strRetMsg);  // it will tell whether record is inserted or not
    /*JCO.Function objFunction1 =
                   this
                        .objIRepository
                        .getFunctionTemplate("BAPI_TRANSACTION_COMMIT")
                        .getFunction();
    objFunction1.setValue("",WAIT);
    objClient.execute(objFunction1);*/
    CHECK THE RETURN MSG .IT WILL TELL THE PROBLEM
    give me points if it is useful
    regards
    Guru
    Message was edited by:
            Guruvulu Bojja
    Message was edited by:
            Guruvulu Bojja
    Message was edited by:
            Guruvulu Bojja

  • Best Practice to fetch SQL Server data and Insert into Oracle Tables

    Hello,
    I want to read sqlserver data everry half an hour and write into oracle tables ( in two different databases). What is the best practice for doing this?
    We do not have any database dblinks from oracle to sqlserver and vice versa.
    Any help is highly appreciable?
    Thanks

    Well, that's easy:
    use a TimerTask to do the following every half an hour:
    - open a connection to sql server
    - open two connections to the oracle databases
    - for each row you read from the sql server, do the inserts into the oracle databases
    - commit
    - close all connections

  • Splitting data in one row and inserting into seperate rows into a new table

    i have a table table1 like the following
    column1     column2          column3
    a     b,cbdm,d     hj
    ba     hello          man
    i have to insert data from this table to table2 in the following format
    Column1          column2          column3
    a          b          hj
    a          cbdm          hj
    a          d          hj
    ba          hello          man
    It is like if data in column2 is seperated by comma i have to insert it into each sperate row
    I have to write a single procedure which will do the above. Please,Please help me
    I am very new to SQL

    I am absolutely agreeing with Billy.
    But I think u will be able to learn a lot if u try to understand the following code
    sql>select * from t1;
         C1 C2 C3
         a  b,cdbm,d  hj 
         ba  hello  man 
         x  aa,d,df  yy 
    sql>select * from t2;
         no rows selected
    sql>insert into t2
          select col1,col2,col3
         from (
         select t1.c1 col1,t1.c2 col4,t1.c3 col3,
         substr(t1.c2,
                  case n when 1 then 1 else instr(t1.c2,',',1,n-1)+1 end,
                       (case instr(t1.c2,',',1,n) when 0 then length(t1.c2)+1 else instr(t1.c2,',',1,n) end) -
                      (case n when 1 then 1 else instr(t1.c2,',',1,n-1)+1 end)) col2,n
           from t1,(select c1,c2,c3,
                              row_number() over(partition by c1,c2,c3 order by c1) n
                      from t1 connect by level <=
                                                   (length(t1.c2)-length(replace(t1.c2,',','')))) t2
           where t1.c1 = t2.c1)
         where not(n != 1 and col4=col2);
    sql>select * from t2;
          C1 C2 C3
          a  b  hj 
          a  cdbm  hj 
          a  d  hj 
          ba  hello  man 
          x  aa  yy 
          x  d  yy 
          x  df  yy                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Maybe you are looking for

  • Can I create more than one instance of a native library?

    Hello all, I am using Java to access a Win32 DLL with JNI. Everything is working fine, but I have several threads using the same instance of the native library because it is loaded "statically" in the Java class which uses it, and I suspect I am gett

  • Imovie no longer recognizes my itunes library

    I just put a new HDD in my 2008 MBP it works fine. but iMovie no longer recognizes my itunes library. It says i need to upgrade to itunes 6 or later. I have ver. 10 any suggestions?

  • How do I fix lost presets and non-working scripts?

    About two weeks ago I attempted to use a curves preset (CS5 up to date) and discovered that the choices had disappeared and all I was left with was default and custom.I found that this applied to all other presets. 6 hours on the phone with Adobe tec

  • Audio Headphone Jack Problem

    I'm in college so  in my dorm room I always use headphones on my macbook pro. Lately I have been cycling through headphones every 4 or so weeks. I have a macbook pro 10.7.3 and I use skullcandy headphones. When I first use them the sound quality is g

  • Install ECC6.0 error

    Hi all I met a problem when installing ECC6.0 SR2 with Oracle on Win 2003 - System ask me to install Oracle software fist. Install master didn't appear the screen to ask Database CDs. I've installed ECC6.0 several times and everytime it will automati