Regarding loading of excel data  into oracle database

hello,
Can someone help me in knowing that how can we load excel sheets data into oracle database.
I will be really thankful to you.
Gursimran

Hi,
There is tool given by oracle "Oracle Bulk Loader "
you can use this.
But in order use this you need a control file, which specifies how data should be loaded into the database; and a data file, which specifies what data should be loaded.
Example :- this is the control file which has information how the data is processed.
LOAD DATA
INFILE test.dat
INTO TABLE test
FIELDS TERMINATED BY '|'
(i, s)
Example :- test.dat which is the data file or say your excel sheet or document
(1, 'foo')
(2, 'bar')
(3, ' baz')
example of Loading :-
sqlldr <yourName> control=<ctlFile> log=<logFile> bad=<badFile>
sqlldr testing control=test.ctl log=test.log
Thanks
Pavan Kumar N

Similar Messages

  • How to develope application for converting excel data into oracle database

    I am very new to the oracle world. I want to develop application for converting excel sheet into oracle database using oracle forms. I have basic knowldge of oracle but i am totally new to the forms. Can anybody tel me step by step procedure to do this task? Please help me out in this problem.
    Thanx in advance.

    Hello,
    just do a "Search" in this forum with words "excell to oracle"... and you could find lot of posts about that, i.e.:
    Re: How to load excel-csv file into oracle database
    Jose L

  • Want to load excel data into oracle table with out changing it to CSV

    Hello all,
    I have a requirement in dumping excel data into oracle database table without changing it to CSV file and this has to be used in normal sql/plsql environment i.e., pkg/procedure cant be used in the forms also...
    so, can u guys can help me out in this
    thanks.............

    The link Pavan provided discusses Oracle Heterogeneous Services. This allows you (using ODBC) to create a database link from Oracle to a non-Oracle data source like Excel. This would allow you to query the Excel data source from SQL*Plus or any other client tool. But that is probably going to require that your Oracle database is running on Windows since I'm not aware of any Excel ODBC drivers for Unix.
    Another potential option would be to write a Java stored procedure that parsed the file. There are a few different Java libraries that can read and write Excel data files. You could load one of those libraries into the database's JVM and then write Java code that parsed the file. You would then be able to call your Java stored procedure from PL/SQL.
    Justin

  • Importing excel data into oracle tables

    Hello gurus,
    Importing excel data into oracle tables..
    I know this is the most common question on the thread ...First, i searched the forum, i found bunch of threads with loading data using sqlloader, converting excel into .Txt, tab delimited file, .csv file etc....
    Finally i was totally confused in terms how to get this done....
    Here is wat i have
       - Excel file on local computer.
       - i have laod data into dev environment tables(So no risk involved, but want to try something simple)
       - Oracle version 11.1.0.7
       - Sqlplus and toad (editors)
    Here is wat i like to do ....i dont know if its possible
        - Without going to unix server can i do everthing on local system by making use of oracle db and sqlplus or toad
       SQLLOADER might be one option...but i dont want to go the unix server for placing files and logs and stuff.
    Wat will be best and simplest option to do?? and wat format will best to convert from excel into csv, or txt or tab delimited etc.....
    If you suggest sqlloader, any code example will be greatly appriciated.
    Thank you so much!!!

    Hi,
    user642297 wrote:
    Imran,
    This is increadible option in toad!!! It works absolutely sweet!! I have toad 9.7 version. IT works great. Thank you so much!!You are welcome :)
    Well i have further discussion on this ....this option is great if you doing in staging or development area. What if your doing in prod?? If you automating the sqlloader then how do u do it?? I think we still need to stick with traditional approach of laoding data by making use of SQLLoader right ?? If m wrong please correct me.well, in our case, we do have access to a custom schema in prod where we create the staging table and load the data from datafiles.
    try this:
    load data
    infile 'C:\dest.csv'
    into table dest_table
    fields terminated by "~" optionally enclosed by '"'
    TRAILING NULLCOLS
    (name,
    owner_nm,
    description_column,
    UPDT_DT DATE 'MM/DD/YYYY')
    {code}
    you can get more info about sql loader and your error here:
    http://download.oracle.com/docs/cd/B10501_01/server.920/a96652/ch05.htm
    http://www.allinterview.com/showanswers/53766.html
    And one more quick question ...i found an example of control file , in that i see .dat format file. Is it a data file ?? can i try that option ?? But in excel i didnt see to convert the .dat format file.
    Any thoughts ???
    It is same as a delimiter text file.
    steps to create a .dat file (from a excel file):
    1. Insert a column between two columns and populate it with the delimiter (in our case, it is ~)
    2. Save the file as unicode text.
    3. Open the file in text editor and remove all the tabs (find an replace with blank)
    4. Save the file as "DEST.dat". Select encoding as UTF-8 while saving.
    5. Your .dat file is ready.
    Regards
    Imran
    Edited by: Imran Soudagar on Apr 22, 2010 10:22 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to load text file data to Oracle Database table?

    By using Oracle Forms, how to load text file data to Oracle Database table?

    Metalink note 33247.1 explains how to use text_io as suggested by Robin to read the file into a Multi-Row block. However, that article was written for forms 4.5 and uses CREATE_RECORD in a loop. There was another article, 91513.1 describing the more elegant method of 'querying' the file into the block by transactional triggers. Unfortunately this more recent article has disappeared without trace and Oracle deny its existence. I know it existed as I have a printed copy in front of me, and very useful it is too.

  • How to create a Macro in excel to store the excel data to Oracle Database

    Hi All
    Does anyone has created a macro in excel which on being run stores the excel data to Oracle database. In my project I need to create one such macro for updating oracle database with excel data and another for inserting excel records.
    I tried doing this using a macro in MS access but Client wants its to be done using Excel Macro only.
    Any help would be highly appreciated.
    Thanks in advance..
    Shikha

    Please read Chapter 19.7 Creating Selection Lists (http://download.oracle.com/docs/html/B25947_01/web_complex007.htm#CEGFJFED) of the Oracle® Application Development Framework Developer's Guide For Forms/4GL Developers 10g Release 3 (10.1.3.0)
    Cheers,
    Mick.

  • Performance problems loading an XML file into oracle database

    Hello ODI Guru's,
    I am trying to load and XML file into the database after doing simple business validations. But the interface takes hours to complete.
    1. The XML files are large in size >200 Mb. We have an XSD file for the schema definition instead of a DTD.
    2. We used the external database feature for loading these files in database.
    The following configuration was used in the XML Data Server:
    jdbc:snps:xml?f=D:\CustomerMasterData1\CustomerMasterInitialLoad1.xml&d=D:\CustomerMasterData1\CustomerMasterInitialLoad1.xsd&re=initialLoad&s=CM&db_props=oracle&ro=true
    3. Now we reverse engineer the XML files and created models using ODI Designer
    4. Similar thing was done for the target i.e. an Oracle database table as well.
    5. Next we created a simple interface with one-to-one mapping from the XSD schema to the Oracle database table and executed the interface. This execution takes more than one hour to complete.
    6. We are running ODI client on Windows XP Professional SP2.
    7. The Oracle database server(Oracle 10g 10.2.0.3) for the target schema as well as the ODI master and work repositories are on the same machine.
    8. I tried changing the following properties but it is not making much visible difference:
    use_prepared_statements=Y
    use_batch_update=Y
    batch_update_size=510
    commit_periodically=Y
    num_inserts_before_commit=30000
    I have another problem that when I set batch_update_size to value greater that 510 I get the following error:
    java.sql.SQLException: class org.xml.sax.SAXException
    class java.lang.ArrayIndexOutOfBoundsException said -32413
    at com.sunopsis.jdbc.driver.xml.v.a(v.java)
    The main concern is why should the interface taking so long to execute.
    Please send suggestions to resolve the problem.
    Thanks in advance,
    Best Regards,
    Nikunj

    Approximately how many rows are you trying to insert?
    One of the techniques which I found improved performance for this scenario was to extract from the xml to a flat file, then to use SQL*LOADER or external tables to load the data into Oracle.

  • Parsing xml data into oracle database

    Oracle ACEs,
    We got a requirement that needs to load xml data into oracle db. Is it possible to load xml data into oracle db using built-in package. Is Oracle provides one ?
    Our database version is Oracle 9i.
    Your help in this regard is highly appreciated.
    Many Thanks.

    Check this out.
    http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96612/d_xmlsav.htm#1008593

  • How to load an Excel sheet into Oracle via SQL* Loader

    Hallo!I am trying to load an Excel spreadsheet into an Oracle 10g database via SQL*Loader.
    How do I achieve this via Oracle Enterprise Manager?
    Please give a detailed explanation especially covering the locations of the control file,infile,bad file etc for Oracle 10g running in both Windows and Linux platforms.
    Thanks.

    This has nothing to do with Oracle Enterprise Manager
    SQL Loader is command line and it needs to be installed with SQL PLUS (The wrong install type will not have it)
    Consider reviewing this:
    http://www.orafaq.com/wiki/SQL*Loader_FAQ

  • Problems with special characters uploading data into oracle database

    Greetings
    I have a problem uploading data into oracle tables from sybase datasource. The data that I want to upload is in Spanish, for example when I have a varchar field with the data 'Consultoría', in oracle table the data upload with interrogation symbols.
    I have my source and target datastores configured as follows.
    Any suggestion? Thank you for your time

    Chack section 10 Locales and Multi-byte Functionality in the SAP Data Services Reference Guide for an exhaustive description of NLS settings.
    As a summary, following settings are required:
    locales in the datastore definitions match the actual locale used in the associated databases
    the locale of the DS engine allows for source to target translation
    the character set in the target database supports storage of accented characters

  • Import Excel File Data into oracle database table.

    HI,
    i want to insert data into a specific table from a excel file. please help me..
    for example
    emp.xls file's data need to be import in emp database table.
    thanks in advance...

    Hi,
    to all knowledgable person, this would be gald for u all that i have solved the problem.
    through this procedure..
    PROCEDURE IMPORT_FROM_EXCEL_PROC (as_FileName VARCHAR2, exe_name varchar2) IS
              appid PLS_INTEGER;
              convid PLS_INTEGER;
              docid PLS_INTEGER;
              conv_established BOOLEAN := FALSE;
              buffer VARCHAR2(100);      
              Emp_code VARCHAR2(100);
              Emp_name VARCHAR2(100);
              Emp_desig VARCHAR2(100);
              Emp_Salary VARCHAR2(100);
              ls_error VARCHAR2(1000);
              li_row integer;
              li_col integer;
              li_error_count integer;
              li_load_count integer;
    BEGIN
         --Start Excel
         --This line assumes that Excel is in the specified directory
              --     APPID := DDE.APP_BEGIN('D:\OFFICE11\EXCEL.EXE',DDE.APP_MODE_MINIMIZED);
              APPID := DDE.APP_BEGIN(exe_name,DDE.APP_MODE_MINIMIZED);
         --Establish a conversation with Excel
         --The following loop will not end until a conversation with Excel
         --has been established. Therefore, it can result in a endless loop,
         --so use with caution.
              WHILE NOT conv_established LOOP
              BEGIN
              convid := DDE.INITIATE('excel', 'system');
              conv_established := TRUE;
              EXCEPTION
              WHEN DDE.DMLERR_NO_CONV_ESTABLISHED THEN
              conv_established := FALSE;
              END;
              END LOOP;
         --Open Excel document
         --This assumes that you have an Excel spreadsheet named ddetest.xls in the root of c:
              DDE.EXECUTE(convid, '[Open("'||as_FileName||'")]', 10000);     
         --Initiate conversation with Excel document
              docid := DDE.INITIATE('excel',as_FileName);
         --Begin transfer from Excel to Forms
                   li_load_count := 0;
                   li_error_count := 0;
                   li_col := 1;
                   li_row := 2;
                   GO_BLOCK('IMPORT_XLS');          
                   DDE.REQUEST (docid, 'R' || TO_CHAR(li_row) || 'C' || TO_CHAR(li_col), buffer, DDE.CF_TEXT, 1000);          
                   WHILE length(buffer) > 2 LOOP           
                   WHILE li_col < 5 LOOP
                        buffer := substr(buffer, 1, instr(buffer, chr(10)) - 2);               
                   IF li_col = 1 THEN --Emp_code
                        Emp_code := buffer;     
                   ELSIF li_col = 2 THEN --Emp_name     
                        Emp_name := buffer;     
                   ELSIF li_col = 3 THEN --Emp_desig      
                        Emp_desig := buffer;     
                   ELSE --Emp_salary
                        Emp_salary := buffer;
                   END IF;
                   IF nvl(ls_error,'N') = 'N' THEN
                   li_col := li_col + 1;
                   DDE.REQUEST (docid, 'R' || TO_CHAR(li_row) || 'C' || TO_CHAR(li_col), buffer, DDE.CF_TEXT, 1000);
                   ELSE
                   li_col := 5;
                   END IF;               
                   END LOOP;
                   IF nvl(ls_error, 'N') = 'N' THEN
                   li_load_count := li_load_count + 1;
                   IF li_load_count = 1 THEN
                   FIRST_RECORD;
                   ELSE
                   NEXT_RECORD;
                   END IF;
                   :IMPORT_XLS.Emp_code := Emp_code;               
                   :IMPORT_XLS.Emp_name := Emp_name;          
                   :IMPORT_XLS.Emp_desig := Emp_desig;
                   :IMPORT_XLS.Emp_salary := Emp_salary;
                   ELSE
                   li_error_count := li_error_count + 1;
                   DDE.POKE(docid, 'R' || TO_CHAR(li_row) || 'C5', ls_error, DDE.CF_TEXT, 10000);
                   END IF;
                   ls_error := '';
                   Emp_code := '';
                   Emp_name := '';
                   Emp_desig := '';
                   Emp_salary := '';
                   li_col := 1;
                   li_row := li_row + 1;
                   DDE.REQUEST (docid, 'R' || TO_CHAR(li_row) || 'C' || TO_CHAR(li_col), buffer, DDE.CF_TEXT, 1000);                
                   END LOOP;               
                   IF li_error_count > 0 THEN
                        DDE.EXECUTE(convid, '[[save]]', 10000);
                        Message(TO_CHAR(li_load_count) || ' Record(s) Loaded. ' ||
                        TO_CHAR(li_error_count) || ' Invalid Record(s). See error in excel file.');
                        ELSE
                        Message(TO_CHAR(li_load_count) || ' Record(s) Successfully Loaded.');
                   END IF;                
                   --End transfer to Excel
                   DDE.TERMINATE(docid);
                   DDE.TERMINATE(convid);
                   DDE.APP_END(appid);                          
                   --Handle exceptions
                   EXCEPTION
                   WHEN DDE.DDE_APP_FAILURE THEN
                   MESSAGE('WINDOWS APPLICATION CANNOT START.');
                   WHEN DDE.DDE_PARAM_ERR THEN
                   MESSAGE('A NULL VALUE WAS PASSED TO DDE');
                   WHEN DDE.DMLERR_NO_CONV_ESTABLISHED THEN
                   MESSAGE('DDE CANNOT ESTABLISH A CONVERSATION');
                   WHEN DDE.DMLERR_NOTPROCESSED THEN
                   MESSAGE('A TRANSACTION FAILED');
    END;

  • Insert data into oracle database using a PHP form

    I'm trying to enter data into my oracle database table using a php form. When I click submit no data is added. Could someone help me please. I'm new to php/oracle thing.
    NOTE: I don't have any problem connecting to the database using php.
    Here is the code I'm using:
    <?php
    // just print form asking for name if none was entered
    if( !isset($query)) {   
    echo "<form action=\"$uri\" method=post>\n";
    echo "<p>Enter Name: ";
    echo "<input type=text size=100 maxlength=200 name=data value=\"$data\">\n";
    echo "<br><input type=submit name=submit value=Submit>\n";
    echo "</form>\n";
    exit;
    // insert client's name
    $query = "INSERT INTO client (name) VALUES ($data)";
    // connect to Oracle
    $username = "xxxx";
    $paswd = "yyyyyy";
    $dbstring = "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)".
    "(HOST=patriot.gmu.edu)(PORT=1521))".
    "(CONNECT_DATA=(SID=COSC)))";
    $db_conn = ocilogon($username, $paswd, $dbstring);
    $stmt = OCIParse($db_conn, $query);
    OCIExecute($stmt, OCI_DEFAULT);
    OCIFreeStatement($stmt);
    OCILogoff($db_conn);
    ?>
    Thanks for your help. I will also appreciate a better was to do it.
    Tony

    resumption and jer,
    Sorry I cannot format the code for easy reading!
    The page is submitting to itself. See action = \"$uri\". I used the same logic to enter SELECT querries into the database. It pulls and displays data back on the webpage. The code I used for this is below. Compare it with the one above for inserting data into the table.
    <?php
    // connect to oracle
    $username = "xxxxx";
         $paswd = "yyyyy";
         $dbstring = "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)".
              "(HOST=patriot.gmu.edu)(PORT=1521))".
              "(CONNECT_DATA=(SID=COSC)))";
         $db_conn = ocilogon($username, $paswd, $dbstring);
    // username and password will be unset if they weren't passed,
    // or if they were wrong
    if( !isset($query)) {
    // just print form asking for account details
    echo "<form action=\"$uri\" method=post>\n";
    echo "<p>Enter Query: ";
    echo "<input type=text size=100 maxlength=200 name=query value=\"$query\">\n";
    echo "<br><input type=submit name=submit value=Submit>\n";
    echo "</form>\n";
    exit;
    // remove unwanted slashes from the query
    $query = stripslashes($query);
    // run the query
    $stmt = OCIParse($db_conn, $query);
    OCIExecute($stmt, OCI_DEFAULT);
    // Open the HTML table.
    print '<table border="1" cellspacing="0" cellpadding="3">';
    // Read fetched headers.
    print '<tr>';
    for ($i = 1;$i <= ocinumcols($stmt);$i++)
    print '<td class="e">'.ocicolumnname($stmt,$i).'</td>';
    print '</tr>';
    // Read fetched data.
    while (ocifetch($stmt))
    // Print open and close HTML row tags and columns data.
    print '<tr>';
    for ($i = 1;$i <= ocinumcols($stmt);$i++)
    print '<td class="v">'.ociresult($stmt,$i).'</td>';
    print '</tr>';
    // Close the HTML table.
    print '</table>';
    OCIFreeStatement($stmt);
    OCILogoff($db_conn);
    ?>

  • Native SQL: insert data into oracle database, no return message.

    hi,
    the statement : insert into <TableName> values (Source)
    how can I know if the data have already insert to the database table?
    now I have a program have this problem: the data has already exist, but there's no error message return when insert the same data again.
    data: dbs like dbcon-con_name value 'HRGK',
                       dbtype type dbcon_dbms.
    data: sqlerr_ref type ref to cx_sql_exception,
             exc_ref    type ref to cx_sy_native_sql_error,
             error_text type string.
    data: cnt type i,
            i(2) type c.
    set locale language 'E'.
    EXEC SQL.
      CONNECT TO :DBS
    ENDEXEC.
    EXEC SQL.
      SET CONNECTION :DBS
    ENDEXEC.
    EXEC SQL.
      SELECT COUNT(*) from org_unit into :cnt
    ENDEXEC.
    write: / cnt.
    *do.
    i = 'A'.               
    try.
        EXEC SQL.
          BEGIN
           insert into ORG_UNIT ( ORGAN_ID, UNIT_NO, UNIT_NAME, PARENT_ID)
                         values ( 'A', '123412', 'SDFSG', 'DDS');                     " ORGAN_ID is primary key
    " If the data 'A' has already exist in database ORG_UNIT, it will show error message
    " But if I use :I instead 'A', it will not show error message.
            IF SQL%FOUND THEN
               COMMIT;
            END IF;
          END;
        endexec.
        EXEC SQL.
          SELECT COUNT(*) from ORG_UNIT into :cnt
        ENDEXEC.
        write: / cnt.
    catch cx_sy_native_sql_error into exc_ref.
        error_text = exc_ref->get_text( ).
        write: / error_text.
      catch cx_sql_exception into sqlerr_ref.
        perform handle_sql_exception using sqlerr_ref.
    endtry.
    EXEC SQL.
      disconnect :DBS
    ENDEXEC.
    *enddo.
    *&      Form  handle_sql_exception
    form handle_sql_exception
      using p_sqlerr_ref type ref to cx_sql_exception.
      format color col_negative.
      if p_sqlerr_ref->db_error = 'X'.
        write: / 'SQL error occured:', p_sqlerr_ref->sql_code,
               / p_sqlerr_ref->sql_message.                     "#EC NOTEXT
      else.
        write:
          / 'Error from DBI (details in dev-trace):',
            p_sqlerr_ref->internal_error.                       "#EC NOTEXT
      endif.
    endform.                    "handle_sql_exception
    please help to see the words:
    *" If the data 'A' has already exist in database ORG_UNIT, it will show error message*
    *" But if I use :I instead 'A', it will not show error message.*
    in the program.
    Thanks a lot!

    resumption and jer,
    Sorry I cannot format the code for easy reading!
    The page is submitting to itself. See action = \"$uri\". I used the same logic to enter SELECT querries into the database. It pulls and displays data back on the webpage. The code I used for this is below. Compare it with the one above for inserting data into the table.
    <?php
    // connect to oracle
    $username = "xxxxx";
         $paswd = "yyyyy";
         $dbstring = "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)".
              "(HOST=patriot.gmu.edu)(PORT=1521))".
              "(CONNECT_DATA=(SID=COSC)))";
         $db_conn = ocilogon($username, $paswd, $dbstring);
    // username and password will be unset if they weren't passed,
    // or if they were wrong
    if( !isset($query)) {
    // just print form asking for account details
    echo "<form action=\"$uri\" method=post>\n";
    echo "<p>Enter Query: ";
    echo "<input type=text size=100 maxlength=200 name=query value=\"$query\">\n";
    echo "<br><input type=submit name=submit value=Submit>\n";
    echo "</form>\n";
    exit;
    // remove unwanted slashes from the query
    $query = stripslashes($query);
    // run the query
    $stmt = OCIParse($db_conn, $query);
    OCIExecute($stmt, OCI_DEFAULT);
    // Open the HTML table.
    print '<table border="1" cellspacing="0" cellpadding="3">';
    // Read fetched headers.
    print '<tr>';
    for ($i = 1;$i <= ocinumcols($stmt);$i++)
    print '<td class="e">'.ocicolumnname($stmt,$i).'</td>';
    print '</tr>';
    // Read fetched data.
    while (ocifetch($stmt))
    // Print open and close HTML row tags and columns data.
    print '<tr>';
    for ($i = 1;$i <= ocinumcols($stmt);$i++)
    print '<td class="v">'.ociresult($stmt,$i).'</td>';
    print '</tr>';
    // Close the HTML table.
    print '</table>';
    OCIFreeStatement($stmt);
    OCILogoff($db_conn);
    ?>

  • How to insert date into oracle database

    Hi, there,
    I want to insert date information to oracle database in a jsp page using JSTL. but always got wrong message:
    javax.servlet.jsp.JspException:
    INSERT INTO DATE_TEST
    (date_default,date_short,date_medium)
    values(?,?,?)
    : Invalid column type
    I don't know how to convert java date type to oracle date type or vice versa. the following is the source code(all the fields of DATE_DEFAULT,DATE_SHORT,DATE_MEDIUM are oracle date type. and even I want to insert d instead d1, I got the same wrong message)
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ page import="java.util.*" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %>
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
    <%
    Calendar now;
    Calendar rightNow = Calendar.getInstance();
    %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>
    Hello World
    </title>
    </head>
    <body>
    <h2>
    The current time is:
    </h2>
    <p>
    <%= new java.util.Date() %></p>
    <%
    java.util.Date d=new java.util.Date();
    java.sql.Date d1=new java.sql.Date(d.getYear(),d.getMonth(),d.getDate());
    out.print(d1.toString());
    %>
    <sql:update>
    INSERT INTO DATE_TEST
    (DATE_DEFAULT,DATE_SHORT,DATE_MEDIUM)
    VALUES(?,?,?)
    <sql:dateParam value="${d}" type="date" />
    <sql:dateParam value="${d}" type="date" />
    <sql:dateParam value="${d}" type="date" />
    </sql:update>
    </body>
    </html>
    thank you very much for the great help!!

    Hi, there,
    I want to insert date information to oracle database in a jsp page using JSTL. but always got wrong message:
    javax.servlet.jsp.JspException:
    INSERT INTO DATE_TEST
    (date_default,date_short,date_medium)
    values(?,?,?)
    : Invalid column type
    I don't know how to convert java date type to oracle date type or vice versa. the following is the source code(all the fields of DATE_DEFAULT,DATE_SHORT,DATE_MEDIUM are oracle date type. and even I want to insert d instead d1, I got the same wrong message)
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ page import="java.util.*" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %>
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
    <%
    Calendar now;
    Calendar rightNow = Calendar.getInstance();
    %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>
    Hello World
    </title>
    </head>
    <body>
    <h2>
    The current time is:
    </h2>
    <p>
    <%= new java.util.Date() %></p>
    <%
    java.util.Date d=new java.util.Date();
    java.sql.Date d1=new java.sql.Date(d.getYear(),d.getMonth(),d.getDate());
    out.print(d1.toString());
    %>
    <sql:update>
    INSERT INTO DATE_TEST
    (DATE_DEFAULT,DATE_SHORT,DATE_MEDIUM)
    VALUES(?,?,?)
    <sql:dateParam value="${d}" type="date" />
    <sql:dateParam value="${d}" type="date" />
    <sql:dateParam value="${d}" type="date" />
    </sql:update>
    </body>
    </html>
    thank you very much for the great help!!

  • How to load excel data into oracle table

    How do i load data from an excel file with several worksheets into an oracle table?
    using Oracle 10g
    Excel
    sample data of excel
    Name eric Name mary
    AccountNo 123 AccountNo 321
    amount1 5.0 Amount1 1.0
    amount2 5.5 Amount2 2.0
    amount3 6.0 Amount3 3.0
    Total 16.5 Total 6.0
    Name larry Name beth
    AccountNo 123 AccountNo 321
    amount1 5.0 Amount1 1.0
    amount2 5.5 Amount2 2.0
    amount3 6.0 Amount3 3.0
    Total 16.5 Total 6.0
    Note: Assume data are aligned into columns like a real excel workbook

    I have some used something like this.
    don't ask any details as I am not a xl person, but i think its pretty straight forword.
    hope its helpful for you or someone else
    Dim i As Integer
    Dim conn As New ADODB.Connection
    Dim strInsert As String
    Dim strExecInsert As String
    conn.ConnectionString = "Provider=MSDAORA.1;User ID=scott;password=tiger;Data Source=orcl.world;Persist Security Info=False"
    conn.Open
    strInsert = "insert into xlsc ( emp, dept, doj," & _
    "dol, dob, Ce ,ED, v_date ) values("
    'this is to insert first 2347 rows from xl to orcl
    While i < 2348
    strExecInsert = strInsert & "'" & _
    Trim(Cells(i, 1).Value) & "','" & _
    Trim(Cells(i, 2).Value) & "','" & _
    Trim(Cells(i, 3).Value) & "','" & _
    Trim(Cells(i, 4).Value) & "','" & _
    Trim(Cells(i, 5).Value) & "','" & _
    Trim(Cells(i, 6).Value) & "','" & _
    Trim(Cells(i, 7).Value) & "','" & _
    Trim(Cells(i, 8).Value) & "' )"
    'MsgBox strExecInsert
    If Cells(i, 1).Value <> "" Then
    conn.Execute (strExecInsert)
    End If
    i = i + 1
    Wend
    'conn.Execute ("commit")
    conn.Close
    End Sub

Maybe you are looking for

  • Best audio format to embed for export to pdf?

    Hello, I was wondering what format for audio file would be best to embed for exporting to pdf. I want to embed the audio file in a button, for playback on mouseover in the exported pdf. Previously, when I had CS3, I actually had to convert my mp3s to

  • Restrict "Create Purchase Order" Authorization using vendor number "LIFNR"

    Hello All, How can we restrict the creation of purchase order(ME21N) using the vendor number (LIFNR). Any helpful idea? Regards,

  • Encoding Needed for polish content in dynamic pdf

    I am creating dynamic pdf using pdfwriter and java in cq5. I am not able to get polish language content in pdf. What encoding should i use? Here my code:  XMLWorkerHelper.getInstance().parseXHtml(   writer,   document,   new ByteArrayInputStream(html

  • Online iCal confused

    Not sure if this is an iCal or a Wiki Server Prob. Background to the Problem : My partner and I where working together on separate Mac's but in the same office. We were both bouncing between wiki and our online calendars to sort out the weeks appoint

  • Adding and /exporting/ image with Metadata problem

    i have been able to add metadata to an image i need to publish but for some reason i am having a problem figuring out how to export this metada with the image. i see i have an option to export as original or as version. does this affect whether metad