Results 1 to 8 of 8

Thread: Oracle sysdate

  1. #1

    Oracle sysdate

    Hello everyone...

    Sorry .. I dint know where to post oracle related concerns.

    We need to update the date on DB the query is very simple ...update c_d
    set start_date = (sysdate+7),
    end_date = (sysdate+9)
    where a_b = 95
    the query updates the DB with time which is the problem..
    I tried....

    update c_d
    set start_date = to_date(sysdate+7, 'mm/dd/yyyy'),
    end_date = to_date(sysdate+9, 'mm/dd/yyyy')
    where a_b = 95 which dint work ..

    Any suggestions would be appreciated...

    Thanks is Advance..

  2. #2

  3. #3

    Re: Oracle sysdate

    The query adds 7 days to the system date..

  4. #4

    Re: Oracle sysdate

    I know it adds 7 days but i am trying to understand what is going wrong in the final table? What is the value after the update?

  5. #5

    Re: Oracle sysdate

    it updates as below

    9/17/2007 3:34:10 PM

    We dont need the time along with the date ...

  6. #6

    Re: Oracle sysdate

    try current_date instead of sysdate and also try to_char(sysdate, "DD-MMM-YY")

  7. #7
    Moderator JakeBrake's Avatar
    Join Date
    Dec 2000
    St. Louis - Year 2025

    Re: Oracle sysdate

    Is that not a column definition issue? Can you talk with the DBA or the person that did the schema? Do you have access to a schema browser? Can you query sys.dba_tab_columns? If so you should be able to do something like: SELECT data_type, data_length FROM from sys.dba_tab_columns WHERE table_name = 'your table' ...

  8. #8

    Re: Oracle sysdate

    I tried current_date.. it throws an error ... ORA-01843: not a valid month...

    This is the QTP script..

    Dim sql, iRow, rs, mydate
    Set CONNECTION = CreateObject("ADODB.Connection")
    'COMMENT: Set the Connection String.
    CONNECTION.Open "Provider=msdaora;" & _
    "Data Source=DB;" & _
    "User Id=username;" & _
    'COMMENT: Create RecordSet
    set rs = CreateObject("ADODB.Recordset")
    sql = statement
    CONNECTION.Execute "update c_d set start_date = to_char(current_date+7,'mm/dd/yyyy'), end_date = to_char(current_date+9,'mm/dd/yyyy') where a_b = 95"




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 07:20 PM.

Copyright BetaSoft Inc.