How to Insert date in 'DD/MM/YYYY' format in oracle using stored procedure?

Hi
How to Insert date in 'DD/MM/YYYY' format in oracle using stored procedure?
This is my Input data.
11/25/2007.
By using below query, it is inserted into database.
sql>Insert into tblname values(to_date('11/25/2007','MM/DD/YYYY'));
But using stored procedure, the same query is not running.
It shows error like
ORA-01843: not a valid month ORA-06512: at line 1
Procedure:
create or replace procedure Date_Test(datejoin in DATE) is
begin
insert into datetest values(to_date(datejoin,'MM/DD/YYYY'));
end Date_Test;
I had used 'nls_date_language = american' also.
Prcodeure is created but not worked in jsp. The same error is thrown.
Pls provide a solution

This might help you....
SQL> Create Table DateTest(col1 Date);
Table created.
Elapsed: 00:00:00.00
SQL> create or replace procedure Date_Test(datejoin in DATE) is
2 begin
3 insert into datetest values(to_date(datejoin,'MM/DD/YYYY'));
4 end ;
5 /
Procedure created.
Elapsed: 00:00:00.00
SQL> exec Date_Test('11/25/2007');
BEGIN Date_Test('11/25/2007'); END;
ERROR at line 1:
ORA-01843: not a valid month
ORA-06512: at line 1
Elapsed: 00:00:00.00
SQL> exec Date_Test(To_Date('11/25/2007','mm/dd/yyyy'));
BEGIN Date_Test(To_Date('11/25/2007','mm/dd/yyyy')); END;
ERROR at line 1:
ORA-01843: not a valid month
ORA-06512: at "CTBATCH.DATE_TEST", line 3
ORA-06512: at line 1
Elapsed: 00:00:00.00
SQL> create or replace procedure Date_Test(datejoin in DATE) is
2 begin
3 insert into datetest values(datejoin);
4 end ;
5 /
Procedure created.
Elapsed: 00:00:00.00
SQL> exec Date_Test(To_Date('11/25/2007','mm/dd/yyyy'));
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.00
SQL> Select * from DateTest;
COL1
25-NOV-07
Elapsed: 00:00:00.00
SQL> create or replace procedure Date_Test(datejoin in VarChar2) is
2 begin
3 insert into datetest values(to_date(datejoin,'mm/dd/yyyy'));
4 end ;
5 /
Procedure created.
Elapsed: 00:00:00.00
SQL> exec Date_Test('11/25/2007');
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.00
SQL> select * from DateTest;
COL1
25-NOV-07
25-NOV-07
Elapsed: 00:00:00.00
SQL>

Similar Messages

  • How to insert date in mmm/dd/yyyy format

    hi all,
    im getting date from user-interface in the format of mmm/dd/yyy.
    when i tried to insert data in this format,
    insert into temp values('10-july-2000);
    insert into temp values('july-10-2000');
    the first statement is working fine. and the second statement is givine msg,
    SQL> insert into temp values('10-july-1999');
    1 row created.
    SQL> insert into temp values('july-10-1999');
    insert into temp values('july-10-1999')
    ERROR at line 1:
    ORA-01858: a non-numeric character was found where a numeric was expected
    how to get this.
    regards
    pavan

    I have read that ALTER SYSTEM changes will be effective immediately and there is no need to bounce the database.
    right but if parameter is "modifiable" if not then we need to "restart database"
    there three parameter with "alter system .... cmd"
    1. Memory
    2. Spfile ------------effect in next startup
    3. Both ( Memory + spfile) Default
    hope this helps
    Let take example : PROCESSES is not modifiable parameter.
    SQL> show parameter process
    NAME                                 TYPE        VALUE
    processes                            integer     150
    SQL> alter system set processes = 152 scope=both
      2  /
    alter system set processes = 152 scope=both
    ERROR at line 1:
    ORA-02095: specified initialization parameter cannot be modified
    SQL> alter system set processes = 152 scope=memory
      2  /
    alter system set processes = 152 scope=memory
    ERROR at line 1:
    ORA-02095: specified initialization parameter cannot be modified
    SQL> alter system set processes = 152 scope=spfile;
    System altered.
    SQL> show parameter processes
    NAME                                 TYPE        VALUE
    processes                            integer     150
    SQL> startup force
    ORA-01031: insufficient privileges
    SQL> conn sys as sysdba
    Enter password:
    Connected.
    SQL> startup force
    ORACLE instance started.
    Total System Global Area  171966464 bytes
    Fixed Size                   787988 bytes
    Variable Size             145488364 bytes
    Database Buffers           25165824 bytes
    Redo Buffers                 524288 bytes
    Database mounted.
    Database opened.
    SQL>
    SQL> show parameter processes
    NAME                                 TYPE        VALUE
    processes                            integer     152
    SQL>Message was edited by:
    user52

  • How to convert date  into dd mon yyyy format

    hi all,
    i have a problem in date format i am using date like below .
    <%java.util.Date date = new java.util.Date();%>
    i am inserting date into a table and its storing like this
    insert into tablename (d_date) values (date)
    and its inserting date like below
    Sun Oct 19 09:05:45 GMT+03:00 2003
    i want to fetch date in dd mon yyyy format.
    with this format i want to make a select query.i struck with the format conversion.
    how to do this.
    any comments please.
    any help

    hi all,
    i understand now where i am wrong.
    the below code is not working why because in my server where i am executing code the regional setting month value is in arabic.
    i executed the same code in a different server where date and time jones are english its working fine.
    All the problem is in regional setting and not the jsp code.
    <%
    String whtEverDateFormatYouWAnt = "dd MMM yy";
    String str = new SimpleDateFormat(whtEverDateFormatYouWAnt).format(new SimpleDateFormat("EEE MMM dd HH:mm:ss vvv yyyy").parse("Sun Oct 19 09:05:45 GMT+03:00 2003"));
    out.print(str);
    %>
    Thanks a lot for the excellent solution.
    Thanks again.

  • How to get date in dd/mm/yyyy format ?

    Hello,
    for this query :
    >select to_date(to_char(sysdate),'dd/mm/yyyy') from dual;
    i wanted to get date in dd/mm/yyyy format , but this query is not returning in correct date format .
    How to get that ?

    select id,
    to_date(to_char(dt1,'mm/dd/yyyy'),'dd/mm/yyyy') dt1,
    to_date(to_char(dt2,'mm/dd/yyyy'),'dd/mm/yyyy') dt2
    from t_table1 where no=23;This is my actual query.
    But this query is giving error.
    ORA-01843: not a valid monthWhen i issued this query :
    select id,dt1,dt2 from t_table1 where no=23 ;
    this is the output :
    ID DT1 DT2
    001 10/7/2011 10/19/2011Edited by: bootstrap on Oct 8, 2011 2:13 PM
    Edited by: bootstrap on Oct 8, 2011 2:13 PM

  • Insert date in dd-mmm-yyyy format

    I have a jsp page, from that i can enter values in oracle database.
    my jsp page is working, but the problem is that it can only accept the date
    dd-mmm-yyyy format. i.e 20-jun-2004, but when i enter date in dd/mm/yyyy format i.e 20/06/2004, it does not accept.
    i want to enter to do enter date in dd/mm/yyyy format in the form, and it can save the date field in database in dd-mmm-yyyy format.
    my code is as bellow:
    <html>
    <body>
    <table>
    <tr>
    <td>
    <%@ page import =" java.sql.Date.*" %>
    <%@ page import =" java.text.SimpleDateFormat.*" %>
    <%@ page import =" java.util.Date.*" %>
    <%@ page import =" java.text.*" %>
    <%@ page import="javax.servlet.*" %>
    <%@ page import="javax.servlet.http.*" %>
    <%@ page language="java" import="java.sql.*" %>
    <%
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection conn=DriverManager.getConnection("jdbc:odbc:pf","scott","ttlscott");
    System.out.println("got connection");
    %>
    <%
    char pay_post,pay_type;
    String action = request.getParameter("action");
    if (action != null && action.equals("save")) {
    conn.setAutoCommit(false);
    PreparedStatement pstmt = conn.prepareStatement(
    ("INSERT INTO pay_header VALUES (?, ?, ?, ?, ?, ?,?,?)"));
    pstmt.setString(1,request.getParameter("vou_no"));
    pstmt.setString(2,request.getParameter("pay_date"));
    pstmt.setString(3,request.getParameter("pay_post"));
    pstmt.setString(4,request.getParameter("pay_narr"));
    pstmt.setString(5, request.getParameter("chq_no"));
    pstmt.setString(6,request.getParameter("chq_date"));
    pstmt.setFloat(7,Float.parseFloat(request.getParameter("chq_amt")));
    pstmt.setString(8,request.getParameter("pay_type"));
    pstmt.executeUpdate();
    conn.commit();
    conn.setAutoCommit(true);
    %>
    <%
    Statement statement = conn.createStatement();
    ResultSet rs = statement.executeQuery
    ("SELECT * FROM pay_header ");
    %>
    <tr>
    <form action="payment_save1.jsp" method="get">
    <input type="hidden" value="save" name="action">
    <th><input value="" name="vou_no" size="10"></th>
    <th><input value="" name="pay_date" size="10"></th>
    <th><input value="" name="pay_post" size="15"></th>
    <th><input value="" name="pay_narr" size="15"></th>
    <th><input value="" name="chq_no" size="15"></th>
    <th><input value="" name="chq_date" size="15"></th>
    <th><input value="" name="chq_amt" size="15"></th>]
    <th><input value="" name="pay_type" size="15"></th>
    <th><input type="submit" value="save"></th>
    </form>
    </tr>
    <%
    while ( rs.next() ) {
    %>
    <tr>
    <form action="payment_save1.jsp" method="get">
    <input type="hidden" value="save" name="action">
    <td><input value="<%= rs.getString("vou_no") %>" name="vou_no"></td>
    <td><input value="<%= rs.getDate("pay_date") %>" name="gl_descr"></td>
    <td><input value="<%= rs.getString("pay_post") %>" name="pay_post"></td>
    <td><input value="<%= rs.getString("pay_narr") %>" name="pay_narr"></td>
    <td><input value="<%= rs.getString("chq_no") %>" name="chq_no"></td>
    <td><input value="<%= rs.getDate("chq_date") %>" name="chq_date"></td>
    <td><input value="<%= rs.getFloat("chq_amt") %>" name="chq_amt"></td>
    <td><input value="<%= rs.getString("pay_type") %>" name="pay_type"></td>
    <td><input type="submit" value="save"></td>
    </form>
    </tr>
    <%
    %>
    </table>
    <%
    // Close the ResultSet
    rs.close();
    // Close the Statement
    statement.close();
    // Close the Connection
    conn.close();
    } catch (SQLException sqle) {
    out.println(sqle.getMessage());
    } catch (Exception e) {
    out.println(e.getMessage());
    %>
    </td>
    </tr>
    </body>
    </html>

    thanx for u r help..
    now i have used simple date format method and also apllied setDate() method.
    bit its coming error NULL
    code:
    SimpleDateFormat sdf = new SimpleDateFormat("dd/mm/yyyy");
    java.util.Date pay_date_temp = null;
    java.util.Date pay_post_temp = null;
    PreparedStatement pstmt = conn.prepareStatement(
    ("INSERT INTO pay_header VALUES (?, ?, ?, ?, ?, ?,?,?)"));
    java.sql.Date pay_date = new java.sql.Date(pay_date_temp.getTime());
    java.sql.Date chq_date = new java.sql.Date(pay_post_temp.getTime());
    pstmt.setString(1,request.getParameter("vou_no"));
    pstmt.setDate(2,pay_date);
    pstmt.setString(3,request.getParameter("pay_post"));
    pstmt.setString(4,request.getParameter("pay_narr"));
    pstmt.setString(5, request.getParameter("chq_no"));
    pstmt.setDate(6,chq_date);
    pstmt.setFloat(7,Float.parseFloat(request.getParameter("chq_amt")));
    pstmt.setString(8,request.getParameter("pay_type"));
    help me

  • Inserting dates in mm/dd/yyyy format in excel sheet

    I am reading data from sql server 2005 which returns dates in the yyyy/mm/dd format. Now I have to insert this data into an excel sheet and it is supposed to be in the mm/dd/yyyy format. I tried converting the date formats in java but when I insert the date as a String the program throws
    java.sql.SQLException: [Microsoft][ODBC Excel Driver] Data type mismatch in criteria expression.
    If I try to insert it as a java.util.Date or java.sql.Date it also includes the timestamp(which i do not want ) since thats the way MS SQL Server returns it in the result set.
    Someone said using PreparedStatement would help. How?
    Can someone please help me ?

    neoforu7 wrote:
    I have to insert data into excel sheets that already have pre defined macroes that do some calculations and get the data in the format i want. I dont know if this is possible with POI or JExcel. You most definitely not are going to find that in ODBC. The excel odbc driver does very, very little.
    [http://support.microsoft.com/kb/178717]
    And I also dont have the time to learn these. So please help me if u canSorry - then you should just tell someone that it isn't going to happen.
    Your requirements, excel and macros, is going to take a LOT of time.
    At a minimum, without seeing the exact requirements and macros, myself I wouldn't start with less than three months of time.

  • How to Insert data from an XML file into an Oracle 10g table

    Hello,
    Please can you help me as I have hit a brick wall with this problem.
    We are running version 10g Oracle and we will start receiving XML files with employee data that needs loading into a table, this is the XML file:
    <?xml version="1.0"?>
    <RECRUITS>
    <RECRUIT>
    <FIRST_NAME>Gordon</FIRST_NAME>
    <LAST_NAME>Brown</LAST_NAME>
    <SHORT_NAME>GORDONBROWN</SHORT_NAME>
    <APP_NO>00002</APP_NO>
    <STATUS>M</STATUS>
    <DATE_FROM>21-JUL-2006</DATE_FROM>
    <RESOURCE_TYPE>P</RESOURCE_TYPE>
    <TITLE>Mr</TITLE>
    <DATE_OF_BIRTH>28-DEC-1983</DATE_OF_BIRTH>
    <SOCIAL_SEC>AB128456A</SOCIAL_SEC>
    <PARTTIME_PCT>1</PARTTIME_PCT>
    <SEX>M</SEX>
    <ADDRESS_TYPE>1</ADDRESS_TYPE>
    <ADDRESS>A HOUSE SOMEWHERE HERE</ADDRESS>
    <ZIP_CODE>PE3 LLL</ZIP_CODE>
    <PLACE>BOROUGH</PLACE>
    <COUNTRY_CODE>UK</COUNTRY_CODE>
    <PROVINCE>UK</PROVINCE>
    <EMAIL>[email protected]</EMAIL>
    </RECRUIT>
    (FYI - there may be more than 1 employee in each file so all of the above will be repeated X amount of times)
    </RECRUITS>
    To make things simple we have created a table which mirrors the XML file completely to load the data into, the SQL i have used is thus:
    CREATE TABLE RECRUITMENT
    FIRST_NAME VARCHAR2(30),
    LAST_NAME VARCHAR2(30),
    SHORT_NAME VARCHAR2(30),
    APP_NO NUMBER,
    STATUS VARCHAR2(1),
    DATE_FROM DATE,
    RESOURCE_TYPE VARCHAR2(1),
    TITLE VARCHAR2(4),
    DATE_OF_BIRTH DATE,
    SOCIAL_SEC VARCHAR2(9),
    PARTTIME_PCT NUMBER,
    SEX VARCHAR2(1),
    ADDRESS_TYPE VARCHAR2(1),
    ADDRESS VARCHAR2(30),
    ZIP_CODE VARCHAR2(8),
    PLACE VARCHAR2(10),
    PROVINCE VARCHAR2(3),
    EMAIL VARCHAR2(20)
    Every method we try from the numerous documents and so called "user guides" have failed, please can somebody show me the PL/SQL i need to get this files data into the above table?
    We need to be able to do this purely through SQL*PLUS as we hope - if we ever get it working manually to create a procuedure that will encapsulate everything so it can be run over and over again.
    The XML file is sitting in the XMLDIR and is called REC.XML.
    Please help : (

    Hi, I have got some material for inserting data into oracle table from xml file, this might help you.
    Create XML Document Table
    create table XML_DOCUMENT_TABLE
    FILENAME varchar2(64),
    XML_DOCUMENT XMLTYPE
    (This will be as per your record details).
    Inserting record to Oracle Table
    declare
    XML_TEXT CLOB := '<smsnotification>
                   <messageid> 256427844 </messageid>
              <protocolid> CO0NPS2KHQ </protocolid>
              <notifiedon> 1156123007416 </notifiedon>
              <status> 3PBI: Invalid </status>
    <additionalinfo> Customer account not active </additionalinfo>
    <carrierid> 1175 </carrierid>
    </smsnotification>';
    begin
    insert into XML_DOCUMENT_TABLE values ('Receipt.xml',XMLTYPE(XML_TEXT));
    end;
    Select Statement
    select extractValue(XML_DOCUMENT,'/smsnotification/messageid') Messageid,
    extractValue(XML_DOCUMENT,'/smsnotification/status') Status,
    extractValue(XML_DOCUMENT,'/smsnotification/carrierid') CarrierID
    from XML_DOCUMENT_TABLE;

  • How to print date in dd/MM/yyyy format??

    Hi All,
    I want to print a date in a dd/MM/yyyy format. I am doing like this
    Date d = new Date(23-11-2006); but it is printing
    like Wed Dec 31 18:59:58 EST 1969 .
    Please help me .

    I am doing like this
    Date d = new Date(23-11-2006); but it is
    printing No you're not, because that won't compile. Show us exactly what you're doing and we might be able to help.
    You seem to suggest you want to print a date in a certain format, but then the (pseudo-) code you present seems to suggest you want to be able to parse a date from a given format into a Date object.
    Be clear and specific about exactly what you want, what you have tried, and why it didn't work and then people will be better placed to help! :-)

  • How to insert data into the mysql table by giving as a text file

    Hi,
    Any one know's how to insert data into the mysql table by giving as a text file as the input in JSP.Please respond ASAP.
    Thanks:)

    At least you can try StringTokenizer to parse your text files. Or download a text JDBC driver to parse your files, for instance, HXTT Text(www.hxtt.net) or StelsCSV(www.csv-jdbc.com).

  • How to insert data into a table from an xml document

    using the XmlSql Utility, how do I insert data into a table from an xml document, using the sqlplus prompt.
    if i use the xmlgen.insertXML(....)
    requires a CLOB file, which i dont have, only the xml doc.
    Cant i insert directly from the doc to the table?
    the xmlgen examples I have seen first convert a table to a CLOB xmlString and then insert it into another table.
    Isnt there any other way?

    Your question is little perplexing.
    If you're using XML SQL Utility from
    the commandline, just use putXML.
    java OracleXML putXML
    null

  • How to insert data from site into DB?

    Hi
    Does anyone know how to insert data into a database from a
    website?
    I have created a Registration form for users to register to
    my web site. With this I would like the data they have entered to
    be stored in a MySQL database. I have created the a form and used
    the record insertion form wizard.
    When they have registered, I need to be able to check their
    username every time they log in.
    If anyone could help, it would be greatly appreciated,
    thanks Lou.

    LoobieLouLou wrote:
    > When I inserted a form, I enetered a name and the method
    was POST, but it also needed an action.
    > How do I write in java script that it needs to be
    inserted into the database?
    You can't do it with JavaScript. You need to use a
    server-side language
    like ASP, ASP.NET, ColdFusion, or PHP. Dreamweaver automates
    a lot of
    the process for you, but you need to choose your server model
    first.
    It sounds as though you are completely new to this. First ask
    your
    hosting company whether it supports a server-side language,
    and if so,
    which one. Then open Dreamweaver help (F1) and read the
    section titled
    "Preparing to Build Dynamic Sites".
    Working with server-side languages and databases isn't
    difficult, but
    it's not something you can pick up in five minutes or be
    shown how to do
    in a couple of forum posts.
    If you can't make up your mind which server-side language to
    use,
    ASP.NET is the most difficult of the four I mentioned. ASP is
    popular,
    but is no longer actively developed, so will eventually die
    out
    (although it will take many years to do so). ColdFusion and
    PHP are
    relatively easy to learn. I prefer PHP, but all of them do
    basically the
    same thing. However, you must choose one; they cannot be
    mixed.
    David Powers, Adobe Community Expert
    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • *Urgent*How to insert data from MS SQL to the table that create at the adobe form?

    Hi,
    I'm using Adobe life cycle designer 8 to do my interactive form. I would like to ask how to insert data from MS SQL to the table that i have created in my adobe interactive form?
    I really need the information ASAP as i need to hand in my project by next week... i really appreciate any one who reply this post.
    Thanks

    Tou need to do a couple of things
    1. On the Essbase server, set up an odbc system connection to your MySQL database
    2. In the load rule , go to the file menu and select open SQL data source and in the data source put in your SQL statement . A couple of hints. Where it says Select, don't put in the word select and where it say from don't put in from. The system adds them for you. The easiest way ti enter a SQL statement is to do it all in the select area So if your SQL would normanlly say select * from mytable just enter the code as * from mytable in the select area
    The click ol/retrieve and enter in your connection info. Itshould bring data back into the load rule. Save the load rule and use it

  • Insertion of date in dd-mmm-yyyy format

    I have a jsp page, from that i can enter values in oracle database.
    my jsp page is working, but the problem is that it can only accept the date
    dd-mmm-yyyy format. i.e 20-jun-2004, but when i enter date in dd/mm/yyyy format i.e 20/06/2004, it does not accept.
    i want to enter to do enter date in dd/mm/yyyy format in the form, and it can save the date field in database in dd-mmm-yyyy format.
    my code is as bellow:
    <html>
    <body>
    <table>
    <tr>
    <td>
    <%@ page import =" java.sql.Date.*" %>
    <%@ page import =" java.text.SimpleDateFormat.*" %>
    <%@ page import =" java.util.Date.*" %>
    <%@ page import =" java.text.*" %>
    <%@ page import="javax.servlet.*" %>
    <%@ page import="javax.servlet.http.*" %>
    <%@ page language="java" import="java.sql.*" %>
    <%
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection conn=DriverManager.getConnection("jdbc:odbc:pf","scott","ttlscott");
    System.out.println("got connection");
    %>
    <%
    char pay_post,pay_type;
    String action = request.getParameter("action");
    if (action != null && action.equals("save")) {
    conn.setAutoCommit(false);
    PreparedStatement pstmt = conn.prepareStatement(
    ("INSERT INTO pay_header VALUES (?, ?, ?, ?, ?, ?,?,?)"));
    pstmt.setString(1,request.getParameter("vou_no"));
    pstmt.setString(2,request.getParameter("pay_date"));
    pstmt.setString(3,request.getParameter("pay_post"));
    pstmt.setString(4,request.getParameter("pay_narr"));
    pstmt.setString(5, request.getParameter("chq_no"));
    pstmt.setString(6,request.getParameter("chq_date"));
    pstmt.setFloat(7,Float.parseFloat(request.getParameter("chq_amt")));
    pstmt.setString(8,request.getParameter("pay_type"));
    pstmt.executeUpdate();
    conn.commit();
    conn.setAutoCommit(true);
    %>
    <%
    Statement statement = conn.createStatement();
    ResultSet rs = statement.executeQuery
    ("SELECT * FROM pay_header ");
    %>
    <tr>
    <form action="payment_save1.jsp" method="get">
    <input type="hidden" value="save" name="action">
    <th><input value="" name="vou_no" size="10"></th>
    <th><input value="" name="pay_date" size="10"></th>
    <th><input value="" name="pay_post" size="15"></th>
    <th><input value="" name="pay_narr" size="15"></th>
    <th><input value="" name="chq_no" size="15"></th>
    <th><input value="" name="chq_date" size="15"></th>
    <th><input value="" name="chq_amt" size="15"></th>]
    <th><input value="" name="pay_type" size="15"></th>
    <th><input type="submit" value="save"></th>
    </form>
    </tr>
    <%
    while ( rs.next() ) {
    %>
    <tr>
    <form action="payment_save1.jsp" method="get">
    <input type="hidden" value="save" name="action">
    <td><input value="<%= rs.getString("vou_no") %>" name="vou_no"></td>
    <td><input value="<%= rs.getDate("pay_date") %>" name="gl_descr"></td>
    <td><input value="<%= rs.getString("pay_post") %>" name="pay_post"></td>
    <td><input value="<%= rs.getString("pay_narr") %>" name="pay_narr"></td>
    <td><input value="<%= rs.getString("chq_no") %>" name="chq_no"></td>
    <td><input value="<%= rs.getDate("chq_date") %>" name="chq_date"></td>
    <td><input value="<%= rs.getFloat("chq_amt") %>" name="chq_amt"></td>
    <td><input value="<%= rs.getString("pay_type") %>" name="pay_type"></td>
    <td><input type="submit" value="save"></td>
    </form>
    </tr>
    <%
    %>
    </table>
    <%
    // Close the ResultSet
    rs.close();
    // Close the Statement
    statement.close();
    // Close the Connection
    conn.close();
    } catch (SQLException sqle) {
    out.println(sqle.getMessage());
    } catch (Exception e) {
    out.println(e.getMessage());
    %>
    </td>
    </tr>
    </body>
    </html>

    thanx for u r help..
    now i have used simple date format method and also apllied setDate() method.
    bit its coming error NULL
    code:
    SimpleDateFormat sdf = new SimpleDateFormat("dd/mm/yyyy");
    java.util.Date pay_date_temp = null;
    java.util.Date pay_post_temp = null;
    PreparedStatement pstmt = conn.prepareStatement(
    ("INSERT INTO pay_header VALUES (?, ?, ?, ?, ?, ?,?,?)"));
    java.sql.Date pay_date = new java.sql.Date(pay_date_temp.getTime());
    java.sql.Date chq_date = new java.sql.Date(pay_post_temp.getTime());
    pstmt.setString(1,request.getParameter("vou_no"));
    pstmt.setDate(2,pay_date);
    pstmt.setString(3,request.getParameter("pay_post"));
    pstmt.setString(4,request.getParameter("pay_narr"));
    pstmt.setString(5, request.getParameter("chq_no"));
    pstmt.setDate(6,chq_date);
    pstmt.setFloat(7,Float.parseFloat(request.getParameter("chq_amt")));
    pstmt.setString(8,request.getParameter("pay_type"));
    help me

  • Its very urgent:how to insert data into database tables

    Hi All,
    I am very new to oaf.
    I have one requirement data insert into database tables.
    here createPG having data that data insert into one custom table.
    but i dont know how to insert data into database tables.
    i wrote the code in am,co as follows.
    in am i wrote the code:
    public void NewoperationManagerLogic()
    ManagerCustomTableVOImpl vo1=getManagerCustomTableVO1();
    OADBTransaction oadbt=getOADBTransaction();
    if(!vo1.isPreparedForExecution())
    vo1.executeQuery();
    Row row=vo1.createRow();
    vo1.insertRow(row);
    in createPG processrequest co:
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    ManagerInformationAMImpl am=(ManagerInformationAMImpl)pageContext.getApplicationModule(webBean);
    am.NewoperationManagerLogic();
    process form request:
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    if(pageContext.getParameter("Submit")!=null)
    ManagerInformationAMImpl am=(ManagerInformationAMImpl)pageContext.getApplicationModule(webBean);
    am.getOADBTransaction().commit();
    please help with an example(sample code).
    its very urgent.
    thanks in advance
    Seshu
    Edited by: its urgent on Dec 25, 2011 9:31 PM

    Hi ,
    1.)You must have to create a EO based on custom table and then VO based on this EO eventually to save the values in DB
    2.) the row.setNewRowState(Row.STATUS_INITIALIZED); is used to set the the status of row as inialized ,this is must required.
    3.) When u will create the VO based on EO the viewattributes will be created in VO which will be assigned to the fields to take care the db handling .
    You must go thtough the lab excercise shipped with you Jdeveloper ,there is a example of Create Employee page ,that will solve your number of doubts.
    Thanks
    Pratap

  • How to insert date in pages

    How to insert date and time using PAGES via IPAD

    How to insert date and time using PAGES via IPAD

Maybe you are looking for

  • Wrong idea to upgrade to Forceware Audio Driver 4.31?!

    Just installed the Forceware Audio Driver 4.31. New GUI. New nvMixer. Looks cool, but it seems less configurable items. The worst thing - I lost the CENTER SPEAKER output!!   Before 4.31, center speaker was a configurable item in the nForce control p

  • Replace XML is not working

    Hi, I'm trying to load some content into flash from an XML rss feed. I took the original code from gotoandlearn, and all I added was some buttons to make this content change. that is, when I click on a button, the xml has to be replaced for another o

  • GET Payroll in logical data should be used or not?

    Hi All, Should we be using the GET payroll to fetch the payroll results using the logical database PNP? As the GET PAYROLL is not supported by the logical data base PNPCE. I know 2 ways of fetching the payroll data. 1) using the function modules 2) u

  • Missing windows service for Oracle Enterprise manager

    I have installed Oracle database 10G R1 (without seed database), and applied patchset 10.1.0.4. I have used the DBCA to create a database instance, which was created successfully (see note1). However the windows service for the OEM DBconsole has not

  • REINSTALL I-TUNES

    I have been in iTunes all day building new playlists and cleaning up my library. While trying to get into the iTunes store, the window suddenly closed. I went to my desktop and clicked on my iTunes icon. I got the following message: iTunes cannot run