How to involve time in a date column in JDBC OCI 8.0.5.2.

Hi,
I need to involve time in a date column in JDBC OCI 8.0.5.2.
The default date format is like "09-Sep-1999". I could use it
but just need time involved too, like "09-Sep-1999 10:11:12".
I tried to use JDBC's Timestamp whose format is like
1999-9-9 12:00:00.000, just same as the dates selected from my
table,
but got an error message "literal doesn't match format string".
The JDBC document said Oracle's date could be JDBC date,
timestamp and char.
Thanks a lot!
-Ninon
null

: The only oracle driver that vcan run with JDK 1.2.x is in the
OTN
: download area and is named "816SDK for JDK 1.2"
: it will work with the JDK 1.2.X using the JDBC 1.22 spec from
JDK
: 1.1.X.
: IT DOES NOT PROVIDE THE FULL JDBC 2.0 FEATURES/ FUNCTIONALITY
: THAT ARE INCLUDED IN THE JDK 1.2.X CLASSES.
Does anyone know which versions of Oracle this driver will work
with? I'm trying to use JDK 1.2 and Oracle 8.04 with the above
mentioned driver, but it's misbehaving on prepared statements:
I'm getting a 'ORA-8001 not all variables bound' error even
though I'm correctly specifying binary data (using
PreparedStatement.setBytes(..)) for a LONG RAW column...
Please don't tell me I have to upgrade my Oracle installation in
order to use JDBC with JDK 1.2.x
Feedback is greatly appreciated!
thanks!
// Tor Kleiberg
null

Similar Messages

  • Creating Time Dimension from date columns in fact tables.

    I remember watching a demo from a BI Tool a couple years ago, wich I swear was OBIEE, and the presentator stated it was possible to create a Time Dimension in the admin tool, based on a date column in other table.
    Can you guys tell me if there's such functionality in OBIEE?
    If so, how could I achieve that?!
    Thanks in advance!
    Marcos

    hi,
    You are trying to make Fact table as Dim table ???
    Fact table has some dim columns??
    We can do this by making a fact table as dim table ,create a dim hierarchy on that table
    Year level :Extract(year from fact_date_column)
    Month and year  level:CAST (Extract(month from fact_date_column) As CHAR(5) ) || CAST (Extract(yearfrom fact_date_column) As CHAR(5) )
    Like this
    But,be careful while doing this make sure that all joins and content levels are good
    As per my knowledge this is not a good way,Experts can add some words lets see!!!!!! :-)
    thanks,
    saichand.v

  • [2197] Run as script losing time part of date columns.

    Date columns are being displayed in script output as xxxxx 00:00:00 regardless of the actual time element.
    This code -
    select sysdate from dual;
    insert into xx(aa) values (to_date('30-nov-2006 13:14:00','dd-mon-yyyy hh24:mi:ss'));
    select * from xx;produces this output
    SYSDATE
    30-nov-2006 00:00:00
    1 rows selected
    1 rows inserted
    AA                        AB
    30-nov-2006 00:00:00
    1 rows selectedI have nls_date_format set to 'dd-mon-yyyy hh24:mi:ss' in preferences and the dates are displayed properly in the results pane.
    Message was edited by:
    smitjb

    Verified. Thanks, I have logged a bug.
    Sue

  • How InfoSpoke reads time dependent master data ?

    Hello Experts !!
    How InfoSpoke reads the time dependent master data ?
    What key date it reffers to ?
    Can you please explain, I want to use this concept in writing master data lookup for time dependent attributes of 0MATERIAL.
    Thank a lot !

    You can either specify the time period in the filtering area of infospoke or you can implement a transformation BAdI -OPENHUB_TRANSFORM to manipulate the data whichever way that suites your requirement. All time dependent infobjects have datefrom and dateto fields which you can use to choose your data range accordingly.
    Hope this helped you.

  • How to remove time zone from date time column?

    Hello all,
    I have one birthday calendar list where I am showing birthdays of employees in acompany.
    Now when I display Date in a page I am getting the below output:
    Fri Sep 19 2014 00:00:00 GMT-0700 (Pacific Standard Time)
    Here I just want the below thing as an output:
    Fri Sep 19 2014
    the other things like 00:00:00 GMT-0700 (Pacific Standard Time)
    How should I achieve it?
    Thanks in Advance.

    Hi
    you should use XSLT datetime formatting
    http://amavs.wordpress.com/tag/formatdatetime/
    Romeo Donca, Orange Romania (MCSE, MCITP, CCNA) Please Mark As Answer if my post solves your problem or Vote As Helpful if the post has been helpful for you.

  • How to display time duration (NOT dates) with an input mask in a JTable?

    Background: I am trying to display in a JTable, in two columns, the start position and time duration of an audio clip.
    They are stored as type float internally eg. startPosition = 72.7 seconds.
    However I wish to display on screen in the table in HH:mm:ss:S format. eg. 00:01:12:7. The user can edit the cell and input values to update the internal member fields.
    Problem: I am finding it very difficult to implement this - what with the interactions of MaskFormatter, DefaultCellEditor etc.
    Also using SimpleDateFormat and DateFormatter does not work as they insist on displaying the day, month, year also in the table cell.
    Taking the Swing Tutorial TableFTFEditDemo example as a template,
    (http://java.sun.com/docs/books/tutorial/uiswing/components/example-1dot4/index.html#TableFTFEditDemo)
    does anyone know how to do this?
    I can post my (buggy) modifications to the example code - if it would help.
    Appreciate any help.
    thanks,
    Anil

    Here are my modifications to the TableFTFEditDemo example. If you run it, you get an exception
    like java.lang.NumberFormatException: For input string: "18:00:03.500"
    The two modified classes are taken from the Tutorial and are listed below:
    =================
    * IntegerEditor is a 1.4 class used by TableFTFEditDemo.java.
    import javax.swing.AbstractAction;
    import javax.swing.BorderFactory;
    import javax.swing.DefaultCellEditor;
    import javax.swing.JFormattedTextField;
    import javax.swing.JOptionPane;
    import javax.swing.JTable;
    import javax.swing.JTextField;
    import javax.swing.KeyStroke;
    import javax.swing.SwingUtilities;
    import java.awt.event.ActionEvent;
    import java.awt.event.KeyEvent;
    import java.awt.Color;
    import java.awt.Component;
    import java.awt.Toolkit;
    import java.text.DateFormat;
    import java.text.NumberFormat;
    import java.text.ParseException;
    import java.text.SimpleDateFormat;
    import java.util.Calendar;
    import java.util.Date;
    import javax.swing.text.DateFormatter;
    import javax.swing.text.DefaultFormatterFactory;
    import javax.swing.text.MaskFormatter;
    import javax.swing.text.NumberFormatter;
    class TimeRenderer {
         float seconds;
         TimeRenderer(String str) {
              int hSec = Integer.parseInt(str.substring(0,2)) * 60 * 60;
              int mSec = Integer.parseInt(str.substring(2,4)) * 60;
              int sSec = Integer.parseInt(str.substring(4,6));
              float tSec = Integer.parseInt(str.substring(6,7))/10.0F;
              seconds = hSec + mSec + sSec + tSec;
    * Implements a cell editor that uses a formatted text field to edit Integer
    * values.
    public class IntegerEditor extends DefaultCellEditor {
         JFormattedTextField ftf;
         static Date zeroTime = new Date(0L);
         private boolean DEBUG = true;
         SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss.S");
         MaskFormatter maskFo = new MaskFormatter("##:##:##.#");
         protected MaskFormatter createFormatter(String s) {
              MaskFormatter formatter = null;
              try {
                   formatter = new MaskFormatter(s);
              } catch (java.text.ParseException exc) {
                   System.err.println("formatter is bad: " + exc.getMessage());
                   System.exit(-1);
              return formatter;
         public IntegerEditor(int min, int max) throws ParseException {
              super(new JFormattedTextField(new MaskFormatter("##:##:##.#")));
              ftf = (JFormattedTextField) getComponent();
              // Set up the editor for the cells.
              ftf.setFormatterFactory(new DefaultFormatterFactory(new DateFormatter(sdf)));
              ftf.setFocusLostBehavior(JFormattedTextField.PERSIST);
              // React when the user presses Enter while the editor is
              // active. (Tab is handled as specified by
              // JFormattedTextField's focusLostBehavior property.)
              ftf.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "check");
              ftf.getActionMap().put("check", new AbstractAction() {
                   public void actionPerformed(ActionEvent e) {
                        if (!ftf.isEditValid()) { // The text is invalid.
                             ftf.setBorder(BorderFactory.createLineBorder(Color.RED));
                             ftf.setBackground(Color.PINK);
                             ftf.postActionEvent(); // inform the editor
                        } else
                             try { // The text is valid,
                                  ftf.commitEdit(); // so use it.
                                  ftf.postActionEvent(); // stop editing
                             } catch (java.text.ParseException exc) {
         // Override to invoke setValue on the formatted text field.
         public Component getTableCellEditorComponent(JTable table, Object value,
                   boolean isSelected, int row, int column) {
              JFormattedTextField ftf = (JFormattedTextField) super
                        .getTableCellEditorComponent(table, value, isSelected, row, column);
              System.out.println("value:" + value);
    //          long milliseconds =(long) (Float.parseFloat(value.toString()) * 1000);
              long milliseconds =(long) (((Float) value).floatValue() * 1000);
              Date dt = new Date(milliseconds);
              ftf.setValue(dt);
              return ftf;
         // Override to ensure that the value remains an Integer.
         public Object getCellEditorValue() {
              JFormattedTextField ftf = (JFormattedTextField) getComponent();
              Object o = ftf.getValue();
              try {               
                   Calendar cal = Calendar.getInstance();
                   cal.setTime((Date)o);
                   float seconds = cal.getTimeInMillis()/1000.0F;
                   return sdf.format(o);
                   //return new Float(seconds);
              } catch (Exception exc) {
                   System.err.println("getCellEditorValue: can't parse o: " + o);
                   exc.printStackTrace();
                   return null;
         // Override to check whether the edit is valid,
         // setting the value if it is and complaining if
         // it isn't. If it's OK for the editor to go
         // away, we need to invoke the superclass's version
         // of this method so that everything gets cleaned up.
         public boolean stopCellEditing() {
              JFormattedTextField ftf = (JFormattedTextField) getComponent();
              if (ftf.isEditValid()) {
                   try {
                        ftf.commitEdit();
                   } catch (java.text.ParseException exc) {
              } else { // text is invalid
                   ftf.setBorder(BorderFactory.createLineBorder(Color.RED));
                   ftf.setBackground(Color.PINK);
                   return false; // don't let the editor go away
              return super.stopCellEditing();
    //=====================================================
    * TableFTFEditDemo.java is a 1.4 application that requires one other file:
    *   IntegerEditor.java
    import javax.swing.JFrame;
    import javax.swing.JDialog;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.table.AbstractTableModel;
    import java.awt.Dimension;
    import java.awt.GridLayout;
    import java.text.ParseException;
    * This is exactly like TableDemo, except that it uses a
    * custom cell editor to validate integer input.
    public class TableFTFEditDemo extends JPanel {
        private boolean DEBUG = false;
        public TableFTFEditDemo() throws ParseException {
            super(new GridLayout(1,0));
            JTable table = new JTable(new MyTableModel());
            table.setPreferredScrollableViewportSize(new Dimension(500, 70));
            //Create the scroll pane and add the table to it.
            JScrollPane scrollPane = new JScrollPane(table);
            //Set up stricter input validation for the integer column.
         //   table.setDefaultEditor(Float.class,
           //                        new IntegerEditor(0, 100));
         //If we didn't want this editor to be used for other
         //Integer columns, we'd do this:
         table.getColumnModel().getColumn(3).setCellEditor(
              new IntegerEditor(0, 100));
            //Add the scroll pane to this panel.
            add(scrollPane);
        class MyTableModel extends AbstractTableModel {
            private String[] columnNames = {"First Name",
                                            "Last Name",
                                            "Sport",
                                            "# of Years",
                                            "Vegetarian"};
            private Object[][] data = {
                {"Mary", "Campione",
                 "Snowboarding", new Float(5.7), new Boolean(false)},
                {"Alison", "Huml",
                 "Rowing", new Float(3.5), new Boolean(true)},
                {"Kathy", "Walrath",
                 "Knitting", new Float(2.9), new Boolean(false)},
                {"Sharon", "Zakhour",
                 "Speed reading", new Float(20.8), new Boolean(true)},
                {"Philip", "Milne",
                 "Pool", new Float(10.5), new Boolean(false)}
            public int getColumnCount() {
                return columnNames.length;
            public int getRowCount() {
                return data.length;
            public String getColumnName(int col) {
                return columnNames[col];
            public Object getValueAt(int row, int col) {
                return data[row][col];
             * JTable uses this method to determine the default renderer/
             * editor for each cell.  If we didn't implement this method,
             * then the last column would contain text ("true"/"false"),
             * rather than a check box.
            public Class getColumnClass(int c) {
                 Object obj = getValueAt(0, c);
                 System.out.println("getColumnClass.obj:" + obj);
                return obj.getClass();
            public boolean isCellEditable(int row, int col) {
                //Note that the data/cell address is constant,
                //no matter where the cell appears onscreen.
                if (col < 2) {
                    return false;
                } else {
                    return true;
            public void setValueAt(Object value, int row, int col) {
                if (DEBUG) {
                    System.out.println("Setting value at " + row + "," + col
                                       + " to " + value
                                       + " (an instance of "
                                       + value.getClass() + ")");
                data[row][col] = value;
                fireTableCellUpdated(row, col);
                if (DEBUG) {
                    System.out.println("New value of data:");
                    printDebugData();
            private void printDebugData() {
                int numRows = getRowCount();
                int numCols = getColumnCount();
                for (int i=0; i < numRows; i++) {
                    System.out.print("    row " + i + ":");
                    for (int j=0; j < numCols; j++) {
                        System.out.print("  " + data[i][j]);
                    System.out.println();
                System.out.println("--------------------------");
         * Create the GUI and show it.  For thread safety,
         * this method should be invoked from the
         * event-dispatching thread.
         * @throws ParseException
        private static void createAndShowGUI() throws ParseException {
            //Make sure we have nice window decorations.
            JFrame.setDefaultLookAndFeelDecorated(true);
            //Create and set up the window.
            JFrame frame = new JFrame("TableFTFEditDemo");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Create and set up the content pane.
            TableFTFEditDemo newContentPane = new TableFTFEditDemo();
            newContentPane.setOpaque(true); //content panes must be opaque
            frame.setContentPane(newContentPane);
            //Display the window.
            frame.pack();
            frame.setVisible(true);
        public static void main(String[] args) {
            //Schedule a job for the event-dispatching thread:
            //creating and showing this application's GUI.
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    try {
                             createAndShowGUI();
                        } catch (ParseException e) {
                             // TODO Auto-generated catch block
                             e.printStackTrace();
    }

  • How to load time only no date using sql loader

    I want to load just time portion from the data, the data looks like this
    08/10/09 ,FZ10, AD2R, DFHMIRS , 14, 01:12:07.001230, 01:02:07.112354, TRANS PURGED / TIMED OUT ,
    control file:
    LOAD DATA
    APPEND
    INTO TABLE TRANS_ABENDS
    FIELDS TERMINATED ',' TRAILING NULLCOLS
         TRANS_DATE           DATE "MM/DD/YYYY",
         TRANS_ID          ,
         ABEND_CODE          ,
         ABEND_PGM           ,
         ABEND_COUNT           ,
         RESPONSE_TIME      "to_date(:RESPONSE_TIME,'dd/mm/yy HH:MI:SS.ffffff')",
         CPU_TIME          "to_date(:RESPONSE_TIME,'dd/mm/yy HH:MI:SS.ffffff')",
         ABEND_RESOLUTION     ,
         INSTANCE          CONSTANT 'EAST'
    I can load the time using the control file but it adds the first of the month as date in the column. I want to load only time value. Appreciate any help on this.

    I meant, how are these columns defined in the table that is being loaded?
    If these are defined as DATE, then as was pointed out Oracle will default the date portions if they are not provided in the formatted string.
    If these are defined as NUMBER (with some fractional portion), then you could use a combination of substr, multiplication and concatenation to derive the time as number in the form <seconds>.<fractional seconds>.
    You could also look into the data type INTERVAL DAY TO SECOND.
    SQL> create table trans_abends (
      2   trans_date date,
      3   trans_id char(4),
      4   abend_code char(4),
      5   abend_pgm char(8),
      6   abend_count number(4),
      7   response_time interval day (0) to second (6),
      8   cpu_time interval day (0) to second (6)
      9  )
    10  /
    Table created.
    SQL> insert into trans_abends values (sysdate, 'xxxx', 'xxxx', 'xxxxxxxx', 1, to_dsinterval('+0 01:12:07.001230'), to_dsinterval('+0 01:02:07.112354') )
      2  /
    1 row created.
    SQL> select response_time, cpu_time from trans_abends;
    RESPONSE_TIME
    CPU_TIME
    +0 01:12:07.001230
    +0 01:02:07.112354For the sql loader control file, try
    "to_dsinterval('+0 '||:RESPONSE_TIME)"
    not tested.
    Edited by: user142857 on Nov 18, 2009 12:20 PM
    Edited by: user142857 on Nov 18, 2009 12:27 PM

  • How to create time dependant master data table in R/3?

    Hi gurus,
             I am new to BW.I try to execute the 'Time dependant Attribute' into BW.in my scenario my source system must give me the data like "salesrep ID,Manager ID,Date to,Date from,Sales region". I like to know how to define this master data in SAP R/3(Source system)?. Give me the steps to create master data table in R/3.
    Manager may change periodically.even i need to maintain all the changes in R/3.
    Thanks & Regards,
    Bharath

    built-in type method means.,
    there is no need to create data element and domain objects seperately for each and every field of the table which ever you are creating, system will implicitly fix the size based on the data type you selected....

  • How to Display Time-Dependent Characteristic Data In Query

    Hi Experts,
       I have encountered a problem. I want to use Time-Dependent Chart. And want to display different value according characteristc's valid from time. For Example,
    The Characteristic 0COSTCENTER has the navigation attribute 0COMPANY, The data as:
    0COSTCENTER   Valid from   Valid To       0COMPANY
    BW2305              20070101   20070430     A
    BW2305              20070501   99991231     B
    I want  the report  can display as :
    0COSTCENTER   Valid from   Valid To       0COMPANY  AMOUNT
    BW2305              20070101   20070430     A                  1000
    BW2305              20070501   99991231     B                  2000
    But when I set the query's key date 20070420, the report display as:
    0COSTCENTER   Valid from   Valid To       0COMPANY  AMOUNT
    BW2305              20070101   20070430     A                  1000
    BW2305              20070501   99991231     A                  2000
    when I set the query's key date 20070520, the report display as:
    0COSTCENTER   Valid from   Valid To       0COMPANY  AMOUNT
    BW2305              20070101   20070430     B                 1000
    BW2305              20070501   99991231     B                  2000
    Can anybody tell me how I can get report expected.
    Thanks in advance.
    SF

    Hi,
    1) Add the characterstics 0COSTCENTER ,0DATETO,DATEFROM and  0COMPANY to the cube.
    2) And also add these 4 IOs to the Communication structures which has update rules with the concern cube.
    3) I hope , you already have  0COSTCENTER in the Commnication structure and mapping for that infoobject at both Update rules and Transfer rules.
    4) Leave to the Blank(no mapping) mappings for the IOs 0DATETO,DATEFROM and  0COMPANY in the Transfer rules.But make 1:1 mapping in the Update rules for these 2 infoobjects.
    5) Write the below code in the strt routine of the Update rules:
    TYPES:  BEGIN OF type4.
          include structure like /BI0/QCOSTCENTER.
    TYPES END OF type4.
    DATA:
      ITAB4 TYPE STANDARD TABLE OF TYPE4
           WITH HEADER LINE
           WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.
    SELECT * FROM /BI0/QCOSTCENTER INTO CORRESPONDING FIELDS
    OF TABLE ITAB4
    WHERE OBJVERS = 'A'.
    loop at DATA_PACKAGE.
         READ TABLE ITAB4 WITH KEY COSTCENTER = DATA_PACKAGE-MATERIAL 
    DATETO LE DATA_PACKAGE-PSTNG_DATE
    DATEFROM GE DATA_PACKAGE-PSTNG_DATE.
                  IF SY-SUBRC EQ 0.
                    DATA_PACKAGE-DATETO = ITAB4-DATETO.
                    DATA_PACKAGE-DATEFROM = ITAB4-DATEFROM.
                    DATA_PACKAGE-COMP_CODE = ITAB4-COMP_CODE.
                  ENDIF.
                  Modify DATA_PACKAGE.
      endloop.
      ABORT = 0.
    Here I assumed you have Posting date in the Communication structure and used to map to Fiscalperiod of the cube.
    6) Do the Master data upload to Cost center and active the master data of it always before uploading the data to cube.
    7) Do the uploading to cube from Sratch.
    With rgds,
    Anil Kumar Sharma .P
    Message was edited by:
            Anil Kumar Sharma

  • How to match time alone (without date) in a query

    Hi, I have a date colum named timeprop, where a time value has been inserted through:
    DateFormat.getTimeInstance(DateFormat.MEDIUM, "de_DE").parse("11:12:13")
    In SQL developer I can check the inserted value as:
    select timeprop from version_table where timeprop is not null;
    getting:
    TIMEPROP
    01.01.1900 11:12:13
    so I guess Oracle added a default date as 1.01.1900. Ok.
    But if I run:
    select timeprop from version_table where timeprop = to_date('11:12:13', 'hh24:mi:ss');
    then I get no result. I succeed only after adding that default date to the query - by patching the format as well - e.g.
    select timeprop from version_table where timeprop = to_date('1.01.1900 11:12:13', 'dd.mm.yyyy hh24:mi:ss');
    Basically, no time alone in a query.
    Is this transformation always needed or am I missing anything from this game ?
    Server is 11gr1.
    Thanks.

    sperkmandl wrote:
    Hi, I have a date colum named timeprop, where a time value has been inserted through:
    DateFormat.getTimeInstance(DateFormat.MEDIUM, "de_DE").parse("11:12:13")I can only suppose that means that you are not using setTime().
    >
    In SQL developer I can check the inserted value as:
    select timeprop from version_table where timeprop is not null;
    If you database is NOT Oracle then now would be the time to state that.
    > Is this transformation always needed or am I missing anything from this game ?
    The data type in the database DDL is relevant.
    Oracle doesn't have any time only data types.
    So if and only if you (and everyone else) has inserted time values in a consistent manner then you could use normal comparison by using setTime().
    If that isn't true then you must craft Oracle PL/SQL to remove the time part of the timestamp values before you do your comparisions.

  • How to Access time capsule backup data on Airport Extreme

    Hi All,
    Thank you in advance.
    The Problem : One of our Mac Book Air was stolen and we have the MBA backed up on Airport Extreme.
    Currently we don't have another MBA that can do a full restore. I just want to access the Airport Extreme Time Capsule Data and get few files that is in the backups.
    I have been searching for a solution and still can't find a way to do this. It is just 1 set of files inside the backup.
    Thank you again for all the help.
    G

    Hi LaPastenague
    I went over the pondini.org website, however still I can't access other users data T
    I can go and review my own data.
    The Data is backed up ( shared ) on Time Capsule ( which means all the users in the same house uses this one single time capsule to backup )
    http://www.apple.com/airport-time-capsule/
    ## We currently don't know what was the username or password the user was using.
    I am also looking at the pondini.org and
    "With Accounts:  this allows setting up separate accounts, each with its own password and folder.  You can set up accounts and passwords that correspond to the ones on your Mac (but passwords must be changed separately), and/or you can create different ones.  Each account may have permission to Read, or Read and Write, or Not allowed.  This is not recommended for use with Time Machine backups, as no single user can see everything on the disk(s).  That's especially important if there's a space problem -- you'd have to connect with each account in turn to see the whole picture.  The backups for each Mac are protected by the usual permissions anyway, so in most cases this option is overkill.  There are also a few minor differences in the content of some of the windows when selecting the backup destinations"
    We are usuing this "With Accounts" settings

  • How can I insert a value into the Oracle Date column using JDBC?

    Suppose I have a table TEST created by "create table TEST (c1 INT, c2 Date);"
    Now I want to insert some proper value into the table TEST's column c2. I couldn't do that by TRYing using Java.sql.Date, Java.Util.Date, Java.String.
    Could anyone give me some suggestions by providing the sample code?
    Many thanks for your help!
    Wendy

    What about building the java string:
    "Insert into test (c1,d1) values ("+
    Integer.toString(var)+
    ", TO_DATE("
    formatYourDateVariableWithCalendarMethods
    ",'DD-MON-YYYY')"
    and executing it ??

  • How to Add Time in Date

    hi,
    how to add time in a date for example
    date='01-jan-2005 23:00' [dd-mon-yyyy hh24:mi]
    time (to add)='02:00' [hh24:mi]
    if any one hv any idea about. pls reply

    If you can get the time element into an INTERVAL DAY TO SECOND datatype, you can simply add the interval to the date, e.g:
    yourdate + NUMTODSINTERVAL(2,'HOUR')
    What is tricky is converting a string like '02:00' into an interval or a number. You could generate a numeric offset with something like:
    TO_DATE('02:00','HH24:MI') - TO_DATE('00:00','HH24:MI')
    which can then be added to the date
    SELECT TO_DATE('01-jan-2005 23:00', 'dd-mon-yyyy hh24:mi') +
           (TO_DATE('02:00','HH24:MI') - TO_DATE('00:00','HH24:MI'))
    FROM   dual;

  • Unable to insert date and time when using date datatype

    Hi
    I am hitting a bit of a problem when using the date datatype. When trying to save a row to the table where the field it throws an error ora 01830 and complains about converting the date format picture ends...etc. Now when I do the insert, I use the to_date function with the format of "dd-mon-yyyy hh24:mi:ss". Of course, when I remove the time element, everything is perfect.
    Checking sysdate, I noticed that the time element wasn't be displayed, and I used alter session set nls_date_format to set the date and time I want to save to the table, which worked!
    Then based on advice in a previous thread to permanently fix the problem, I used alter system set nls_date_format ="dd-mon-yyyy hh24:mi:ss" scope=spfile; This showed that it was altered, and I can see the setting in the em. In sqlplus, I shutdown the database, and restarted with startup mount; alter database open; and then selecting sysdate, it still shows the date as dd-mon-yy, and still no time! Checking the em, and looking up the nls_date_format the setting is still shown as "dd-mon-yyyy hh24:mi:ss".
    So, my question is this - what am I doing wrong? Why can't save date and time using date in Oracle 11g?????
    Thanks

    user633278 wrote:
    Hi
    I am hitting a bit of a problem when using the date datatype. When trying to save a row to the table where the field it throws an error ora 01830 and complains about converting the date format picture ends...etc. Now when I do the insert, I use the to_date function with the format of "dd-mon-yyyy hh24:mi:ss". Of course, when I remove the time element, everything is perfect.
    Checking sysdate, I noticed that the time element wasn't be displayed, and I used alter session set nls_date_format to set the date and time I want to save to the table, which worked!
    Then based on advice in a previous thread to permanently fix the problem, I used alter system set nls_date_format ="dd-mon-yyyy hh24:mi:ss" scope=spfile; This showed that it was altered, and I can see the setting in the em. In sqlplus, I shutdown the database, and restarted with startup mount; alter database open; and then selecting sysdate, it still shows the date as dd-mon-yy, and still no time! Checking the em, and looking up the nls_date_format the setting is still shown as "dd-mon-yyyy hh24:mi:ss".
    So, my question is this - what am I doing wrong? Why can't save date and time using date in Oracle 11g?????
    ThanksYou most certainly can save the time. A DATE column, by definition stores date and time. What you describe is a presentation problem, and setting nls_date_format at the system as an init parm is the weakest of all settings as it is overridden by several other locations.
    without seeing the exact sql that produced the error (not just your description of what you think you were doing) it is impossible to say for sure.
    However, I'd suggest you read http://edstevensdba.wordpress.com/2011/04/07/nls_date_format/

  • How to insert Time alone

    i got time alone if i insert this in datetime field while selecting will return with default date as 1st date of current month ... is there any other option other than
    varchar field....

    Hi,
    Starting in Oracle 9, there's a datatype INTERVAL DAY TO SECOND for storing times. It's described in the SQL Language manual.
    DATEs in Oracle always have a year, month and day.
    Rather than store time in a DATE column, you can it in a NUMBER column; units of 1 day would be convenient.

Maybe you are looking for

  • Configuring Mysql database in EJB  xml file for JBoss

    I am using Mysql as database , How to configure JBoss to use Mysql as the database when using ejb's( session beans) My ejb-jar.xml is as follows <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterpris

  • TS1424 How do I get a refund on an app download?

    I just downloaded and paid $14.99 for PocketCloud Pro.  I had NO IDEA that that was a MONTHLY FEE! I want my money back. Thanks

  • Freight & Insurance charges in po

    Hi, How to add freight charges & insurance charges in PO? here, only purchasing & ineventory modules. here they are following avg. costing. Pls help me. Thanks in advance.

  • Need to disable some cells in table

    Hi Gurus, I have a OAF table (region style Table )where there are coloums which has poplists. Depending upon some conditions I need to disable some cells say for eg. I need to disable 4th coloumn of 3rd row . How to go about it. Please advise. Regard

  • Will not let me update apps or add any and says account is disabled

    I had to change id due to my old account kept coming up disabled and now it keeps switching between accounts and it wont let me update any apps or add any. I previously had more apps but deleted them due to not enough storage for an ios update and no