How to insert or update in date datatype

I have two tables
Table one T1
code var time var date var
01 0815 10-03-2010
02 0815 10-03-2010
01 1715 10-03-2010
02 1730 10-03-2010
Table two T2
code var,intime date,outtime date, att_date date
from the table T1 i need to move to table T2 intime field declared as date
I have written like this
Insert into T2 (code,intime,att_date)values Or select statement
to_date (t1.date||t1.time,'dd-mon-yyyy hh24mi')
when i use like this it compile good but i got an error
Ora -01861
regards
srikkanth.M

Hi,
Try something like this.
to_date(t1.date||||' '||t1.time,'dd-mm-yyyy hh24mi')
-Ammad

Similar Messages

  • How to insert or update comparing values  with two or more table

    Hai All
    I have three or four table in my database.
    Table 1 Dailattend is the main table here i need to insert or update my data and the fieds are
    Emplcode number,attdate date, intime date,intrin date ,introut date, outtime date are the fields
    Table 2 acclempbarcode the fields are
    emplcode number ,barcode number ....etc
    so now my data is in text format and i have broke the date like this
    0011221100112200100320100815
    First 16 is barcode and next 8 is date and 4 is time and i have created a temp table and store the date and move to main table
    My problem is the main table dailattend has no barcode so when i am going to insert or update i need to check whether the barcode is match with the emplcode in the main table
    How can i write insert or update statement
    The data is like this
    00110022 is barcode,10-03-2010 is my date and 0815 is time so i need to insert into dailattend table so now i have emplcode in dailattend table so i need to compare the barcode belong the emplcode in the another table and i need to insert in the dailattend table
    Pls give me some solution with example
    Regards
    Srikkanth.M

    try somthing like this
    create table t1
    as
    select '0011221100112200' barcode,to_date('100320100815','ddmmyyyyhh24mi') dt
    from dual
      create table barcodetbl
      emplcode varchar2(2000)
      barcode varchar2(2000)
      datetime date
    merge into barcodetbl bc
    using( select  * from  t1) x
    on
    (bc.barcode = x.barcode)
    when matched
    then update
    set datetime = x.dt
    when not matched
    then
    insert (emplcode,barcode,datetime)
    values(1,x.barcode,x.dt)
    /didn't realize that barcode is not in the main table.
    something along the lines
    Table 1 Dailattend is the main table here i need to insert or update my data and the fieds are
    Emplcode number,attdate date, intime date,intrin date ,introut date, outtime date are the fields
    Table 2 acclempbarcode the fields are
    emplcode number ,barcode number ....etc
    merge into dailattend bc
    using( select  * from  t1, acclempbarcode ac where t1.barcode = ac.barcode) x
    on
    (bc.emplcode = x.emplcode)
    when matched
    then update
    set datetime = x.dt
    when not matched
    then
    insert (emplcode,datetime)
    values(1,x.dt)
    /Alvinder
    Edited by: alvinder on Mar 23, 2010 3:50 PM

  • How To... Update Master Data during upload of transaction data

    Can anybody let me know how this can be achieved.
    I have datasource (Legacy not R3) where I am getting both master data and text for number of infoobjects.
    I dont want separate datasources.
    The datasource is actually transactional datasource.
    I dont need text in the cubes or DSO I need the text tables of the infoobjects to be updated.
    I could find this on SDN but do anyone have document based on the below link.I was not able to find it.
    How To... Update Master Data during upload of transaction data
    Thanks.

    Dear Praveen
    I guess yr req is demanding the knowledge of Data Unification and Synchronization whose scope is a bit outer the area of BW.( its MDM actually )
    In BW we could very well fetch data out of different data sources (even across the different system) with no issues so why not u trying that. if there is any issue implementing that then please specify what kind of trouble you are interfacing...
    I got the below link which may be helpful
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e7bd6389-0a01-0010-eb95-d45835d446a8

  • Is there a way to find out how many ESS driven updates to data over a perio

    Is there a way to find out how many ESS driven updates to data over a period of time have been done.

    Assuming that all end users are accessing the back end via Portal, we figured out the answer.

  • How to insert last update date and user id to a form?

    Hi,
    I have created a form to enter data to a custom table.
    When a new record is created, I would like to keep track of the creation date, last update date and who (user id) enters the form.
    Can someone please help or point me to a right place to look for this information?
    Thank you!
    LC

    Create four new columns in your table called Created_On, Created_By, Last_Updated_On and Last_Updated_By.
    You can create a trigger to accomplish the rest:
    create or replace trigger "<name of your trigger>"
      before insert or update on "<name of your table>"
      for each row
    begin
      if inserting then
        :NEW.Created_On := sysdate;
        :NEW.Created_By := v('APP_USER');
      end if;
      if updating then
        :NEW.Last_Updated_On := sysdate;
        :NEW.Last_Updated_By := v('APP_USER');
      end if;
    end;Every time you'll add or modify data in that table, the trigger will automatically fill those fields.
    Regards,
    Mathieu

  • Insert OR Update with Data Loader?

    Hello,
    can i Insert OR Update at same time with Data Loader?
    How can i do this?
    Thanks.

    The GUI loader wizard does allow for this including automatically adding values to the PICKLIST fields.
    However, if you mean the command line bulk loader, the answer is no. And to compound the problem, the command line version will actually create duplicates for some of the objects. It appears that the "External Unique Id" is not really "unique" (as in constrained via unique index) for some of the objects. So be very careful when you prototype something with the GUI loader and then reuse the map on the command line version.
    You will find that some objects can work well with the command line loader (some objects will not).
    Works well (just a few examples):
    Account (assuming your NAME,LOCATION fields are unique).
    Financial Product
    Financial Account
    Financial Transaction
    Will definitely create duplicates via command line bulk loader:
    Contact
    Asset
    Also be aware that you might hear that during a go-live that Oracle will remove the 30k record limit on bulks loads (temporarily). I have not had any luck with Oracle Support making that change (2 clients specifically in the last 12 months).

  • How to insert or update multiple values into a records of diff fields

    Hai All
    I have to insert or update or multiple values into a single records of diff fields from one to another table.
    Table1 has 3 fields
    Barcode bardate bartime
    0011 01-02-10 0815
    0022 01-02-10 0820
    0011 01-02-10 1130
    0022 01-02-10 1145
    0011 01-02-10 1230
    0022 01-02-10 1235
    0011 01-02-10 1645
    0022 01-02-10 1650
    these are the times that comes in at 0815 and goes break at 1130 and comes in at 1230 and goes home at 1645
    from these table i have to insert into another table called table2
    and the fields are barcode, date,timein intrin,introut,tiomout
    And the output want to like this
    barcode timein intrin introut timeout date
    0011 0815 1130 1230 1645 01-02-10
    0022 0820 1145 1235 1650 01-02-10
    If any give some good answer it will be help full..
    Thanks & Regards
    Srikkanth.M

    SQL> with table1 as (
      2  select '0011' Barcode,'01-02-10' bardate,'0815' bartime from dual union
      3  select '0022','01-02-10','0820' from dual union
      4  select '0011','01-02-10','1130' from dual union
      5  select '0022','01-02-10','1145' from dual union
      6  select '0011','01-02-10','1230' from dual union
      7  select '0022','01-02-10','1235' from dual union
      8  select '0011','01-02-10','1645' from dual union
      9  select '0022','01-02-10','1650' from dual
    10  )
    11  select barcode, bardate,
    12         max(decode(rn,1,bartime,null)) timein,
    13         max(decode(rn,2,bartime,null)) intrin,
    14         max(decode(rn,3,bartime,null)) introut,
    15         max(decode(rn,4,bartime,null)) timeout from (
    16                          select barcode, bardate, bartime,
    17                                 row_number() over (partition by barcode, bardate
    18                                                    order by bartime) rn
    19                            from table1)
    20  group by barcode, bardate;
    BARC BARDATE  TIME INTR INTR TIME
    0011 01-02-10 0815 1130 1230 1645
    0022 01-02-10 0820 1145 1235 1650Max
    http://oracleitalia.wordpress.com

  • How to delete or Update the data in the MEAN table

    Hello Gurus,
    I would like to delete or update the data in the MEAN table...how to do it.
    Precisely I would like to change the status of Main EAN Indicator (field HPEAN).
    Kindly let me know ??
    Rehards
    Senthilll

    programmatically, you may use [BAPI_MATERIAL_SAVEDATA|https://www.sdn.sap.com/irj/scn/advancedsearch?query=bapi_material_savedata&cat=sdn_all] [EAN|https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_all&query=bapi_material_savedata+ean&adv=false&sortby=cm_rnd_rankvalue]
    Regards,
    Raymond

  • An import updates a date datatype column to sysdate

    Hi
    I couldn't find anything on this issue in the document.
    I did an export of the data of table1 from database A, in table1 I have a column called CREATEDATE and it has a DATE datatype. When I imported it into database B, all rows now have the current SYSDATE in the CREATEDATE column instead of the original content as on db A.
    Any clues why an import would treat a DATE column like that? and how I can maintain the original content on an import for a DATE type field???
    I do not have a sysdate as the default value for the column.
    Your help is appreciated!

    Sounds like you have a trigger firing. Triggers will fire during an import unless you disable them first. Try disabling all triggers on the tables being imported and see if that eliminates the problem.

  • How do I auto-update the date (in a footer)  in Pages 5.2.2 ?

    I have inserted the date into the footer of my document. I am running Pages 5.2.2 on Mavericks.
    I would like the date to auto-update to today's date.  I found a post from 2013 ( How to auto-update Time and Date?), but my version of pages doesn't work as described.  The only choice is update to today's date as a button I can manually click, but there doesn't seem to be an auto-update check box anymore.  Is there a new way to do it or has the feature been removed?

    Hi Cindy,
    Click once in the Footer.
    Menu > Insert > Date & Time.
    Double click to select the Date & Time in the Footer and choose a Date & Time format
    And there is also the Set to Today button.
    Waiting several minutes (just enough time for a cup of coffee) and then clicking the Set to Today button, the time changes from 9:53 pm to 9:59 pm.
    I can't wait until tomorrow to see if the date changes, but I think it will .
    Another way (clunky) is to insert a single-cell table somewhere in your document and type =now and format to your liking.
    As far as I know, Date & Time will update after you Save and then Open your document. Please call back after you test.
    Regards,
    Ian.

  • Help on SHUTTLE and how  to insert  multiple selection of data to database?

    Hi
    I looking for some help SHUTTLE. The scenario is given below. Appreciate your urgent help/steps how to use UIX SHUTTLE for this example.
    I). I have two tables user and dept
    User
    ====
    Fields=>(uid,uname)
    Dept
    ====
    Fields=>(deptno,uid)
    II). UIX screen with two fileds
    i. DeptNo =>messageInputText
    ii. Uid =>shuttle (This shuttle should display user.username, but when insert data it has to update as uid)
    III. Insert data to database
    Using form, I give one dept no and select multiple Unames. When click submit, it has to commit the changes to the database. For eg: I am given DeptNo=10, and unames selected are "RAM","GEORGE","CLINTON", it has to update 3 rows in to the database as shown below
    DEPTNO UID
    ================
    10 100 =>UNAME RAM
    10 200 =>UNAME GEORGE
    10 300 =>UNAME CLINTON
    Thanks
    NRK

    Sorry, Maybe i am not stated my problem clearly. After i execute my sql statement and put the result into the resultset, if the result is more than 1 records, then i dunnoe how to handle with the record and display it in jsp. Do u get wat i mean?

  • How to insert or update to user_type fields

    hi all,
    i created an user type as,
    create or replace type file_ty as object(name varchar2(100), content blob);
    file_ty is created.
    and a table which is using this type,
    create table issues (id number primary key, subj varchar2(20), area varchar2(20), filename file_ty);
    when i tried to insert data in issues table,
    insert into issues values(1,'subj',area',file_ty('one.txt'));
    Error Msg : ORA-02315: incorrect number of arguments for default constructor
    and i tried to insert a record with out filename field and it inserted.
    insert into issues(id,subj,area) values(1,'subj','area');
    and tried to update that record.
    update issues set filename.name='one.txt' where id=1
    Error Msg: ORA-00904: "FILENAME"."NAME": invalid identifier
    i event tried for user_type which have two fields of number. but the same errors.
    create type temp_ty as object(fld1 number, fld2 number);
    how to resolve this problem.
    regards
    pavan.

    SQL> create or replace type file_ty as object(name varchar2(100), content blob);
      2  /
    Type is aangemaakt.
    SQL> create table issues (id number primary key, subj varchar2(20), area varchar2(20), filename file_ty)
      2  /
    Tabel is aangemaakt.
    SQL> insert into issues values(1,'subj','area',file_ty('one.txt'))
      2  /
    insert into issues values(1,'subj','area',file_ty('one.txt'))
    FOUT in regel 1:
    .ORA-02315: incorrect number of arguments for default constructor
    SQL> insert into issues values(1,'subj','area',file_ty('one.txt',null))
      2  /
    1 rij is aangemaakt.Regards,
    Rob.

  • CLOB, BC4J, how to insert/access/update CLOB attribute?

    Hello everybody,
    I'm using Jdev 3.1 on a 8.1.6 db and I am having a hard time trying to change my good ol' Varchar(4000) into CLOBs (the main reason me doing this is that I need to store data which can occasionnaly go over the 4K limit)
    I am actually trying to wrap CLOB access in String getAttribute() and
    void setAttribute(String newValue)
    methods which would use Strings as parameters, in order to get the same behaviour as Varchar and Long data types.
    Various problems arise:
    ** I can't create a new row through a view object! if I do the following:
    ViewObject myView = myAppModule.findViewObject("myViewName");
    Row myRow = myView.createRow();
    ClobDomain myClob = new ClobDomain();
    myClob.setBytes("hello world".getBytes());
    myRow.setAttribute("clobAttribute",myclob);
    myView.insertRow(myRow);
    myAppmodule.getDbTransaction().commit();
    Then the commit fails with JBO-26041 invalid column type...
    any hints on why this fails?
    ** Each time the row containing the CLOB column gets updated , I get a JBO-25014: another user has changed the row... exception.
    This occurs even if the updated columns do not include the CLOB. However, if i try repeatedly (as someone in this forum suggested) the call to setAttribute eventually succeeds (usually it works on the 3rd attempts).
    Any suggestion why this happens? any chance jdev 3.2 improves this?
    ** I have also tried to create a custom domain "StringClobDomain", with an attribute value of type String, and a Database column value of type CLOB.
    This nearly works!
    It allows insertion of data, and update (there are still JBO-25014 when updating, but it works on the 2nd attempt now).
    However, when trying to get the value stord in the db through the domain object, all I can get is stuff like "oracle.sql.CLOB@4b0c".
    It seems to me that internally, when copying the CLOB data to the domain object, a CLOB.toString() is called instead of a CLOB.getBytes() or the like.
    Am I right? is there a known workaround ?
    Thanks for any help, Rimi
    null

    Hello,
    Thanks for your answers, I took some time to reply because for a while I tried to achieve the same results with LONGs (Unfortunaltely it didn't work: it seems that using large strings with LONGs is not as straightforward as I expected).
    Now I'm back with CLOBs, and finally, with your help It seems to work ok, altough there are still a few points which need some work done...
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Shailesh (JDeveloper Team):
    Well ok, but in the example I gave, the attribute actually refered to a CLOB column...Please verify the columns that are being posted in the update statement...
    <HR></BLOCKQUOTE>
    It seems that this was the problem: I removed the attributes in the Entity/View wizards, then re-added them, and it worked afterwards, I guess I messed up with the wizard...
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>
    I do not have any control on how the Domain object is populated, so it feels like I'm a bit stuck no?My guess was that you've extended ClobDomain to create your own Domain class.
    Instead it seems you've used the UI to create a domain containing String. That does not work for non-scalar (large objects) like LOBs.
    <HR></BLOCKQUOTE>
    Ok, I'll keep that in mind.
    But if it doesn't work this way, shouldn't the IDE forbid this combination?
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>
    You may extend the ClobDomain class to get the data-conversion handled by the base domain and then use getBLOB() to get the sql-BLOB object and work with it.
    <HR></BLOCKQUOTE>
    Ok, I've tried this, but I still have some problems.
    I have created a class evenium.jbo.domain.ClobStringDomain which simply extends the oracle.jbo.domain.ClobDomain:
    package evenium.jbo.domain;
    public class ClobStringDomain extends oracle.jbo.domain.ClobDomain {}
    If I declare the Value attribute as based on ClobDomain in the entity wizard, everything works fine, I can even use an object of type evenium.jbo.domain.ClobStringDomain to set the attribute's value.
    However, if I declare the attribute as based on my custom ClobStringDomain, then, upon insertion (actually, it's when I commit), I get a null pointer exception...
    any Idea why this happens?
    TIA, Remi

  • Insert and update a data block which is based on view--urgent help required

    Hi experts,
    I created a view(A_VIEW) which is based on a union select. I have created a data block A_VIW_BLOCK which is based on this view. I need to insert/update one of the base tablesfor A_VIEW through this data block. I also need to be able to make a query through all the fields in the view.
    The questions are:
    1.Can it be done at all?
    2. What properties need to be set?
    3. If can't be done, what the best approach to achieve this?
    Thanks in advance!!
    Michael

    hi
    try something like this.
    CREATE TABLE demo_tab (
    person_id NUMBER(3),
    first_name VARCHAR2(20),
    last_name VARCHAR2(20));
    CREATE OR REPLACE VIEW upd_view AS
    SELECT * FROM demo_tab;
    INSERT INTO demo_tab
    (person_id, first_name, last_name)
    VALUES
    (1, 'Daniel', 'Morgan');
    INSERT INTO demo_tab
    (person_id, first_name, last_name)
    VALUES
    (2, 'Helen', 'Lofstrom');
    COMMIT;
    SELECT * FROM upd_view;
    UPDATE upd_view
    SET person_id = person_id * 10;
    SELECT * FROM upd_view;
    desc user_updatable_columns
    SELECT table_name, column_name, updatable, insertable, deletable
    FROM user_updatable_columns
    WHERE table_name IN (
       SELECT view_name
       FROM user_views);
    SQL> create table dummy (f1 number);
    Table created.
    SQL> create view dummy_v 
    2  as 
    3  select f1 from dummy 
    4  union all  
    5  select f1 from dummy;
    View created.
    SQL> create trigger dummy_v_it 
    2  instead of insert 
    3  on dummy_v 
    4  for each row 
    5  begin 
    6    insert into dummy values (:NEW.f1); 
    7  end; 
    8  /
    Trigger created.
    SQL> insert into dummy_v values (1);
    1 row created.
    SQL> select * from dummy_v;       
    F1
    1        
    1
    SQL> select *
      2  from user_updatable_columns
      3  where table_name = 'DUMMY_V';
    OWNER    TABLE_NAME   COLUMN_NAME  UPD INS DEL
    FORBESC  DUMMY_V      F1            NO  NO  NOforms settings.
    Enforce Primary Key - No
    Query Allowed - Yes
    Query datasource Name - V_TSFDETAIL
    Insert Allowed - Yes
    Update Allowed - Yes
    Delete Allowed - Yes
    Locking Mode - Automatic
    Key Mode - Automatic
    do not forget to create synonyms.
    hope this helps.
    sarah

  • How to insert a record with date format field

    I tried to execute the query of the below but it showed error and hence i did research and found out i can add a date syntax in front to format it properly.
    INSERT INTO EMP (EmpNo, EmpName, Sex, DateOfBirth, Salary, DeptNo)
    VALUES ('E001', 'Alex', 'M', '2006-11-08', '1500', 'D001');
    When i executed the following query under SQL plus environment, it hang and gave no response. May i know how to solve this problem? Thank you
    INSERT INTO EMP (EmpNo, EmpName, Sex, DateOfBirth, Salary, DeptNo)
    VALUES ('E001', 'Alex', 'M', DATE '2006-11-08', '1500', 'D001');

    Normally when we execute a query, it will show the result or response whether it is fail or success or what the error message is. But my situation is that it showed nothing and no response, and cannot execute new query, i cant do anything under that environment and i can only off it by using end task.

Maybe you are looking for

  • How to disable email option when creating a form

    I am creating a pdf flyer in either Pro or LiveCycle. And I want to provie a space for people to enter their personal information (form fields). I want them to be able to save this and print it. I don't want to give them a submit option (to send via

  • Why are my purchased movies from apple TV not appearing in itunes?

    I have purchased movies on both my itunes and apple tv. However, my apple tv movies do not appear on my itunes. I would like to either have them all on my itunes or all on my apple tv (or is it iCloud??). Is this possible? If so, how? Thank you.

  • Adobe Flash update will not load WHY!!!!!!!!

    I can't play anything requiring an Adobe Flash upgrade. Because I can't load the Adobe Flash Upgrade it works fine on my Explorer web browser but it will not load on firefox and it tells me to turn off firefox. I just sent in $30 dollars as a support

  • Error #1016075

    Has anybody seen the following error:Error(1016075) Max Columns Exceeded in Report Request: [255]I'm getting it while running a HAL program that exports data from Essbase.Thanks,Vicki

  • Computer Not Updating Software

    For the past few months whenever I try to run the system updates, I get an error message that says, "The digital signature for this package is incorrect. The package may have been tampered with or corrupted since being signed by "Apple"." Anyone know