Problem in TO_DATE...

Hello

I need to display the date and time using the to_date function.
EX:
December 22 09 14:31:20
I tried this way
Select to_date (sysdate, "the HH24: MI: SS DD-MM-YYYY) twice;
Released: 22-DEC-09

But it does not get the date as that request.
Can you help me pls how can I get data like this.

Thanks in advance.

Kind regards
Leelakrishna.G

When you view it? In SQLPlus? If so try this

alter session set nls_date_format = 'DD-MM-YYYY HH24:MI:SS'
/
select sysdate from dual
/

Tags: Database

Similar Questions

  • Advanced search in the JHS 11.1.1.2.29 release

    In JHS Technical Preview 2 there was a possibility in the advanced search to use the extended search (good).

    JHS production 11.1.1.2.29, this feature is missing. Y at - there somewhere a setting?

    If I define a query operator user-defined settings are not correct:

    is
    is
    is not
    etc.

    the East is double defined and enters is missing

    If I use the 'is' on a date field of the search does not work.
    If I use the 'mensen aan is' I get an error message:

    oracle.jbo.SQLStmtException < ActionListenerImpl > < processAction >: Houston-27122: SQL-hell tijdens voorbereiding van statement. Instruction: SELECT AmBoekingen.AM_BOEKING_ID, AmBoekingen.AM_B_AM_PROJECT_AM_PROJECT_ID, AmBoekingen.AM_B_BOEK_DATUM, AmBoekingen.AM_B_BOEK_OMSCHRIJVING, AmBoekingen.AM_B_BOEK_UREN, AmBoekingen.AM_B_BOEK_KM, AmBoekingen.AM_B_BOEK_ONKOSTEN, AmBoekingen.AM_B_DIRECT, AmBoekingen.AM_B_FACTUUR, AmBoekingen.AM_B_MEDEWERKER, AmProject.AM_P_PROJ_NUMMER, AmProject.AM_PROJECT_ID OF AM_BOEKINGEN AmBoekingen, AM_PROJECT AmProject WHERE AmBoekingen.AM_B_AM_PROJECT_AM_PROJECT_ID = AmProject.AM_PROJECT_ID (+) AND (((AmBoekingen.AM_B_BOEK_DATUM = TO_DATE ('mensen aan 2010-04-19' «yyyy-mm-jj hh24))) :MI:SS'))) ORDER BY AmBoekingen.AM_B_BOEK_DATUM desc
    javax.faces.el.EvaluationException: oracle.jbo.SQLStmtException: 27122 Houston: SQL-hell tijdens voorbereiding van statement. Instruction: SELECT AmBoekingen.AM_BOEKING_ID, AmBoekingen.AM_B_AM_PROJECT_AM_PROJECT_ID, AmBoekingen.AM_B_BOEK_DATUM, AmBoekingen.AM_B_BOEK_OMSCHRIJVING, AmBoekingen.AM_B_BOEK_UREN, AmBoekingen.AM_B_BOEK_KM, AmBoekingen.AM_B_BOEK_ONKOSTEN, AmBoekingen.AM_B_DIRECT, AmBoekingen.AM_B_FACTUUR, AmBoekingen.AM_B_MEDEWERKER, AmProject.AM_P_PROJ_NUMMER, AmProject.AM_PROJECT_ID OF AM_BOEKINGEN AmBoekingen, AM_PROJECT AmProject WHERE AmBoekingen.AM_B_AM_PROJECT_AM_PROJECT_ID = AmProject.AM_PROJECT_ID (+) AND (((*AmBoekingen.AM_B_BOEK_DATUM = TO_DATE ('mensen aan 2010-04-19' «yyyy-mm-jj hh24))) ((:mi:ss"))*)) ORDER BY AmBoekingen.AM_B_BOEK_DATUM desc


    The problem is "TO_DATE (' 'mensen aan 2010-04-19', ' yyyy-mm-dd hh24:mi:ss')) + *") "

    If I change my English research gives no error but also no results.

    So if I want the results today, I need to use after

    I have no possibility to get only results from yesterday.


    Kind regards

    Menk Slot

    Menk,

    It is a compromise, with JHS-search you more flexibility, in particular for the development of the search box.

    However, based on the model of research has more features advanced: dynamiclaly "setByUser" capabilities, research, saved adds dynamically add fields.
    Note that if you decide to start using research based on the model, you must also go to based on the model of LOV, JHS-LOVs/menus drop down are not visible in the area of research based on templates.

    Steven Davelaar,
    Jheadstart team.

  • Date settings

    Hello

    Please see my query below,

    I have a little trouble with my date settings.

    If $P {from_date} = January 1, 2010
    and $P {to_date} = January 2, 2010

    Is there a reason why I get all the data for January 2, 2010?

    It's probably something simple I'm missing.
    select
    
    count(tag_id),
    itl.sku_id,
    itl.client_id, 
    itl.reference_id,
    sum(itl.update_qty),
    to_char(trunc(itl.dstamp), 'DD-Mon-YYYY') rec_date,
    to_char(sysdate, 'DD-Mon-YYYY | HH24:MI:SS') as systemdate,
    to_char(trunc(itl.expiry_dstamp), 'DD-Mon-YYYY') exp_date,
    s.ship_shelf_life as sku_shelf_life,
    s.ship_shelf_life + 2 as plus_shelf_life,
    (trunc(itl.expiry_dstamp) - (s.ship_shelf_life + 2)) - trunc(sysdate) as plus_days_left,
    (trunc(itl.expiry_dstamp) - (s.ship_shelf_life + 2)) - trunc(itl.dstamp) as plus_days_left_when_rec,
    (trunc(itl.expiry_dstamp) - trunc(itl.dstamp)) as clear_days
    
    from inventory_transaction itl, sku s
    where s.sku_id = itl.sku_id
    and ($P{from_date} is null or ($P{from_date} is not null and itl.dstamp >= to_date($P{from_date}, 'DD-Mon-YYYY')))
    and ($P{to_date} is null or ($P{to_date} is not null and itl.dstamp <= to_date($P{to_date}, 'DD-Mon-YYYY')))
    and itl.code = 'Receipt'
    group by itl.sku_id, itl.client_id, to_char(trunc(itl.expiry_dstamp), 'DD-Mon-YYYY'), to_char(trunc(itl.dstamp), 'DD-Mon-YYYY'),
    itl.reference_id, s.ship_shelf_life, s.ship_shelf_life + 2, (trunc(itl.expiry_dstamp) - (s.ship_shelf_life + 2)) - trunc(sysdate),
    (trunc(itl.expiry_dstamp) - (s.ship_shelf_life + 2)) - trunc(itl.dstamp), (trunc(itl.expiry_dstamp) - trunc(itl.dstamp))
    order by itl.client_id, itl.sku_id
    Thanks in advance,

    SM.

    Sam Mardell wrote:
    Is there a reason why I get all the data for January 2, 2010?

    Yes :) All dates has a component of hours, minutes, and seconds. When you apply the TO_DATE() function on a string that contains all the month, day, and year component "hour" is by default at midnight (00:00:00). There are several methods to work around this problem:

    < to_date($P{to_date}, 'DD-Mon-YYYY') + 1
    
    <= to_date($P{to_date} || '23:59:59', 'DD-Mon-YYYY HH24:MI:SS')
    
    <= to_date($P{to_date}, 'DD-Mon-YYYY') + (60*60*24 - 1)
    

    Above are just examples, there are many more ways to do this.

    HTH!

  • TO_date problem

    Hello
    I have a problem that I need to get between the dates, but I can't use the command BETWEEN
    I was hoping that I could solve it like this

    and activity.send_date < to_date('2015/12/01','yyyy/mm,dd') - date is later than the date of entry as 1/12/2015 <
    and activity.send_date > to_date('2015/12/03','yyyy/mm,dd') - DATE is less than a date entered as 12/3/2015 >

    But it does not work.
    Can someone help me to understand how I could get this working to get like this example: all data between 20/11/2015 until 25/11/2015

    BR,
    Melx

    Q1. Why you cannot use between

    Try this

    Activity.SEND_DATE > = to_date('2015/11/20','yyyy/mm/dd') and activity.send_date<=>

    Search the =, operator, I used both

  • Problem in executing to_date

    Hello


    Under query is not executed: error: ORA-01858: a non-digit character was found here where was waiting for a digital

    Select to_date (SYSDATE, 'yyyyMMdd') of double;

    Published by: Balajiraam on February 28, 2011 10:05

    Balajiraam wrote:
    How do I get the date in the specified format without changing the NLS_PARAMETERS as shown below:

    Select double to_date('20090912','MMDDYYYY');

    As others have already pointed out, a date is not a format. You can't get a date in a specified format.

    If you want a character string that represents a date, you use the function TO_CHAR. In this case, it is not supposed to do since you already have the channel by hand. But you might

    SELECT to_char( to_date( '20090912', 'MMDDYYYY' ),
                    'MMDDYYYY' )
      FROM dual
    

    Justin

  • Unique / separate to_date problem

    Hey guys,.

    I am doing a project on feedback forms.
    There is a query that is bothering me in oracle...

    I used this application in the generation of reports in VB .NET.

    This is the query:

    SELECT unique (to_date(a.fdate,'dd-mon-yy')), t.teacher_name, s.subject_name, q.question_id, q.question_desc, q.opt1, q.opt2, q.opt3, q.opt4, count (a.opt1), count (a.opt2), count (a.opt3), (a.opt4) count of feedback f, answers, teacher t, s of subjects, questions q where A.FEEDBACK_ID = 'FF1' AND fdate as 5 January 09 ' and the group a.question_id = q.question_id and t.teacher_id = f.teacher_id and f.feedback_id = a.feedback_id and f.subject_id = s.subject_id by a.fdate t.teacher_name, s.subject_name, q.question_id, q.question_desc, q.opt1, q.opt2, q.opt3, q.opt4 order of q.question_id

    But this query gives ambiguous data as output.

    When I delete the attribute a.fdate to the query, it works fine.

    Select t.teacher_name, s.subject_name, q.question_id, q.question_desc, q.opt1, q.opt2, q.opt3, q.opt4, count (a.opt1), count (a.opt2), count (a.opt3), (a.opt4) count of feedback f, answers, teacher t, s of subjects, questions q where A.FEEDBACK_ID = 'FF1' AND fdate as 5 January 09 ' and the group a.question_id = q.question_id and t.teacher_id = f.teacher_id and f.feedback_id = a.feedback_id and f.subject_id = s.subject_id by t.teacher_name s.subject_name, q.question_id, q.question_desc, q.opt1, q.opt2, q.opt3, q.opt4 order of q.question_id

    But I need this area in my report. Can somone please help me out here!

    I tried to use SEPARATE, to_char, but in vain!

    Thanks a load!

    Kind regards

    Adijo

    Now,.

    If fdate is of type char or varchar2, then you can use this->

    select trunc(to_date(a.fdate,'dd-mon-yy')),
           t.teacher_name,
           s.subject_name,
           q.question_id,
           q.question_desc,
           q.opt1,
           q.opt2,
           q.opt3,
           q.opt4,
           count(a.opt1),
           count(a.opt2),
           count(a.opt3),
           count(a.opt4)
    from feedback f,
         answers a,
         teacher t,
         subjects s,
         questions q
    where A.FEEDBACK_ID = 'FF1'
    AND trunc(fdate) = '05-JAN-09'   -- As discussed earlier you can use between here
    and a.question_id=q.question_id
    and t.teacher_id=f.teacher_id
    and f.feedback_id=a.feedback_id
    and f.subject_id=s.subject_id
    group by trunc(to_date(a.fdate,'dd-mon-yy')),
             t.teacher_name,
             s.subject_name,
             q.question_id,
             q.question_desc,
             q.opt1,
             q.opt2,
             q.opt3,
             q.opt4
    order by q.question_id
    

    Or, if that is the date the reference->

    select trunc(a.fdate),
           t.teacher_name,
           s.subject_name,
           q.question_id,
           q.question_desc,
           q.opt1,
           q.opt2,
           q.opt3,
           q.opt4,
           count(a.opt1),
           count(a.opt2),
           count(a.opt3),
           count(a.opt4)
    from feedback f,
         answers a,
         teacher t,
         subjects s,
         questions q
    where A.FEEDBACK_ID = 'FF1'
    AND trunc(fdate) = '05-JAN-09'     -- As discussed earlier you can use between here
    and a.question_id=q.question_id
    and t.teacher_id=f.teacher_id
    and f.feedback_id=a.feedback_id
    and f.subject_id=s.subject_id
    group by trunc(a.fdate),
             t.teacher_name,
             s.subject_name,
             q.question_id,
             q.question_desc,
             q.opt1,
             q.opt2,
             q.opt3,
             q.opt4
    order by q.question_id
    

    N.B.: Not tested...

    Kind regards.

    LOULOU.

  • Potential problems with copy_table_stats.

    Guys,

    I have a table with the DDL below containing a huge number of records.

    CREATE TABLE APPEAL. CALL_DTL

    (

    DATE TIME STAMP,

    MSN VARCHAR2 (32 BYTE) NOT NULL,

    EVENT DATE NOT NULL,

    )

    PARTITION BY RANGE (EVENT)

    (

    CALL_P_01122015 PARTITION VALUES LESS THAN (TO_DATE (' 2015-12-01 00:00:00 ',' SYYYY-MM-DD HH24:MI:SS ',' NLS_CALENDAR = GREGORIAN ')),

    CALL_P_02122015 PARTITION VALUES LESS THAN (TO_DATE (' 2015-12-02 00:00:00 ',' SYYYY-MM-DD HH24:MI:SS ',' NLS_CALENDAR = GREGORIAN '))

    CALL_P_03122015 PARTITION VALUES LESS THAN (TO_DATE (' 2015-12-03 00:00:00 ',' SYYYY-MM-DD HH24:MI:SS ',' NLS_CALENDAR = GREGORIAN '))

    );

    We collect statistics for the 1st of the score of the month.

    BEGIN

    DBMS_STATS.gather_table_stats)

    ownname = > 'CALL. "

    tabname = > 'CALL_DTL ',.

    partName = > "CALL_P_01122015"

    estimate_percent = > 1,

    GRANULARITY = > 'APPROX_GLOBAL AND PARTITION,

    Cascade = > TRUE,

    degree = > 15);

    END;

    /

    And the stats will be copied in the rest of the partitions of the month.

    Start

    DBMS_STATS.copy_table_stats (ownname = > 'CALL')

    tabname = > 'PMS_CALL_DETAIL ',.

    srcpartname = > 'CALL_P_01122015 ',.

    dstpartname = > 'CALL_P_02122015');

    end;

    /

    Start

    DBMS_STATS.copy_table_stats (ownname = > 'CALL')

    tabname = > 'PMS_CALL_DETAIL ',.

    srcpartname = > 'CALL_P_01122015 ',.

    dstpartname = > 'CALL_P_03122015');

    end;

    /

    Start

    DBMS_STATS.copy_table_stats (ownname = > 'CALL')

    tabname = > 'PMS_CALL_DETAIL ',.

    srcpartname = > 'CALL_P_01122015 ',.

    dstpartname = > 'CALL_P_04122015');

    end;

    /

    ...

    ...

    Could someone advise if there could be potential problems with the copy of his stats?

    What I see, HIGH_VALUE and LOW_VALUE are the same for every single partition for the SQL below:

    Select nom_partition, HIGH_VALUE, LOW_VALUE from dba_part_col_statistics where table_name = column_name 'CALL' IN ("MSN");


    Will this result in CBO plan fetching suboptimal on SQL running on the table with predicate such as MSN and EVENT?

    Please suggest me resolution approaches.


    Thank you!!


    -Bibi





    It will depend on (among other things), how use you it as a predicate and unique how the column is.

    If you try to filter using predicates of beach in function with a range outside the stats then the CBO will be predicate weak cardinalities and therefore will promote the access of the index and nested loops which leads to this.

    If you are filtering on equality predicates and the key is unique there should be no problem really.

    It will depend also on whether the request knows which partition will be scanned, otherwise it will use global statistics, which will be probably the same as a partition, but they could easily change if you were to collect stats on any other partition.

    You have an environment you can use a test and see approach?

  • Problem I have TO solve with the query: PREV calculation to the current record

    Hi all

    My version of db:

    Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production

    I have the problem to solve with a request (MUST BE a SELECT statement), but I do not understand how... I tried with the analytical function but... not just:

    I have this table:

    rownumKEY1KEY2A3PERCIMP
    1A123RISCP01/01/201410100
    2A123RISCP02/01/201411100
    3A123RISCP03/01/201415100

    Application of expected result:

    RESULTSKEY1KEY2A3PERCIMP
    90A123RISCP01/01/201410100
    80.1A123RISCP02/01/201411100
    68.085A123RISCP03/01/201415100

    Starts recording with rownum 1 (the lower date with the same KEY) I do: imp - (100 imp * perc), where imp = 100 and PERC = 10, so the first result of the calculation is: 90


    Now I have to go to record 2, so I do 90 - 11%: imp - (100 imp * perc), where imp = 90 and PERC = 11, results is 80.1

    Now I have to go to the 3d recording, so I 80.1 - 15%: imp - (100 imp * perc), where imp = 80.1 and perc = 15, results is 68 085

    So I have to use the previous to the current PERC.

    I'm sure it's possible through a combination of funcion analytical!

    Thanks to anyone who can help me!

    with

    data in the form of

    (select 1 rn "A123" key1, to_date('01-JAN-2014','DD-MON-YYYY') dat, 10 perc, 100 imp union double all the)

    Select option 2, 'A123', to_date (February 1, 2014 "," MON-DD-YYYY ""), 11, 100 of all the double union

    Select 3, 'A123', to_date (March 1, 2014 "," MON-DD-YYYY ""), 15, 100 double

    ),

    Solver (RN, Key1, DAT, PERC, IMP, result) as

    (select rn, key1, dat, perc, imp, imp * (1 - 0.01 * perc))

    from the data

    where rn = 1

    Union of all the

    Select d.rn, d.key1, d.dat, d.perc, d.imp, s.result * (1 - 0.01 * d.perc)

    s Solver,

    data d

    where d.rn = s.rn + 1

    )

    Select *.

    the Solver

    RN KEY1 DAT PERC IMP RESULT
    1 A123 01/01/2014 10 100 90
    2 A123 01/02/2014 11 100 80.1
    3 A123 01/03/2014 15 100 68.085

    Concerning

    Etbin

  • Data parameter problem

    Hello

    I am facing a problem with the parameter Data;

    I can't able to query the data for different dates in the range, but I am able to query the data for the same date in the range.

    Select the statement-

    Select RCT.GL_DATE in the RCT RA_CUST_TRX_LINE_GL_DIST_ALL

    where TO_CHAR (TRUNC (RCT.GL_DATE), 'DD-MON-YY')

    between TO_CHAR (TRUNC (TO_DATE(:P_GL_DATE_LOW)), 'DD-MON-YY')

    AND TO_CHAR (TRUNC (TO_DATE(:P_GL_DATE_HIGH)), 'DD-MON-YY');

    I am able to get the data for the date range - 05-JAN-2015/05-JAN-2015, 07-JAN-2015/07-JAN-2015 and so on...

    I'm not able to get the data for the date range - 05-JAN-2015/07-JAN-2015, 07-JAN-2015/09-JAN-2015 and so on...

    Can someone help me on this issue.

    Thanks in advance!

    Dilip Manon

    As John pointed out, use the date data type to compare dates:

    Select RCT.GL_DATE in the RCT RA_CUST_TRX_LINE_GL_DIST_ALL

    where RCT.GL_DATE

    (between TO_DATE(:P_GL_DATE_LOW)), 'DD-MON-YYYY')

    (AND TO_DATE(:P_GL_DATE_HIGH)), 'DD-MON-YYYY');

    Using TO_CHAR to compare dates, not only do you risk to make mistake and forget certain values, but also in this case stop you an index on GL_DATE may be used.

  • Trigger changing problem

    I've created a compound trigger that creates a trigger mutation error.

    Here are the trigger:

    DROP TRIGGER bi_fin_transaction
    /

    DROP TRIGGER ais_fin_transaction
    /

    CREATE OR REPLACE TRIGGER ai_fin_transaction
    FOR INSERT
    ON fin_transaction
    COMPOUND OF TRIGGER
    Number of TransactionNumber;
    TransactionAmount number (18.6);
    DiscountTakenAmount number (18.6);
    AfterBalanceAmount number (18.6);
    Number of InvoiceNbr;
    Date of MaxGlDate;
    number of v_count;
    date of gl_date;

    CURSOR operation IS
    SELECT invoice_nbr,
    gl_date
    OF gtt_ai_fin_transaction_work
    ORDER BY invoice_nbr;

    CURSOR recalculate IS
    SELECT transaction_nbr,
    transaction_amount,
    discount_taken_amount
    OF gtt_ai_fin_transaction
    ORDER BY gl_date,
    transaction_nbr;

    UNTIL EACH ROW IS
    BEGIN
    BEGIN
    SELECT ft.invoice_nbr,
    Max (COALESCE(ft.gl_date,ft.transaction_date))
    BY InvoiceNbr,
    MaxGlDate
    FT fin_transaction
    WHERE ft.invoice_nbr =: new.invoice_nbr
    GROUP BY ft.invoice_nbr;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    NULL;
    END;

    IF: new.gl_date < MaxGlDate THEN
    INSERT INTO gtt_ai_fin_transaction_work
    VALUES (InvoiceNbr,
    MaxGlDate
    );
    END IF;
    PURPOSE BEFORE EACH ROW;

    AFTER EACH ROW IS
    BEGIN
    IF (: new.invoice_nbr IS NOT NULL) THEN

    UPDATE fin_invoice
    SET last_transaction_date =: new.transaction_date
    WHERE invoice_nbr =: new.invoice_nbr;

    END IF;

    IF (: new.payment_nbr IS NOT NULL) THEN

    UPDATE fin_payment
    SET last_transaction_date =: new.transaction_date
    WHERE payment_nbr =: new.payment_nbr;

    END IF;
    END AFTER EACH LINE;

    AFTER STATEMENT IS
    BEGIN
    SELECT COUNT (*)
    IN v_count
    OF gtt_ai_fin_transaction_work;

    IF v_count > 0 THEN
    CURRENT transaction;

    LOOP

    Get operation IN InvoiceNbr,
    gl_date;
    OUTPUT WHEN transaction % NOTFOUND;

    DELETE FROM gtt_ai_fin_transaction;

    INSERT INTO gtt_ai_fin_transaction
    SELECT transaction_nbr,
    COALESCE(gl_date,transaction_date),
    CASE transaction_type WHEN IN ('PAY', 'CON', 'CRD', 'PAD', "ADJ", "ACC", "NSF", "COR", "PADR")
    THEN transaction_amount *-1
    Of OTHER transaction_amount
    END,
    CASE transaction_type WHEN IN ('PAY', 'CON', 'CRD', 'PAD', "ADJ", "ACC", "NSF", "COR", "PADR")
    THEN discount_taken_amount *-1
    Of OTHER discount_taken_amount
    END,
    0.00,
    NULL VALUE
    OF fin_transaction
    WHERE invoice_nbr = InvoiceNbr
    AND payment_nbr IS NOT NULL
    ORDER OF COALESCE(gl_date,transaction_date),
    transaction_nbr;

    SELECT after_balance_amount
    IN AfterBalanceAmount
    OF fin_transaction
    WHERE invoice_nbr = InvoiceNbr
    AND payment_nbr IS NULL;

    Recalculate OPEN;

    LOOP

    FETCH recalculate IN TransactionNumber
    TransactionAmount,
    DiscountTakenAmount;
    OUTPUT WHEN recalculate % NOTFOUND;

    AfterBalanceAmount: = AfterBalanceAmount + TransactionAmount + DiscountTakenAmount;

    UPDATE fin_transaction
    SET after_balance_amount = AfterBalanceAmount,
    after_status = CASE WHEN AfterBalanceAmount = 0.00
    THEN 'C '.
    ELSE 'O'
    END
    WHERE transaction_nbr = TransactionNumber;

    END LOOP;
    Recalculate the RELATIVES;

    END LOOP;
    CLOSE transaction;
    END IF;

    END AFTER STATEMENT;

    END;
    /

    ENGAGE
    /

    Here is the statement of "insert" the origin of the problem:

    INSERT INTO fin_transaction (transaction_nbr, invoice_nbr, payment_nbr, transaction_amount,

    gl_date, transaction_type, discount_amount, transaction_date, reversed_transaction_nbr,

    discount_taken_amount, after_balance_amount, after_status, financial_source, add_by, add_date,

    remaining_onaccount)

    (SELECT 255793, invoice_nbr, payment_nbr, transaction_amount)

    , TO_DATE (' 03/05/2015-00:00:00 "," DD-MM-YYYY HH24:MI:SS'), 'VCHK,' discount_amount, TO_DATE (' 03/05/2015-00:00:00 "," DD-MM-YYYY HH24:MI:SS'),

    255416, discount_taken_amount, after_balance_amount + transaction_amount + 0.000000, 'o', financial_source, 'PLANGTON,'

    To_date (' 03/05/2015-12:31:44 ',' DD-MM-YYYY HH24:MI:SS'), remaining_onaccount

    OF fin_transaction

    WHERE transaction_nbr = 255416)

    Here is the table of the affected table definition:

    CREATE TABLE fin_transaction
    (
    transaction_nbr number not null,
    number of invoice_nbr null,
    number of payment_nbr null,
    transaction_amount number (18.6) not null,
    gl_date date null,
    transaction_type varchar2 (10) not null,
    discount_amount number (18.6) null,
    transaction_date date not null,
    number of reversed_transaction_nbr null,
    discount_taken_amount number (18.6) default null, 0
    after_balance_amount number (18.6) not null,
    after_status char (1) not null
    CONSTRAINT ckc_fin_tran_after_status CHECK (after_status IN ('O', 'C')),
    remaining_onaccount number (18.6) null,
    financial_source char (3) not null
    CONSTRAINT ckc_fin_tran_financial_source CHECK (financial_source IN ('A / P ',' has / R ""));
    reference_id varchar2 (10) null,
    add_by varchar2 (40) not null default user,.
    add_date date DEFAULT sysdate not null,
    number of payment_journal_nbr null,
    misc_amount number (18.6) null,
    misc_gl_acct_nbr varchar2 (75) null,
    pdu_payment_status char (1) default ' is not null
    CONSTRAINT ckc_fin_tran_pdu_paymentstatus CHECK (pdu_payment_status IN (', 'F', 'W', 'O', 'P')),
    remaining_onaccount_original number (18.6) DEFAULT 0 no no,.
    number of vc_register_nbr null,
    vc_register_addto_flag char (1) default ' is not null
    CONSTRAINT ckc_fin_tran_vc_reg_addto_flag CHECK (vc_register_addto_flag IN ('Y', ' don't)).
    additional_gl_transaction_flag char (1) default ' is not null
    CONSTRAINT ckc_fin_tran_add_gl_trans_flag CHECK (additional_gl_transaction_flag IN ('Y', ' don't)).
    gl_exchange_rate number (20,10) null,
    commodity_id varchar2 (10) null,
    CONSTRAINT pk_fin_transaction PRIMARY KEY (transaction_nbr)
    using index
    tablespace smartsoft_index
    )
    tablespace smartsoft_data
    /

    I can not (for the life of me) see this would cause a trigger of mutation.

    Any help would be appreciated.

    BTW Oracle 11.2.0.2 on Windows 64-bit server.

    Murray

    Problem has been resolved by upgrading to 11.2.0.4 and slight modification to trigger.

  • Equivalent OBIEE TO_DATE and SUBSTR functions

    I have the formula for the next column, which works correctly:

    SUM (CASE WHEN (TimeStampDiff (SQL_TSI_month, "Registration - College". "" Effective colleges F. ((("' Program Start Date ', current_date)) / 12 < 6 THEN 1 ELSE 0 END)


    I want to replace the current_date with scope of practice. Because the scope of practice is currently not in a date format (e.g. 201213, 201314, 201415), I need to use the TO_DATE and SUBSTR functions OBIEE equivalent to convert this field into a format that can be used by the TimeStampDiff function.

    The current (outside OBIEE) SQL for the conversion of the year at a date looks like this:

    To_date (substr (Fiscal_Year, 1, 4) |) '09', "YYYYMM")


    I tried to replace current_date in the column formula above by the following, but it didn't work:

    To this day (Substring ("registration - College". "D time". " "Exercise" FROM 1 to 4) | '09', "YYYYMM")

    TO_DATETIME (LEFT ("registration - College". "D time". " ("' Exercise ', 4) | ("/ 09/01 ', ' yyyy/mm/dd')

    Good course assuming that "registration - College". "D time". " "' Exercise ' is of type varchar, otherwise you will first need to cast as varchar or LEFT won't like it (but the error will tell you what the problem is exactly).

  • Problem with procedure

    Hello world

    I created a procedure that takes 2 dates as parameters, and inserts the values of dates between the parameters in the table.

    create or replace procedure ENTER_DATES(START_DATE IN DATE, END_DATE IN DATE) is
    V_ENTERED_DATE date := START_DATE;
    begin
    LOOP
    if V_ENTERED_DATE <= START_DATE then
    insert into TEST_TABLE(NEW_DATE)
    values(V_ENTERED_DATE);
    V_ENTERED_DATE := TO_DATE(V_ENTERED_DATE) + 1;
    EXIT when V_ENTERED_DATE = END_DATE;
    end if;
    END LOOP;
    END;
    /
    

    I have compiled the procedure and had no problem, but when I try to run the procedure. NEVER, THE EXECUTION ENDS.

    exec ENTER_DATES(to_date('01-OCT-14'),to_date('14-OCT-14'));
    

    It of like I started and loop infinite.

    Please help me understand my mistakes.

    This stated case seems confused.

    What happens if your end_date has a share after midnght? He will never leave me.

    Why not just write:

    EVERYTHING V_ENTERED_DATE<= end_date="">

    insert into TEST_TABLE (NEW_DATE)

    values (V_ENTERED_DATE);

    V_ENTERED_DATE: = V_ENTERED_DATE + 1;

    END LOOP;

  • the date conversion problem

    Hi friends,

    I have a problem with the conversion of the date in my PB.

    SELECT eff_dt, TO_CHAR (TO_DATE (eff_dt, 'Dd-mon-yy'), 'dd-mm-yyyy') DATE from une_table;

    It gives me o/p as -.

    DATE OF EFF_DT

    01.01.1950 00:00:00 01/01/2050

    as you can see here the year is wrong, while I convert the date that I use the substr() also to cut the year of first line, but it gives me the 50 i.e. onle last (YY)

    So, if someone can help me with this prob.

    If eff_dt is a column DATE, then stop calling to_date on it.

    If this is not the case, consider making it into a DATE column. If you are unable to do this, use the format mask appropriate when you call to_date

  • TO_DATE with invalid month value does not gicve of error

    I have a where clause that has a where clause of the query condition like this:

     where  Reynolds in ( '113' ) AND Rotomac in ( '418' ) AND (to_date(ins_date,'YYYY/DD/MM') >= to_date('01/90/2012','DD/MM/YYYY') OR del_date is null);
    

    ins_date is varchar2 which I convert it to a DATE using the to_date function.

    Why it does not work it only gives me error even if I put 90 MM?

    you have lines where this part:

    Reynolds ("113") AND Rotomac games ('418')

    and this part

    del_date is null

    is the problem?

    because you get only an error when the condition is evaluated is not the case if she didn't have to be evaluated...

    example:

    SELECT * FROM dual

    where 1 = 2 and sysdate > = to_date('01/90/2012','DD/MM/YYYY')

    will not return an error 1 is never equal to 2, so no matter what the condition after the and is...

    HTH

  • Problem with restore DB

    I backed up the database using sqldeveloper > tools > export databases > suckered into the sql file. But now I don't know how to restore, in particular tables, they contain important data. Database is 11g.

    I backed up the database using sqldeveloper > tools > export the database > suckered into the sql file. But now I don't know how to restore, in particular tables, they contain important data. Database is 11g.

    -Now you can have a bit of a problem. Developer SQL creates just one (or more) files SQL according to the options you have chosen.

    If you put everything in a SINGLE file restore you what you want by finding and running portions of the file that you want to use MANUALLY.

    Here it is just a SMALL example of an 'export' for a file ONLY the SCOTT dept and emp tables and data. You can see how everything (TABLE DDL, DATA) is just mixed:

    --------------------------------------------------------
    -File created - Monday-June-02-2014
    --------------------------------------------------------
    --------------------------------------------------------
    -The DOF for Table DEPT
    --------------------------------------------------------

    "CREATE TABLE"SCOTT" DEPT.
    ("DEPTNO" NUMBER (2.0),)
    VARCHAR2 (14 BYTE) "DNAME",.
    "LOC" VARCHAR2 (13 BYTE)
    ) CREATION OF IMMEDIATE SEGMENT
    PCTFREE, PCTUSED, INITRANS 40 10 1 MAXTRANS 255 NOCOMPRESS SLAUGHTER
    STORAGE (INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645)
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS USER_TABLES DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT 1)
    TABLESPACE 'USERS ';
    --------------------------------------------------------
    -The DOF for EMP Table
    --------------------------------------------------------

    "CREATE TABLE"SCOTT" EMP.
    ('EMPNO' NUMBER (4,0),)
    'ENAME' VARCHAR2 (10 BYTE),
    VARCHAR2 (BYTE 9) "JOB."
    "MGR" NUMBER (4,0).
    "HIREDATE" DATE,
    "SAL" NUMBER (7.2).
    NUMBER (7.2) "COMM"
    "DEPTNO" NUMBER (2.0)
    ) CREATION OF IMMEDIATE SEGMENT
    PCTFREE, PCTUSED, INITRANS 40 10 1 MAXTRANS 255 NOCOMPRESS SLAUGHTER
    STORAGE (INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645)
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS USER_TABLES DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT 1)
    TABLESPACE 'USERS ';
    REM, INSERTING in SCOTT. DEPT
    TOGETHER TO DEFINE
    Insert into SCOTT. DEPT (DEPTNO, DNAME, LOC) values (10, 'ACCOUNTS', 'NEW YORK');
    Insert into SCOTT. DEPT (DEPTNO, DNAME, LOC) values (20, ' SEARCH * ","DALLAS");
    Insert into SCOTT. DEPT (DEPTNO, DNAME, LOC) values (30, ' SALES * ","CHICAGO");
    Insert into SCOTT. DEPT (DEPTNO, DNAME, LOC) values (40, 'OPERATIONS', 'BOSTON');
    REM, INSERTING in SCOTT. FM3
    TOGETHER TO DEFINE
    Insert into SCOTT. Values of EMP (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO) (7369, 'new_SMITH', 'CLERK', 7902, to_date('17-DEC-80','DD-MON-RR'), 30, null, 20);
    Insert into SCOTT. Values of EMP (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO) (7499, 'ALLEN', 'SALESMAN', 7698, to_date('20-FEB-81','DD-MON-RR'), 1600,300, 30);
    Insert into SCOTT. Values of EMP (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO) (7521, 'WARD', 'SALESMAN', 7698, to_date('22-FEB-81','DD-MON-RR'), 1250,500, 30);
    Insert into SCOTT. Values of EMP (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO) (7566, 'new_JONES', 'MANAGER', 7839, to_date('02-APR-81','DD-MON-RR'), 2975, null, 20);
    Insert into SCOTT. Values of EMP (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO) (7654, 'MARTIN', 'SALESMAN', 7698, to_date('28-SEP-81','DD-MON-RR'), 1250,1400, 30);
    Insert into SCOTT. Values of EMP (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO) (7698, 'BLAKE', 'MANAGER', 7839, to_date('01-MAY-81','DD-MON-RR'), 2850, null, 30);
    Insert into SCOTT. Values of EMP (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO) (7782, 'CLARK', 'MANAGER', 7839, to_date('09-JUN-81','DD-MON-RR'), 2450, null, 10);
    Insert into SCOTT. Values of EMP (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO) (7788, 'new_SCOTT', 'ANALYST', 7566, to_date('19-APR-87','DD-MON-RR'), 3000, null, 20);
    Insert into SCOTT. Values of EMP (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO) (7839, 'KING', 'PRESIDENT', null, to_date('17-NOV-81','DD-MON-RR'), 5000, null, 10);


    Insert into SCOTT. Values of EMP (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO) (7844, 'TURNER', 'SALESMAN', 7698, to_date('08-SEP-81','DD-MON-RR'), 1500,0, 30);
    Insert into SCOTT. Values of EMP (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO) (7876, 'new_ADAMS', 'CLERK', 7788, to_date('23-MAY-87','DD-MON-RR'), 1100, null, 20);
    Insert into SCOTT. Values of EMP (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO) (7900, 'JAMES', 'CLERK', 7698, to_date('03-DEC-81','DD-MON-RR'), 950, null, 30);
    Insert into SCOTT. Values of EMP (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO) (7902, 'new_FORD', 'ANALYST', 7566, to_date('03-DEC-81','DD-MON-RR'), 3000, null, 20);
    Insert into SCOTT. Values of EMP (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO) (7934, 'MILLER', 'CLERK', 7782, to_date('23-JAN-82','DD-MON-RR'), 1300, null, 10);

Maybe you are looking for