Inserting rows in a database table using JDBC

Hi,
I am trying to insert a row in a table using the follwing code:
String Query_String = "Insert into Table_Name (Field_1, Field_2, Field_3)" +
"Values (Value_1, Value_2, Value_3)";
stmt.executeUpdate (Query_String);
Field_1 is a Date field, Field_2 is a String, and Field_3 is an integer.
Any of the fields could be null. If the user does not enter a value for any
one of these fields what would be the values for
Value_1, Value_2, or Value3 in the Query_String?
Thanks.

Hi,
I am trying to insert a row in a table using the
follwing code:
String Query_String = "Insert into Table_Name
(Field_1, Field_2, Field_3)" +
"Values (Value_1,
"Values (Value_1, Value_2, Value_3)";
stmt.executeUpdate (Query_String);
Field_1 is a Date field, Field_2 is a String, and
Field_3 is an integer.
Any of the fields could be null. If the user does not
enter a value for any
one of these fields what would be the values for
Value_1, Value_2, or Value3 in the Query_String?
Thanks.Keep in mind that each database server probably has their own way of storing date values. For now, I'm going to assume that you're going to be using MySQL.
// Initialize variables to null
String Value_1 = "";
String Value_2 = "";
String Value_3 = "";
try
// Get Date
Date date = new Date();
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
Value_1 = dateFormat.format(date);
// Get String value
Value_2 = "some string";
// Get Integer value
Value_3 = String.valueOf("2");
String query = INSERT INTO T_NAME VALUES('" + Value_1 +"', '" + Value_2 + "', '" + Value_3 + "');
int iUpdated = stmt.executeUpdate(query);
catch(Exception e)
// Catch Code
System.out.println("Number of records updated: " + iUpdated);
This will just enter empty string values if the strings are empty.
Is this what you wanted to know?
If not, provide a bit more information and I'll try to help as best as I can

Similar Messages

  • Inserting Multiple Rows into Database Table using JDBC Adapter - Efficiency

    I need to insert multiple rows into a database table using the JDBC adapter (receiver).
    I understand the traditional way of repeating the statement multiple times, each having its <access> element. However, I am just wondering whether this might be performance-inefficient, as it might insert records one by one.
    Is there a way to ensure that the records are inserted into the table as a block, rather than record-by-record?

    Hi Bhavesh/Kanwaljit,
    If we have multiple ACCESS tags then what happens is that the connection to the database is made only once. But the data is inserted row by row.
    Why i am saying this?
    If we add the following in JDBC Adapter..logSQLStatement = true. Then incase of multiple inserts we can see that there are multiple
    <i>Insert into tablename(EMP_NAME,EMP_ID) VALUES('J','1000')
    Insert into tablename(EMP_NAME,EMP_ID) VALUES('J','2000')</i>
    Doesnt this mean that rows are inserted one by one?
    Correct me if i am wrong.
    This does not mean that the transaction is not guaranted. Either all the rows will be inserted or rolled back.
    Regards,
    Sumit

  • Populating SAP Database table using JDBC adapter

    Hi Folks,
        I have a requirement to populate a SAP database table say ZTABLE using XI. The Model is the table has to be populated through a file which will be processed by SAP XI. Basically this is a File to JDBC scenario. The database used is ORACLE. Kindly provide me some idea to go ahead.

    I tried to place the MS access table in the shared folder of the Application server system but still it seems the table is not being populated.
    did you check the log in your receiver channel? (/people/sameer.shadab/blog/2005/10/24/connecting-to-ms-access-using-receiver-jdbc-adapter-without-dsn)
    The requirement is to update the tables directly as those are the custom tables.
    i would still say that do not update SAP tables directly from XI/ PI.....this is not a standard architecture/ solution....

  • How i can Insert selected records in database table using check box.

    Hi Friends,
    I have non database block, which displayed multiple records, now I add a Check Box to this block and now I want to insert the records in a database table which I checked. So when I press a button, all the checked records are inserted in the table.
    Please send me the code of this solution.
    Thanks in advance.
    Shahzad

    I have almost the exact scenario but instead of inserting into the DB, I want to find the Checked records and process them in PL/SQL script.
    I currently have a cursor that looks for all the checked records. It's only getting the first record, so I figured I need to loop through the block looking for checked records.
    Also can I save them to a temp or PL/SQL table to process later?

  • Inserting RFC Response to Tracking table using JDBC as a receiver

    Hi All
    I want to update my tracking table with the RFC response but the problem is I cant figure out he Target structure on my JDBC.
    Every time when testing on my http://xxxxxx:50000/mdt/channelmonitorservlet I get nothing on the  "Processing Details"
    I've configured my RFC Response as a sender (ASYN) and JDBC as a receiver, I do have RFC destination and it working fine.
    My is like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns1:RFC_JDBC_MT xmlns:ns1="http://yonela.com">
    <StatementName_response>
    <PI_JDBC_TBL ACTION="UPDATE">
    <TABLE>PI_JDBC_TBL</TABLE>
    <access>
    <TYPE></TYPE>
    </access>
    <key>
    <key><CARRID>AA</CARRID></key>
    </key>
    </PI_JDBC_TBL>
    </StatementName_response>
    </ns1:RFC_JDBC_MT>
    Any suggestion

    Hi,
    Use Insert in the action field instead of Update and try again.
    -Supriya.

  • Creation of tables using JDBC or SQLJ in webdynpro application

    Hi,
    I am trying to create tables in javadictionary(MaxDB)using my WebDynpro application.I tried creating tables using SQLJ and JDBC.But I was not able to do it.I can select and insert data into already created tables.
    Whwn I tried creating a table using JDBC I encountered the following exception.
    com.sap.sql.log.OpenSQLException: The SQL statement "CREATE TABLE TMP_DEPID (DEPID varchar(10) NOT NULL,DEPNAME VARCHAR(25))" contains the syntax error[s]: Open SQL syntax error: CREATE ... TABLE is not supported
    SQL syntax error: "VARCHAR" is a reserved keyword and cannot be used as an unquoted identifier
    Does this mean that creating tables is not supported?
    Can anyone help me in this matter?
    Thanks in advance,
    regards
    ~Pradeep Shetty

    Hi Pradeep,
    Yes, OpenSQL does not support creation of tables. But why would you need to create tables at runtime?! The natural way is to create the model at design time of your application, i.e. with the Java DataDictionary.
    However, if for any reason you really need to create database tables at runtime, you can achieve this by using a non-OpenSQL datasource, e.g. you could create a VendorSQL one and use it to obtain JDBC connections in your app. See also http://help.sap.com/saphelp_nw04/helpdata/en/c0/3ad4d5cdc66447a188b582aad537d3/frameset.htm.
    Hope that helps!
    Vladimir

  • How can i count no rows in my database table

    plz tell me how can i count no of rows in my database table with[b] ResultSet object

    Hi ! hope this code helps you .
    We can use the count(*) to get the total no of records in the table ad then access it through the getString method .
    import java.sql.*;
    public class JdbcTest
         public static void main(String [] args ) throws Exception
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              String DBURL = "jdbc:odbc:mydsn" ;
              Connection conn = DriverManager.getConnection(DBURL);
              Statement st = conn.createStatement();
              ResultSet rs = st.executeQuery("select count(*) from table1");
              rs.next();
              System.out.println("total rec = " + rs.getString(1));     
    Cheers !

  • Inserting new records into database table at runtime

    Hi all ,
    How to insert new records into database table at runtime on click update?
    Thanks.

    Hi Sasikala,
    Just for your understanding am giving a sample code snippet which you can use to read the contents of your Table UI element & save the data on to your database. Suppose you have a button up on pressing which you want to read the data from your screens table & save on to the database then you can proceed as shown below:
    1) Obtain the reference of your context node.
    2) Fetch all the data present in your table into an internal table using methods of if_wd_context_node
    3) Use your normal ABAP logic to update the database table with the data from your internal table
    In my example I have a node by name SFLIGHT_NODE and under this I have the desired attributes from SFLIGHT. Am displaying these in an editable table & the user would press up on a push button after making the necessary changes to the tables data. I would then need to obtain the tables information & save on to the database.
    data: node_sflight           type ref to if_wd_context_node,
            elem_sflight           type ref to if_wd_context_element,
            lt_elements            type WDR_CONTEXT_ELEMENT_SET,
           stru_sflight           type if_main=>element_sflight_node,
           it_flights             type if_main=>elements_sflight_node.
    "   navigate from <CONTEXT> to <SFLIGHT_NODE> via lead selection
        node_sflight_node = wd_context->get_child_node( name = 'SFLIGHT_NODE'  ).
       lt_elements = node_sflight->get_elements( ).
    "   Get all the rows from the table for saving on to the database
        loop at lt_elements into elem_sflight.
          elem_sflight->get_static_attributes( importing static_attributes = stru_sflight ).
          append stru_sflight to it_flights.
        endloop.
    " Finally save the entries on to the database
        modify ZSFLIGHT99 from table it_flights.
        if sy-subrc eq 0.
    endif.
    However a word of caution here.... SAP doesn't ever recommend directly modifying the database through an SQL query. You would preferably make use of a BAPI for the same. Try go through Thomas Jung's comments in [here|modify the data base table which is comming dynamiclly;.
    Regards,
    Uday

  • How to get the last row of a database table.

    HI ,
    I want to get record exactly from the last row of a database table.
    How is that possible?

    Hi,
    To fetch last record from an internal table, just do find the number of records in it and read using index.
    DESCRIBE TABLE ITAB LINES L_LINES.
    READ TABLE ITAB INDEX L_LINES.
    You can also use LOOP .. ENDLOOP but the above method is better (performance wise).
    using LOOP .. ENDLOOP.
    LOOP AT ITAB.
    **do nothing
    ENDLOOP.
    **process ITAB (Header record of ITAB).
    **after ENLOOP, ITAB will have the last record of the internal table.
    [here ITAB is internal table as well as header record.]
    But what is the requirement?
    If you are looking for the current record of an employee then you can use ENDDA = HIGH_DATE.
    My advice is to review your requirement again and try to fetch only that record which you need.
    Mubeen

  • How to get selected row values in a table using check box

    Hi ADF Experts,
    JDEV Version 11.1.1.7.0
    My requirement is getting the selected row valuesof a af:table using a checkbox(multi select).
    Thanks,
    Animesh

    Hi,
    add a transient attribute to the POJO entity and update this through a check box. The ensure you have autosubmit=true set on the check box. In a value change listener set or remove the row's checbox attribute value
    Frank

  • How to update field values in a database table using module pool prg?

    hi
    how to update field values in a database table using module pool prg?
    we created a customized table, and we put 2 push buttons in screen painter update and display.
    but update is not working?
    data is enter into screen fields and to internal table, but it is not updated in database table.
    thanks in adv
    vidya

    HI,
    we already used the update statement. but its not working.
    plz check this.
    *& Module Pool       ZCUST_CALL_REC
    PROGRAM  ZCUST_CALL_REC.
    TABLES: ZCUST_CALL_REC,ZREMARKS.
    data:  v_kun_low like ZCUST_CALL_REC-kunnr ,
           v_kun_high like ZCUST_CALL_REC-kunnr,
           v_bud_low like ZCUST_CALL_REC-budat,
           v_bud_high like ZCUST_CALL_REC-budat.
    ranges r_kunnr for ZCUST_CALL_REC-kunnr  .
    ranges r_budat for zcust_call_rec-budat.
    DATA: ITAB TYPE STANDARD TABLE OF ZCUST_CALL_REC WITH HEADER LINE,
          JTAB TYPE STANDARD TABLE OF ZREMARKS WITH HEADER LINE.
    *data:begin of itab occurs 0,
        MANDT LIKE ZCUST_CALL_REC-MANDT,
        kunnr like ZCUST_CALL_REC-kunnr,
        budat like ZCUST_CALL_REC-budat,
        code like ZCUST_CALL_REC-code,
        remarks like ZCUST_CALL_REC-remarks,
        end of itab.
    *data:begin of Jtab occurs 0,
        MANDT LIKE ZCUST_CALL_REC-MANDT,
        kunnr like ZCUST_CALL_REC-kunnr,
        budat like ZCUST_CALL_REC-budat,
        code like ZCUST_CALL_REC-code,
        remarks like ZCUST_CALL_REC-remarks,
        end of Jtab.
    CONTROLS:vcontrol TYPE TABLEVIEW USING SCREEN '9001'.
    CONTROLS:vcontrol1 TYPE TABLEVIEW USING SCREEN '9002'.
    *start-of-selection.
    *&      Module  USER_COMMAND_9000  INPUT
          text
    MODULE USER_COMMAND_9000 INPUT.
    CASE sy-ucomm.
    WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
    SET SCREEN 0.
    LEAVE SCREEN.
    CLEAR sy-ucomm.
    WHEN 'ENQUIRY'.
    perform multiple_selection.
    perform append_CUSTOMER_code.
    PERFORM SELECT_DATA.
    call screen '9001'.
    WHEN 'UPDATE'.
          perform append_CUSTOMER_code.
          PERFORM SELECT_DATA.
          call screen '9002'.
          perform update on commit.
    WHEN 'DELETE'.
          perform append_CUSTOMER_code.
          PERFORM SELECT_DATA.
          call screen '9002'.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_9000  INPUT
    *&      Module  STATUS_9000  OUTPUT
          text
    MODULE STATUS_9000 OUTPUT.
      SET PF-STATUS 'ZCUSTOMER'.
    SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_9000  OUTPUT
    *&      Module  USER_COMMAND_9001  INPUT
          text
    MODULE USER_COMMAND_9001 INPUT.
    CASE sy-ucomm.
    WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
    SET SCREEN 0.
    LEAVE SCREEN.
    CLEAR sy-ucomm.
    endcase.
    ENDMODULE.                 " USER_COMMAND_9001  INPUT
    *&      Module  STATUS_9001  OUTPUT
          text
    MODULE STATUS_9001 OUTPUT.
      SET PF-STATUS 'ZCUSTOMER'.
    SET TITLEBAR 'xxx'.
    move itab-MANDT   to zcust_call_rec-MANDT.
    move itab-kunnr   to zcust_call_rec-kunnr.
    move itab-budat   to zcust_call_rec-budat.
    move itab-code    to zcust_call_rec-code.
    move itab-remarks to zcust_call_rec-remarks.
    vcontrol-lines = sy-dbcnt.
    ENDMODULE.                 " STATUS_9001  OUTPUT
    *&      Module  USER_COMMAND_9002  INPUT
          text
    module  USER_COMMAND_9002 input.
    CASE sy-ucomm.
       WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
          SET SCREEN 0.
          LEAVE SCREEN.
          CLEAR sy-ucomm.
       WHEN 'UPDATE'.
             perform move_data.
         UPDATE ZCUST_CALL_REC FROM TABLE ITAB.
            IF SY-SUBRC = 0.
               MESSAGE I000(0) WITH 'RECORDS ARE UPDATED'.
             ELSE.
               MESSAGE E001(0) WITH 'RECORDS ARE NOT UPDATED'.
            ENDIF.
      WHEN 'DELETE'.
             perform move_data.
             DELETE ZCUST_CALL_REC FROM TABLE ITAB.
              IF SY-SUBRC = 0.
               MESSAGE I000(0) WITH 'RECORDS ARE DELETED'.
             ELSE.
               MESSAGE E001(0) WITH 'RECORDS ARE NOT DELETED'.
            ENDIF.
    endcase.
    endmodule.                 " USER_COMMAND_9002  INPUT
    *&      Module  STATUS_9002  OUTPUT
          text
    module STATUS_9002 output.
      SET PF-STATUS 'ZCUSTOMER1'.
    SET TITLEBAR 'xxx'.
    endmodule.                 " STATUS_9002  OUTPUT
    *&      Module  update_table  OUTPUT
          text
    module update_table output.
         move itab-MANDT   to zcust_call_rec-MANDT.
         move itab-kunnr   to zcust_call_rec-kunnr.
         move itab-budat   to zcust_call_rec-budat.
         move itab-code    to zcust_call_rec-code.
         move itab-remarks to zcust_call_rec-remarks.
    vcontrol-lines = sy-dbcnt.
    endmodule.                 " update_table  OUTPUT
    ***Selection Data
    FORM SELECT_DATA.
    SELECT  mandt kunnr budat code remarks  FROM zcust_call_rec INTO
                            table itab
                             WHERE kunnr IN r_kunnr AND BUDAT IN R_BUDAT.
    ENDFORM.
    ****append vendor code
    FORM APPEND_CUSTOMER_CODE.
    clear r_kunnr.
    clear itab.
    clear r_budat.
    refresh r_kunnr.
    refresh itab.
    refresh r_kunnr.
    IF r_kunnr  IS INITIAL
                  AND NOT v_kun_low IS INITIAL
                   AND NOT v_kun_high IS INITIAL.
                        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
                                    EXPORTING
                                       input         = v_kun_low
                                    IMPORTING
                                       OUTPUT        = r_kunnr-low.
                       CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
                                  EXPORTING
                                      input         = v_kun_high
                                  IMPORTING
                                      OUTPUT        = r_kunnr-high.
                     r_kunnr-option = 'BT'.
                     r_kunnr-sign = 'I'.
                     append r_kunnr.
       PERFORM V_BUDAT.
    ELSEIF r_kunnr  IS INITIAL
                  AND NOT v_kun_low IS INITIAL
                   AND  v_kun_high IS INITIAL.
                        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
                                    EXPORTING
                                       input         = v_kun_low
                                    IMPORTING
                                       OUTPUT        = r_kunnr-low.
                    r_kunnr-SIGN = 'I'.
                    r_kunnr-OPTION = 'EQ'.
                    APPEND r_kunnr.
       PERFORM V_BUDAT.
    ELSEIF r_kunnr IS INITIAL
                  AND  v_kun_low IS INITIAL
                   AND NOT v_kun_high IS INITIAL.
                        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
                                    EXPORTING
                                       input         = v_kun_low
                                    IMPORTING
                                       OUTPUT        = r_kunnr-low.
                    r_kunnr-SIGN = 'I'.
                    r_kunnr-OPTION = 'EQ'.
                    APPEND r_kunnr.
          PERFORM V_BUDAT.
    ELSEIF r_kunnr IS INITIAL
                  AND  v_kun_low IS INITIAL
                   AND  v_kun_high IS INITIAL.
                        IF SY-SUBRC = 0.
                             MESSAGE I003(0) WITH 'ENTER CUSTOMER NUMBER'.
                              CALL SCREEN '9000'.
                        ENDIF.
    PERFORM V_BUDAT.
    ENDIF.
    ENDFORM.
    FORM V_BUDAT.
    IF  R_BUDAT IS INITIAL
                   AND NOT v_BUD_low IS INITIAL
                   AND NOT v_BUD_high IS INITIAL.
                     r_budat-low = v_bud_low.
                     r_budat-high = v_bud_high.
                     r_budat-option = 'BT'.
                     r_budat-sign = 'I'.
                     append r_budat.
             ELSEIF  R_BUDAT IS INITIAL
                   AND NOT v_BUD_low IS INITIAL
                   AND  v_BUD_high IS INITIAL.
                     r_budat-low = v_bud_low.
                     r_budat-high = v_bud_high.
                     r_budat-option = 'EQ'.
                     r_budat-sign = 'I'.
                     append r_budat.
             ELSEIF  R_BUDAT IS INITIAL
                   AND  v_BUD_low IS INITIAL
                   AND NOT v_BUD_high IS INITIAL.
                     r_budat-HIGH = v_bud_HIGH.
                     r_budat-option = 'EQ'.
                     r_budat-sign = 'I'.
                     append r_budat.
              ELSEIF  R_BUDAT IS INITIAL
                   AND  v_BUD_low IS INITIAL
                   AND  v_BUD_high IS INITIAL.
                   IF SY-SUBRC = 0.
                       MESSAGE I002(0) WITH 'ENTER POSTING DATE'.
                      CALL SCREEN '9000'.
                    r_budat-low = ''.
                    r_budat-option = ''.
                    r_budat-sign = ''.
                    ENDIF.
            ENDIF.
    ENDFORM.
    *&      Form  update
          text
    -->  p1        text
    <--  p2        text
    form update .
    commit work.
    endform.                    " update
    *&      Form  move_data
          text
    -->  p1        text
    <--  p2        text
    form move_data .
       clear itab.
      refresh itab.
           move-corresponding  zcust_call_rec to itab.
           MOVE ZCUST_CALL_REC-MANDT   TO ITAB-MANDT.
           MOVE ZCUST_CALL_REC-KUNNR   TO ITAB-KUNNR.
           MOVE ZCUST_CALL_REC-BUDAT   TO ITAB-BUDAT.
           MOVE ZCUST_CALL_REC-CODE    TO ITAB-CODE.
           MOVE ZCUST_CALL_REC-REMARKS TO ITAB-REMARKS.
         APPEND ITAB.
         delete itab where kunnr is initial.
    endform.                    " move_data
    thanks in adv
    vidya

  • Abort inserting a record in a table using a trigger

    Hi there,
    Is there any way to abort inserting a record in a table using a trigger?
    For full details, I have the following table ("myTable"):
    BSC INTEGER NOT NULL,
    BTS VARCHAR2(20) NOT NULL,
    INFO1 INTEGER,
    INFO2 INTEGER
    myTable_PK = PRIMARY KEY (BSC,BTS)
    I have also a stored procedure that imports a data from text file and inserts them to the specified table (using UTL_FILE package). The stored procedure works great.
    But the thing that in the text file itselft it might be (due to third-parity report generation bug) that the primary key will be violated or the BSC/BTS field has null value. In such case I just want to ignore the insertion statement using a trigger.
    Thanks

    Ok Jens, could you tell me what exception could I use?
    Below a protion of my StoredProcedure.
    CREATE OR REPLACE PROCEDURE update_myTable() IS
    FHANDLE UTL_FILE.FILE_TYPE;
    BSC INTEGER;
    BTS VARCHAR2(20);
    INFO1 INTEGER;
    INFO2 INTEGER;
    BEGIN
    FHANDLE := UTL_FILE.FOPEN('LOG_FILE_DIR',FILENAME,'R',4000);
    LOOP
    UTL_FILE.GET_LINE(FHANDLE,STR);
    -- Process the line STR and generates BSC, BTS, INFO1, and INFO2 values
    EXECUTE IMMEDIATE 'INSERT INTO myTable VALUES(:1,:2,:3,:4)' USING BSC,BTS,INFO1,INFO2;
    END LOOP;
    EXCEPTION WHEN NO_DATA_FOUND THEN UTL_FILE.FCLOSE(FHANDLE);
    END UPDATE_R205BTS;
    Remember that I am already using an exception with NO_DATA_FOUND to indicate the end of file then closing it.
    Thanks for your reply

  • Loading standard R/3 Hierarchy in BO Database Table using Data Services

    Hello,
    i'm trying to load Cost Center Hierarchy from R/3 to BO database table using SAP BO Dataservices 4.0
    i have replicated the Data Flow and Abap Data Flow explained in SAP documentatio (SAP BusinessObjects Data Services 4-0 SP1 Supplement for SAP) and http://wiki.sdn.sap.com/wiki/display/BOBJ/ReadingR3Hierarchies
    but it doesn't work
    i get errors like:
    [Merge:Merge]
    Length <64> for Tran Merge input ABAP_DF_Hierarchy_Leaf_Values column <PARENT_DESC> does not match the length <30> of Tran Merge input ABAP_DF_Hierarchy_Extraction column <PARENT_ID>. The matching columns of Merge transform must have the same data type length. (BODI-1111062)
    [Merge:Merge]
    Length <30> for Tran Merge input ABAP_DF_Hierarchy_Extraction column <PARENT_ID> does not match the length <64> of Transform Merge output column <PARENT_DESC>. The matching columns of Merge transform must have the same data type length. (BODI-1111062)
    thanks for your support
    Bilal

    It appears that the structures of the two Data Transports going into the Merge Transform don't have the columns in the same order. One of the Data Transports has PARENT_DESC listed before PARENT_ID and the other Data Transport has PARENT_ID before PARENT_DESC.
    Basically, you need to change the order of the columns in one of the Data Transports so that it structurally matches the other Data Transport that it's being merged (UNIONed) with.

  • Mapping the CMP Fields with the Database Table using Websphere???

    Hi,
    How to Map the CMP Fields with the Database Table using Websphere
    thru ejb.jar.xml???
    Thanks,
    JavaCrazyLover

    Hi,
    How to Map the CMP Fields with the Database Table using Websphere
    thru ejb.jar.xml???
    Thanks,
    JavaCrazyLover

  • Randomly selecting some rows from the database table

    Hi can some one help me in selecting some rows from a database table which has around 90,000 rows.
    Thanks.

    One thing you might try is the "sample" clause if you have 8i which is supposed to return a random percentage of the table. Say for example, you have a sequence number on your table as the pkey. Then you might try:
    select * from <table_name> where pkey in(select pkey from <table_name> sample(10));
    This should give you a random 10 percent of the rows in the table but I tried this once and the results seemed unpredictable. For example it returned a different number of rows each time even though the number of rows in the table didn't change.
    Hope this works for you.

Maybe you are looking for