Insert the date value in a table

Hello

I tried to update a table to insert the date in a date field. while I am running the query, it throws an error message like:

"
ORA-01830: date format picture ends before converting all of the input string
01830.00000 - "date format picture ends before converting all of the input string.
* Cause:
* Action:
"1830Error salesperson online: 1.


My update query is added under:

UPDATE PS_OBJCMTP_TMP SET LASTUPDOPRID = "PPLSOFT", LASTUPDDTTM = TO_DATE ('02-11 - 2002-12.14.09.000000 ',' YYYY-MM-DD - HH24.MI.) SS') WHERE OBJECTID1 = 3 AND OBJECTVALUE1 = 'EDIMAPPROPOP' AND OBJECTID2 = 0 AND OBJECTVALUE2 = '' AND OBJECTID3 = 0 AND OBJECTVALUE3 =' ' AND OBJECTID4 = 0 AND OBJECTVALUE4 = ' '



someone tell me how to solve this problem.

Simply speaking, you should cut ' 2002 - 02 - 11 - 12.14.09.000000'-' 2002 - 02 - 11 - 12.14.09'.
RPAD('2002-02-11-12.14.09.000000',19)

Tags: Database

Similar Questions

  • Insert the data in the table another table

    Hi experts,

    I am currently using the version below:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production           
    PL/SQL Release 11.2.0.1.0 - Production                                           
    CORE     11.2.0.1.0     Production                                                         
    TNS for 32-bit Windows: Version 11.2.0.1.0 - Production                          
    NLSRTL Version 11.2.0.1.0 - Production                                           
    My requirement is to insert a table of data in the other table.

    Table 1:
    create table a (a1 number);
    
    insert into a values (1);
    insert into a values (null);
    insert into a values (3);
    Table 2:
    CREATE TABLE c (b1 number not null);
    
    
    Note : table c have b1 column with not null constraint
    I wrote the code to insert the lines below.
     declare 
    v_a1 a.a1%TYPE;
    CURSOR c1 IS SELECT a1 FROM a;
    BEGIN
    OPEN c1;
    for i in 1..3 loop
    FETCH c1 INTO v_a1;
    EXIT WHEN c1%notfound;
    INSERT INTO c values(v_a1);
    commit;
    end loop;
    close c1;
    end;
    He insert 1 row, then after I get the error message like: 01400. 00000 - "impossible to insert a NULL value in (%s)."


    But I want the output as:
    SELECT * FROM c;
    
    OUTPUT :
    1
    3
    Please give the solution to the prescription above.


    Thank you

    I think you are looking for DML ERROR LOGGING

    SQL> desc a_tab
     Name                                                  Null?    Type
     ----------------------------------------------------- -------- ------------------------------------
     COL1                                                           NUMBER
     COL2                                                           NUMBER
     COL3                                                           NUMBER
     COL4                                                           NUMBER
    
    SQL> desc b_tab
     Name                                                  Null?    Type
     ----------------------------------------------------- -------- ------------------------------------
     COL1                                                  NOT NULL NUMBER
     COL2                                                  NOT NULL NUMBER
     COL3                                                           NUMBER
     COL4                                                           NUMBER
    
    SQL> execute dbms_errlog.create_error_log('b_tab', 'b_tab_err')
    
    PL/SQL procedure successfully completed.
    
    SQL> desc b_tab_err
     Name                                                  Null?    Type
     ----------------------------------------------------- -------- ------------------------------------
     ORA_ERR_NUMBER$                                                NUMBER
     ORA_ERR_MESG$                                                  VARCHAR2(2000)
     ORA_ERR_ROWID$                                                 ROWID
     ORA_ERR_OPTYP$                                                 VARCHAR2(2)
     ORA_ERR_TAG$                                                   VARCHAR2(2000)
     COL1                                                           VARCHAR2(4000)
     COL2                                                           VARCHAR2(4000)
     COL3                                                           VARCHAR2(4000)
     COL4                                                           VARCHAR2(4000)
    
    SQL> insert into b_tab(col1, col2, col3, col4)
      2  select col1, col2, col3, col4
      3    from a_tab
      4  log errors into b_tab_err('my_test') reject limit unlimited;
    
    2 rows created.
    
    SQL> select * from b_tab;
    
          COL1       COL2       COL3       COL4
    ---------- ---------- ---------- ----------
             1          2          3          4
             6          8          4          9
    
    SQL> set serveroutput on
    SQL>
    SQL> exec dev_util.print_table('select * from b_tab_err')
    
    -------------------------------------------------------
    Field Name                      Field Value
    -------------------------------------------------------
    ORA_ERR_NUMBER$               : 1400
    ORA_ERR_MESG$                 : ORA-01400: cannot insert NULL into("ARBORU"."B_TAB"."COL2")
    ORA_ERR_ROWID$                :
    ORA_ERR_OPTYP$                : I
    ORA_ERR_TAG$                  : my_test
    COL1                          : 5
    COL2                          :
    COL3                          : 3
    COL4                          : 6
    -------------------------------------------------------
    Field Name                      Field Value
    -------------------------------------------------------
    ORA_ERR_NUMBER$               : 1
    ORA_ERR_MESG$                 : ORA-00001: unique constraint(ARBORU.SYS_C00658187) violated
    ORA_ERR_ROWID$                :
    ORA_ERR_OPTYP$                : I
    ORA_ERR_TAG$                  : my_test
    COL1                          : 1
    COL2                          : 9
    COL3                          : 9
    COL4                          : 0
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    
  • ADF progress indicator to insert the data into the file table.

    I have a requirement where the progress bar should indicate the percentage of completion to insert the data into the tables of database files in a given folder path. I found an article that explains how to get the progress indicator when downloading a file in
    http://www.gebs.ro/blog/Oracle/Oracle-ADF-progress-indicator-in-Fusion-Middleware-11g/. I believe that I must first get the total number of files in the folder and then begin to compare with the number of files that are inserted into the table similar to what is done by downloading (getting the file size and download size), but I don't know how to do this. Can anyone help?

    May be that this example allows you to

    * 042.     Dynamically change the color of progress bar based on its current value *.

    http://www.Oracle.com/technetwork/developer-tools/ADF/learnmore/index-101235.html

  • Insert the date in a xslt mapping table

    Hello

    I have develop a BPEL process and I'm trying to insert the date system through BPEL in oracle table. I wrote what follows in the part of xsl to transform my file:

    < xsl: Value-Select = "orcl:query - database (& quot; Select to_date (to_char(sysdate,'YYYY-MM-DD') | to_char (sysdate, 'hh24:mm:ss'),' YYYY-MM-name of the DDHH24:MI:SS of quot; () true, true (), & quot;jdbc:oracle:thin:sample_db/sample_db@localhost:80:XE & quot; dual) "/ >"

    But the data are not implemented, I don't know what is the error. All answers are appreciated.

    Thank you for your time and attention,
    Chavigny

    You are missing the T and he also like to use aliases for some reason any. Also is this port right, it shouldn't be 1521?

    It is best to do this in the wizard as he places the escape to "(") character in the right place. "

    Take a look at this post

    http://forums.Oracle.com/forums/thread.jspa?threadID=892971&TSTART=25

    You also have the option of the xp20:current-dateTime() of expression

    see you soon
    James

  • Insert the problem using a SELECT table with an index by TRUNC function

    I came across this problem when you try to insert a select query, select returns the correct results, but when you try to insert the results into a table, the results are different. I found a work around by forcing a selection order, but surely this is a bug in Oracle as how the value of select statements may differ from the insert?

    Platform: Windows Server 2008 R2
    11.2.3 Oracle Enterprise Edition
    (I've not tried to reproduce this on other versions)

    Here are the scripts to create the two tables and the data source:
    CREATE TABLE source_data
    (
      ID                 NUMBER(2),
      COUNT_DATE       DATE
    );
    
    CREATE INDEX IN_SOURCE_DATA ON SOURCE_DATA (TRUNC(count_date, 'MM'));
    
    INSERT INTO source_data VALUES (1, TO_DATE('20120101', 'YYYYMMDD'));
    INSERT INTO source_data VALUES (1, TO_DATE('20120102', 'YYYYMMDD'));
    INSERT INTO source_data VALUES (1, TO_DATE('20120103', 'YYYYMMDD'));
    INSERT INTO source_data VALUES (1, TO_DATE('20120201', 'YYYYMMDD'));
    INSERT INTO source_data VALUES (1, TO_DATE('20120202', 'YYYYMMDD'));
    INSERT INTO source_data VALUES (1, TO_DATE('20120203', 'YYYYMMDD'));
    INSERT INTO source_data VALUES (1, TO_DATE('20120301', 'YYYYMMDD'));
    INSERT INTO source_data VALUES (1, TO_DATE('20120302', 'YYYYMMDD'));
    INSERT INTO source_data VALUES (1, TO_DATE('20120303', 'YYYYMMDD'));
    
    CREATE TABLE result_data
    (
      ID                 NUMBER(2),
      COUNT_DATE       DATE
    );
    Now, execute the select statement:
    SELECT id, TRUNC(count_date, 'MM')
    FROM source_data
    GROUP BY id, TRUNC(count_date, 'MM')
    You should get the following:
    1     2012/02/01
    1     2012/03/01
    1     2012/01/01
    Now insert in the table of results:
    INSERT INTO result_data
    SELECT id, TRUNC(count_date, 'MM')
    FROM source_data
    GROUP BY id, TRUNC(count_date, 'MM');
    Select the table, and you get:
    1     2012/03/01
    1     2012/03/01
    1     2012/03/01
    The most recent month is repeated for each line.

    Truncate your table and insert the following statement and results should now be correct:
    INSERT INTO result_data
    SELECT id, TRUNC(count_date, 'MM')
    FROM source_data
    GROUP BY id, TRUNC(count_date, 'MM')
    ORDER BY 1, 2;
    If someone has encountered this problem before, could you please let me know, I don't see what I make a mistake because the selection results are correct, they should not be different from what is being inserted.

    Published by: user11285442 on May 13, 2013 05:16

    Published by: user11285442 on May 13, 2013 06:15

    Most likely a bug in 11.2.0.3. I can reproduce on Red Hat Linux and AIX.

    You can perform a search on MOS to see if this is a known bug (very likely), if not then you have a pretty simple test box to open a SR with.

    John

  • DECODE() using Insert the DATE field

    I am trying to use the DECODE function to test for NULL before you insert a DATE field. However, it seems only to insert the DATE, with a time of 'default' from 12:00 - it is not inserted properly the time.

    Basically, I need to test if Date1 is NULL. If not I need to concatenate the Date1 DATENT with TIME of Date2 to get a complete date/time... and then insert this new value.

    Generic example:

    -----

    CREATE TABLE DATETEST (TestID NUMBER (1), DATE TestDate);

    -----


    DECLARE
    DATE of v_Date1;
    DATE of v_Date2;


    BEGIN

    v_Date1: = TO_DATE (1 Jan 11 05:53:12 ',' DD-MON-YY hh);
    v_Date2: = TO_DATE (8 February 11 02:18:31 ',' DD-MON-YY hh);

    INSERT IN DATETEST (TestID, TestDate) VALUES ('1', DECODE (v_Date1, NULL, NULL, TO_DATE (To_Char (v_Date1, 'DD-MON-YY') |))) ' ' || To_char(v_Date2, 'HH:mi:SS'), 'DD-MON-YY HH')));

    INSERT IN DATETEST (TestID, TestDate) VALUES ('2', TO_DATE (To_Char (v_Date1, 'DD-MON-YY') |)) ' ' || To_char(v_Date2, 'HH:mi:SS'), 'DD-MON-YY HH'));

    END;

    -----

    SELECT TestID, TO_CHAR (TestDate, ' DD-MON-YY hh) from DATETEST;

    -----


    The following example performs two inserts. With the DECODE function and the other without. One without inserts the time correctly. Can someone tell me why with the DECODE function do? I know I can use a simple if/then to check if the date is null above and put the time in a variable, but since my real scenario is in a lot of other things, I'm trying to keep it as simple as possible.

    Published by: BoredBillJ on July 14, 2011 06:39
    INSERT
      INTO DATETEST(
                    TestID,
                    TestDate
                   )
      VALUES(
             1,
             TRUNC(v_Date1) + (v_Date2 - TRUNC(v_Date2))
            )
    /
    

    SY.

  • Insert the date and time in writing to the worksheet

    Simple question here

    I need save 4 data tables and insert the date and time at which it was taken (LV 8.6)

    for example

    04/09/09 10:00:01 4 6 7 2

    04/09/09 10:00:02 4 6 7 2

    04/09/09 10:00:03 4 6 7 2

    04/09/09 10:00:04 4 6 7 2

    Any ideas, I can't wire the right timestamp or date/time string in the table to create

    Thank you

    Chris

    Someone there doing the same thing that I am, I got it to work with the attached VI.

  • I want to loop through the data from two different tables using for loop where the query should be replaced at runtime, please help me

    I have the data into two table with the structure of similar column, I want to loop through the data in these two tables

    based on some condition and runtime that I want to put the query in loop for example, the example is given, please help me

    create table ab (a number, b varchar2 (20));

    Insert into ab

    Select rownum, rownum. "" sample "

    of the double

    connect by level < = 10

    create table bc (a number, b varchar2 (20));

    Insert into BC.

    Select rownum + 1, rownum + 1 | "" sample "

    of the double

    connect by level < = 10

    declare

    l_statement varchar2 (2000);

    Boolean bool;

    Start

    bool: = true;

    If it is true, then

    l_statement: =' select * ab ';

    on the other

    l_statement: =' select * from bc';

    end if

    I'm in execute immediate l_statement - something like that, but I don't know

    loop

    dbms_output.put_line (i.a);

    end loop;

    end;

    Something like that, but this isn't a peace of the code work.

    Try this and adapt according to your needs:

    declare

    l_statement varchar2 (2000);

    c SYS_REFCURSOR;

    l_a number;

    l_b varchar2 (20);

    Boolean bool;

    Start

    bool: = true;

    If it is true, then

    l_statement: = "select a, b, AB;

    on the other

    l_statement: = "select a, b from bc;

    end if;

    --

    Open c for l_statement;

    --

    loop

    extract the c in l_a, l_b;

    When the output c % notfound;

    dbms_output.put_line (l_a |') -' || l_b);

    end loop;

    close c;

    end;

    /

  • As of the 31 version, why is there still no option of Thunderbird to insert the date and time in the message that you write?

    As of the 31 version, why is there still no option of Thunderbird to QUICKLY insert the date and time in the message that you write?

    Literally, saw this option very well needed - and opportunity-"promise" for three years now, and even if there are only one or two formats that could be used, at least the option is there.

    It seems that only is to bind a Macro, and the tool to Thunderbird and do it this way.

    Joe Rotello
    [email protected]
    Skype: joerotello

    If the installation of the add-on of TimeStamp is unacceptable for see you if there is a related add-on that you that you already might have managed to convince author to add your function. The Add on more for example has many variables that can enter the body of the message that get automatically replaced with the appropriate data when you merge a message.

  • Insert the date the doc is modified or printed

    Is it possible to insert the date of a document is modified or printed?  The function insert time / Date does not work.

    Thank you!

    Dick

    Pages is not a clone of Word and does not use the Word field codes. The answer is: no support for inserted date modified, or printed.

  • kindly tell how to use the unique value of a table with the index 0

    kindly tell how to use the unique value of a table with the index 0

    Hi
     
    Yep, use Index Array as Gerd says. Also, using the context help ( + h) and looking through the array palette will help you get an understanding of what each VI does.
     
    This is fundamental LabVIEW stuff, perhaps you'd be better spending some time going through the basics.
     
    -CC
  • calculated formula database field trying to insert the null value

    Hello

    I have 3 elements of database text amount, rate and result.
    I enter both values (quantity and frequency), and the property using formula 'result' Gets the computed value.
    On the screen all the values are displayed correctly but when trying to save my information text field 'result' tent to insert the null value.

    Any suggestions?

    Forms 11g

    Thanks in advance

    794018 wrote:
    Hello

    I have 3 elements of database text amount, rate and result.
    I enter both values (quantity and frequency), and the property using formula 'result' Gets the computed value.
    On the screen all the values are displayed correctly but when trying to save my information text field 'result' tent to insert the null value.

    Point formula should not be issue of database. And insert the value in the result column in the database is not good idea.
    Then, if you want to save it. create the database result item and write trigger (When-validate-point) on amount and filed rates and the trigger code, write

    :result:=:amount*:rate;
    

    To display the result on the form, create the database no item and change the formula property and write the formula.

    Hope this will help you

    If someone useful or appropriate, please mark accordingly.

  • Error: Please enter the date value in the correct format DD-MON-RRRR

    Hi all
    First of all, I am 100% not learning financial oracle no technical information. I'm trying to run a report: - the calendar does not appear in order for me to choose the date - not to mention that when I enter the date IE 10/09/2010 or on 09/10/2010 the system gives me this error "" error: Please enter the date value in the correct format DD-MON-RRRR ".
    Please help me to solve this.

    Thank you

    Please enter date in format 12 October 2010.

    Kind regards
    http://www.oraerp.com

  • How to insert the date with timestamp in the table values

    Jin
    I have a table

    create the table abc1 (dob date);

    insert into abc1 values (to_date (sysdate, "HH24:MI:SS RRRR/MM/DD))

    but when I see in the database, it shows that the normal date without time stamp.

    Is it possible to insert in the back-end with time stamp.

    Thank you...

    Firstly, SYSDATE is a DATE already, no need to convert a DATE using the TO_DATE() function.

    The date ALWAYS was a component "hour", if it is displayed until your NLS settings. for example:

    SQL> CREATE TABLE ABC1(DOB DATE);
    
    Table created.
    
    SQL> ALTER SESSION SET NLS_DATE_FORMAT='MM/DD/YYYY';
    
    Session altered.
    
    SQL> INSERT INTO ABC1 VALUES(SYSDATE);
    
    1 row created.
    
    SQL> SELECT * FROM ABC1;
    
    DOB
    ----------
    02/04/2010
    
    SQL> ALTER SESSION SET NLS_DATE_FORMAT='MM/DD/YYYY HH24:MI:SS';
    
    Session altered.
    
    SQL> SELECT * FROM ABC1;
    
    DOB
    -------------------
    02/04/2010 12:54:57
    
    SQL> DROP TABLE ABC1;
    
    Table dropped.
    
  • Attempt to create run time (dynamic) table and insert the data in this... The entrance is a flat file (txt file) which has the numbers and strings... I'm trying to convert them to a string and insert into the table. It is a matter of urgency for me please

    create or replace procedure Dynamic_Table AS

    iVal VARCHAR2 (32);

    iTemp varchar (200): = ";

    sql_stmt VARCHAR2 (200);

    l_file1 UTL_FILE. TYPE_DE_FICHIER;

    l_file utl_file.file_type;

    BEGIN

    l_file1: = UTL_FILE. FOPEN ('TEST', 'dinput.txt', 'R');

    EXECUTE IMMEDIATE ' CREATE TABLE baseline (Item_ID varchar2 (32))';

    Loop

    BEGIN

    UTL_FILE. GET_LINE (l_file1, iVal);

    EXECUTE IMMEDIATE ' insert into baseline values (: ival) "using ival;

    EXCEPTION

    WHEN No_Data_Found THEN EXIT;

    While some OTHER THEN dbms_output.put_line (SQLERRM); * /

    END;

    end loop;

    END;

    You are approaching this the wrong way.  Create an external table based on the file.  External tables are CSV, fixed width data in a queryable table.

    You will need to create an oracle directory to put the file in (MY_ORA_DIR) I leave it for you to do, and then perform the following...

    create table BASELINE)

    ITEM_ID varchar2 (32)

    )

    EXTERNAL ORGANIZATION

    (

    TYPE ORACLE_LOADER

    THE DEFAULT DIRECTORY MY_ORA_DIR

    ACCESS SETTINGS

    (

    RECORDS DELIMITED BY NEWLINE

    LOGFILE "dinput.log".

    BADFILE "dinput.bad."

    NODISCARDFILE

    FIELDS

    (

    ITEM_ID

    )

    )

    LOCATION ("dinput.txt")

    )

    REJECT LIMIT UNLIMITED

    /

    All the dubious records appear in dinput.bad. Dinput.log will give you information.

    External tables are read-only, so once you set up your file, you can create editable as a normal table.

    create table ITABLE_EDITABLE as

    Select * from BASELINE

    /

    Work done, a few lines of code.

Maybe you are looking for