A wierd date value when updating table

Hi all,
This looks totally strange to me. I have a table that has a column of type 'Date'. DataBase is Oracle 10g/11g.
In the Java code, the query looks like this:
"update mytable set Time_stamp = to_date(?,'yyyy-mm-dd hh24:mi:ss') "...
stmt.setString(1, "2010-12-06 17:17:08");
When checking the table after this update, it shows '12/6/2010 5:17:08 AM'
Please notice the '*AM*'. Why did this happen?
Thanks!
Shawn

Hi,
1) Check Tools-> Preferences -> Database -> NLS for Jdeveloper settings.
2) To check the date format in DB:
ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY MM DD';
select sysdate from dual;
ALTER SESSION SET NLS_DATE_FORMAT = 'HH24:MI:SS';
select sysdate from dual;
As long the value passed to the DB column is in the same data-type, you don't have to worry about the date value. Just use appropriate format mask while showing in the UI.
Thanks,
Harikiran

Similar Messages

  • Error converting data when updating table

    Hi,
    I need to understand why I cannot gat my update to work properly, I have to concat 4 fields (numbers with leading zeros so I can create a new number with leading 1. My field is already set as a bigint but I cannot convert the resulting string properly
    UPDATE table 
    set field = convert(bigint, '1', strfield1 + strfield2 + strfield3 + strfield4)
                                           1,  001      
    +   0125   + 0045      + 004568 
    The end result need to return the number 100101250045004568  to be inserted into a bigint field but I always get the following error:
    Error converting data type nvarchar to bigint
    If I try a select , it shows the proper result, so what am I missing here

    Guess I will have to wait for our new SQLServer 2012, coming in next week, I have tried every possible cast, convert possibility to make it work.
    Thank you all
    Al
    This should work fro SQL Server 2008 R2
    select CAST(('1'+ strfield1 + strfield2 + strfield3 +strfield4) AS BIGINT);
    web: www.ronnierahman.com

  • Modification Date changes when updating Open With?!?!

    Forgive me if this is mentioned elsewhere. I have been searching these forums and not seen this problem.
    If I do a 'Get Info' on a file in the Finder and change the application it opens with, the Modification Date changes to 'now'. Why in the world would this happen? This is not how 10.3.x worked, and certainly doesn't make any sense since I am not actually modifying the file. I am simply changing the OS's metadata about which app to use. This info isn't even stored in the file itself, as evidenced by burning such an document to a CD or moving it through a network server then opening it on a machine with different default apps for certain extensions.
    Is this just another wacky step backwards in the world of the Apple OS X Finder, or am I missing a way to avoid this?
    PowerMac G5 2.5DP   Mac OS X (10.4.3)  

    This is not how 10.3.x worked, and certainly doesn't make any sense since I am not actually modifying the file.
    Actually, I am using "Panther" now, and can confirm that changing the application to be used to open an individual file through "Get Info" does in fact change the modification date.
    When the "Change all" button is used, the modification date of other files of that type won't be affected by this change since that modification is presumably made somewhere in the "Launch Services" database to set the "default" application to be used for that file type. Perhaps this is what you were thinking of.
    However, for that first file (or any file changed individually), the file is in fact modified, and the "Open with" information is stored with the file, in its "resource fork". Usually, a 'usro' resource (specifying the application) and an 'icns' resource (for the app's custom icon for that file type) are added. You can try this yourself - drag any image from Safari.app to the "Desktop" and open the info window for that image - such images usually don't have a "resource fork". Make note of the file's size, then change the "Open with" application. You should immediately see an increase in the file's size (to account for the addition of the "resource fork") accompanied by an update of the file's modification date to reflect this modification.

  • View Panel : Change color of data values in channel table

    Hi,
    Is there a way wherein I can change the color of a particular data value or data block  in a channel in the VIEW panel and can this be done programtically? I am using DIAdem 2010.
    Looking forward for your response
    Thanks in advance
    Priya

    Hi Pria,
    There is no way to change the color of various cells in a VIEW table.  This can be done (for the text color, not the cell background) in a REPORT table with the help of a customer-defined UserCommand.  I can send you an example of this if having the display in REPORT would help.
    If you had a newer version of DIAdem, you could embed a SUDialog in a VIEW area, and this SUDialog could have an XTable control that would enable you to show this type of display-- not easy, and not with DIAdem 10.2, but at least something to consider.
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • Has anyone experienced a activity actual start date moving when updating progress

    When updating an activity progress in a small schedule i notice that one of my activities which had already started  on march 19th and was about 10% complete from a prior update jumped to March 23rd as start date. What is going on???

    Could the activity be a Level of Effort or a WBS Summary? If so, it will follow any change to the earliest starting activity, if you made a change to this activity.

  • Database error when updating table ADRC

    Hi,
    We are on ECC 5.0 & are facing a problem whille maintaining anything relevant to table ADRC.
    For eg., if we try to maintain storage location or create a vendor code (XK01), for some inputs it works ...but most times the update just terminates with a message "Database error when changing table ADRC".
    Pls. help.
    Thanks,
    Saba.

    Hi
    You can refer to following SAP Notes in case they help:
    385440   Repairing inconsistencies in Customizing addresses
    417809    Customizing objects display incorrect addresses
    186910    Customers / vendors with incorrect address
    Otherwise i want to know more about the error you are getting to help you in better way.
    Thanks and Regards
    Esha Rajpal

  • Data missing when update SIS use RMCVNEUL/RMCVNEUF

    When update information structure Sxxx use ABAP program RMCVNEUL/RMCVNEUF, I found APERDAT for this Sxxx was missing.
    Any reason?
    Thanks a lot.

    This link http://support.apple.com/kb/HT1518 will be helpful when creating your original presentation. Make sure the symbols are being created with Unicode. You also may want to check your iPad settings under General -> Keyboards -> International for a keyboard that can enter to correct characters if you are entering them from the iPad's keyboards. There are also some .99 apps that enable entering symbols and special characters directly on the iPad.
    HTH

  • How to reduce time when updating table with join of anther table

    Hi all,
    I am update table Policy1 using another table from other scheme
    Policy1 is in schema "TEST".
    TRN_POLICY_RISK_GIS is in Schema "TEST2".
    Now i am executing my query which is taking lot of time to update and make cpu utilization upto 45%.
    update policy1 set total_si = (select total_is from (select pol_sys_id,
    avg(nvl(pol_cvr_si,0)) total_si from TEST2.TRN_POLICY_COVER_GIS tpcg
    group by pol_sys_id ) b where p.pol_sys_id = b.pol_sys_id)
    Help to optimize to given query.

    update policy1    A
        set total_si =
           (select avg(nvl(pol_cvr_si,0))
               from TEST2.TRN_POLICY_COVER_GIS    B
              where B.pol_sys_id = A.pol_sys_id
    ;hopefully there is an index on TEST2.TRN_POLICY_COVER_GIS (POL_SYS_ID)

  • Updating table with Modified date/time when updating any row

    Hi guys,
    What I am trying to do is this. I have a several rows in my table, alongwith the field 'Modified_date'. I want to insert a modified_date if and when I update the row in the table. Here's my code, but it's not working:
    PROCEDURE ip_maint_save (p_submit IN VARCHAR2 DEFAULT NULL ,
    p_user_no IN varchar_array_type,
    p_user_id IN varchar_array_type,
    p_ip_first IN varchar_array_type,
    p_ip_last IN varchar_array_type,
    p_user_type IN varchar_array_type,
    p_user_language IN varchar_array_type,
    p_blue_jays IN varchar_array_type,
    p_created_by IN varchar_array_type,
    p_modified_by IN varchar_array_type,
    p_modified_date IN DATE := SYSDATE
    IS
    v_count_rec PLS_INTEGER := 0;
    BEGIN
    FOR i IN NVL (p_user_no.FIRST, 1) .. NVL (p_user_no.LAST, 0) LOOP
    IF p_user_id (i) IS NOT NULL THEN
    BEGIN
    UPDATE IP_MAP
    SET IP_FIRST = p_ip_first (i),
    IP_LAST = p_ip_last (i),
    USER_ID = p_user_id (i),
    USER_TYPE = p_user_type (i),
    USER_language = p_user_language (i),
    IP_FIRST_number = Mr_Ip_Maint.ip_to_number (p_ip_first (i)),
    IP_LAST_number = Mr_Ip_Maint.ip_to_number (p_ip_last (i)),
    MODIFIED_DATE = p_modified_date (i)
    WHERE USER_NO = p_user_no (i);
    .....rest of the code/exceptions follow....
    It's not working. Although, I am able to update a row, but it's not inserting/updating the modified_date field in the table for which the row is updated.
    Thanks in advance.

    Hi,
    As per my understanding, you are passing many values at a time to be updated using varchar_array_type type. In such scenario if your User_no is 100,101,102 all are being looped and the table is updated. But where are you checking the updated field or on what bases you will come to know that this particular field is updated.
    I will suggest you to use before update triggers. As in triggers you can check the rows old and new value and then set sysdate for modified_date column.
    Something like this,
    create or replace trigger trg_IP_MAP on IP_MAP
    before update
    For Each Row
    Begin
         If (:OLD.IP_FIRST != :NEW.IP_FIRST  OR
              :OLD.IP_LAST != :NEW.USER_ID OR
              :OLD.USER_TYPE != :NEW.USER_TYPE OR
              :OLD.USER_language != :NEW.USER_language OR
              :OLD.IP_FIRST_number !=:NEW.IP_FIRST_number OR
              :OLD.IP_LAST_number != :NEW.IP_LAST_number) THEN
                   :NEW.MODIFIED_DATE = SYSDATE
         END IF;
    END;Twinkle

  • Incorrect data value when insert into oracle table

    Would like to ask expert here, how could I insert data into oracle table where the value is 03 ? The case is like that,  the column was defined as varchar2(50) data type, and I have a csv file where the value is 03 but when load into oracle table the value become 3 instead of 03.

    user11432758 wrote:
    Would like to ask expert here, how could I insert data into oracle table where the value is 03 ? The case is like that,  the column was defined as varchar2(50) data type, and I have a csv file where the value is 03 but when load into oracle table the value become 3 instead of 03.
    implicit datatype conversion to NUMBER can result in leading zero to be eliminated.
    How do I ask a question on the forums?
    https://forums.oracle.com/message/9362002#9362002

  • I have a problem when update tables with a database link (APEX)

    Hi, I search answers for my problem and I not found a solution. My problem start when I open page with database link statement in APEX. I drop tables and execute this for update the tables in APEX.
    EXECUTE IMMEDIATE 'CREATE TABLE XXXXXXX
    AS
    SELECT A1,A2,A3
    FROM AAA@BBB';
    I use Mozilla Firefox and isn't always updated the tables because it shows dialog for downloading file "f". I rename the file to txt and I see the text "IBMPC/WIN_NT-8.1.0"...
    In the explorer always show a window only the text "IBMPC/WIN_NT-8.1.0"...
    What is the solution for my problem? I need update this tables.
    Thanks. John.

    It's easy. It doesn't work a database link, on apex, with a pl/sql code or store procedure.
    I saw that many people had the same problem but I don't see a solution.
    As I put up, I want to remove my tables on APEX and copy the table of my Oracle database with the update dates.
    The posts are from the same problem as my English is very bad, it got to help explain the problem.
    I have a page with a pl/sql code. This code in Oracle is correctly.
    For example, with this code I update the table PRUEBAS with the data of TABLEX.
    BEGIN
    BEGIN
    EXECUTE IMMEDIATE 'DROP TABLE "PRUEBAS"';
    EXCEPTION WHEN OTHERS THEN NULL;
    END;
    EXECUTE IMMEDIATE 'CREATE TABLE "PRUEBAS"
    AS
    SELECT AAA,
    BBB,
    CCC
    FROM TABLEX';
    END;
    But, in this code, I have the problem.
    BEGIN
    BEGIN
    EXECUTE IMMEDIATE 'DROP TABLE "PRUEBAS"';
    EXCEPTION WHEN OTHERS THEN NULL;
    END;
    EXECUTE IMMEDIATE 'CREATE TABLE "PRUEBAS"
    AS
    SELECT AAA,
    BBB,
    CCC
    FROM TABLEX@DB_LINK';
    END;
    I sometimes get an error. Sometimes it works fine, but half of the tries Apex returns "IBMPC/WIN_NT-8.1.0" in the browser and I am not using an IBM PC or Win NT...
    And i read that In the alert_xe.log file there are a error of core dump... ... :S or that the application return corrupt headers.... Is a problem of versions?
    I used a synonym and I have the same problem.      
    Even if I run the code on SQL COMMANDS (SQL WORKSHOP) it shows dialog for downloading file "f". I rename the file to txt and I see the text "IBMPC/WIN_NT-8.1.0"...
    The problem is in Mozilla Firefox and in IE.
    I have the OracleXE 10g (Application Express 3.0.1.00.08).
    And the question is.. ... ... ... ... What is the solution? :)
    Thanks.
    John.

  • Why Doesn't Query Return Date Values On Eval Table?

    Using Oracle 11.2.0.1 with XMLType Secure File Table named Eval.
    An interesting situation is occurring when attempting to query. A couple of things are going on.
    These queries do not have registered schemas.
    1. This query works fine
    SELECT xmlcast(xmlquery('declare default element namespace "http://www.cigna.com/acme/domains/eval/2010/03";
    declare namespace ns7="http://www.cigna.com/acme/domains/derived/fact/2010/03";
    $p/eval/derivedFacts/ns7:derivedFact/ns7:defId' passing e.object_value AS "p" RETURNING CONTENT)
    AS varchar2(100)) "Definition ID"
    FROM eval e;When adding a condition in the query to get defId=52657, get all nulls - even though this record exists - see sample data below.
    SELECT xmlcast(xmlquery('declare default element namespace "http://www.cigna.com/acme/domains/eval/2010/03";
    declare namespace ns7="http://www.cigna.com/acme/domains/derived/fact/2010/03";
    $p/eval/derivedFacts/ns7:derivedFact[/ns7:defId=888]/ns7:defId' passing e.object_value AS "p" RETURNING CONTENT)
    AS varchar2(100)) "Definition ID"
    FROM eval e;
    <?xml version = '1.0' encoding = 'UTF-8' standalone = 'yes'?><eval createdById="1957" acmeMemberId="3df55bd8-b3a6-4ba3-85e7-e8a188b7b4ed" category="external" eval_dt="2012-02-11T23:45:10.266Z" evalId="876d4035-aaf9-4f09-ae40-43498ec4973b" xmlns="http://www.cigna.com/acme/domains/eval/2010/03" xmlns:ns2="http://www.cigna.com/acme/domains/derived/fact/2010/03" xmlns:ns3="http://www.cigna.com/acme/domains/common/2010/03">
       <derivedFacts>
          <ns2:derivedFact>
             <ns2:defId>52657</ns2:defId>
             <ns2:defUrn>urn:coderunner:Medical:Definition:DerivedFact:52657:1</ns2:defUrn>
             <ns2:factSource>CCDR Member</ns2:factSource>
             <ns2:origInferred_dt>2012-02-11T23:45:10.266Z</ns2:origInferred_dt>
             <ns2:factValue>
                <ns2:type>boolean</ns2:type>
                <ns2:value>true</ns2:value>
             </ns2:factValue>
          </ns2:derivedFact>
          <ns2:derivedFact>
             <ns2:defId>52600</ns2:defId>
             <ns2:defUrn>urn:coderunner:Medical:Definition:DerivedFact:52600:2</ns2:defUrn>
             <ns2:factSource>CCDR Member</ns2:factSource>
             <ns2:origInferred_dt>2012-02-11T23:45:10.266Z</ns2:origInferred_dt>
             <ns2:factValue>
                <ns2:type>string</ns2:type>
                <ns2:value>null</ns2:value>
             </ns2:factValue>
          </ns2:derivedFact>
          <ns2:derivedFact>
             <ns2:defId>52599</ns2:defId>
             <ns2:defUrn>urn:coderunner:Medical:Definition:DerivedFact:52599:1</ns2:defUrn>
             <ns2:factSource>CCDR Member</ns2:factSource>
             <ns2:origInferred_dt>2012-02-11T23:45:10.266Z</ns2:origInferred_dt>
             <ns2:factValue>
                <ns2:type>string</ns2:type>
                <ns2:value>INT</ns2:value>
             </ns2:factValue>
          </ns2:derivedFact>
          <ns2:derivedFact>
             <ns2:defId>51400</ns2:defId>
             <ns2:defUrn>urn:coderunner:Medical:Definition:DerivedFact:51400:1</ns2:defUrn>
             <ns2:factSource>CCDR Member</ns2:factSource>
             <ns2:origInferred_dt>2012-02-11T23:45:10.266Z</ns2:origInferred_dt>
             <ns2:factValue>
                <ns2:type>integer</ns2:type>
                <ns2:value>34</ns2:value>
             </ns2:factValue>
          </ns2:derivedFact>
          <ns2:derivedFact>
             <ns2:defId>52177</ns2:defId>
             <ns2:defUrn>urn:coderunner:Medical:Definition:DerivedFact:52177:3</ns2:defUrn>
             <ns2:factSource>CCDR Member</ns2:factSource>
             <ns2:origInferred_dt>2012-02-11T23:45:10.266Z</ns2:origInferred_dt>
             <ns2:factValue>
                <ns2:type>string</ns2:type>
                <ns2:value>null</ns2:value>
             </ns2:factValue>
          </ns2:derivedFact>
          <ns2:derivedFact>
             <ns2:defId>52075</ns2:defId>
             <ns2:defUrn>urn:coderunner:Medical:Definition:DerivedFact:52075:1</ns2:defUrn>
             <ns2:factSource>CCDR Member</ns2:factSource>
             <ns2:origInferred_dt>2012-02-11T23:45:10.266Z</ns2:origInferred_dt>
             <ns2:factValue>
                <ns2:type>string</ns2:type>
                <ns2:value>M</ns2:value>
             </ns2:factValue>
          </ns2:derivedFact>
          <ns2:derivedFact>
             <ns2:defId>51391</ns2:defId>
             <ns2:defUrn>urn:coderunner:Medical:Definition:DerivedFact:51391:1</ns2:defUrn>
             <ns2:factSource>CCDR Member</ns2:factSource>
             <ns2:origInferred_dt>2012-02-11T23:45:10.266Z</ns2:origInferred_dt>
             <ns2:factValue>
                <ns2:type>boolean</ns2:type>
                <ns2:value>true</ns2:value>
             </ns2:factValue>
          </ns2:derivedFact>
          <ns2:derivedFact>
             <ns2:defId>51473</ns2:defId>
             <ns2:defUrn>urn:coderunner:Medical:Definition:DerivedFact:51473:1</ns2:defUrn>
             <ns2:factSource>CCDR Product</ns2:factSource>
             <ns2:origInferred_dt>2012-02-11T23:45:10.266Z</ns2:origInferred_dt>
             <ns2:factValue>
                <ns2:type>date</ns2:type>
                <ns2:value>2011-01-01</ns2:value>
             </ns2:factValue>
          </ns2:derivedFact>
          <ns2:derivedFact>
             <ns2:defId>51474</ns2:defId>
             <ns2:defUrn>urn:coderunner:Medical:Definition:DerivedFact:51474:1</ns2:defUrn>
             <ns2:factSource>CCDR Product</ns2:factSource>
             <ns2:origInferred_dt>2012-02-11T23:45:10.266Z</ns2:origInferred_dt>
             <ns2:factValue>
                <ns2:type>date</ns2:type>
                <ns2:value>9999-12-31</ns2:value>
             </ns2:factValue>
          </ns2:derivedFact>
          <ns2:derivedFact>
             <ns2:defId>52151</ns2:defId>
             <ns2:defUrn>urn:coderunner:Medical:Definition:DerivedFact:52151:3</ns2:defUrn>
             <ns2:factSource>CCDR Product</ns2:factSource>
             <ns2:origInferred_dt>2012-02-11T23:45:10.266Z</ns2:origInferred_dt>
             <ns2:factValue>
                <ns2:type>boolean</ns2:type>
                <ns2:value>true</ns2:value>
             </ns2:factValue>
          </ns2:derivedFact>
          <ns2:derivedFact>
             <ns2:defId>51048</ns2:defId>
             <ns2:defUrn>urn:coderunner:Medical:Definition:DerivedFact:51048:5</ns2:defUrn>
             <ns2:factSource>CCDR ProfileFact</ns2:factSource>
             <ns2:origInferred_dt>2012-02-11T23:45:10.266Z</ns2:origInferred_dt>
             <ns2:factValue>
                <ns2:type>boolean</ns2:type>
                <ns2:value>true</ns2:value>
             </ns2:factValue>
          </ns2:derivedFact>
          <ns2:derivedFact>
             <ns2:defId>60380</ns2:defId>
             <ns2:defUrn>urn:coderunner:Medical:Definition:DerivedFact:60380:1</ns2:defUrn>
             <ns2:factSource>CCDR ProfileFact</ns2:factSource>
             <ns2:origInferred_dt>2012-02-11T23:45:10.266Z</ns2:origInferred_dt>
             <ns2:factValue>
                <ns2:type>boolean</ns2:type>
                <ns2:value>true</ns2:value>
             </ns2:factValue>
          </ns2:derivedFact>
       </derivedFacts>
    </eval>Seem to be missing something conceptually, as to why this is not working.
    2. When replacing defId with origInferred_dt and adjust for the datatype; the query returns all nulls
    SELECT xmlcast(xmlquery('declare default element namespace "http://www.cigna.com/acme/domains/eval/2010/03";
    declare namespace ns7="http://www.cigna.com/acme/domains/derived/fact/2010/03";
    $p/eval/derivedFacts/ns7:derivedFact/ns7:origInferred_dt' passing e.object_value AS "p" RETURNING CONTENT)
    AS TIMESTAMP WITH TIME ZONE) "Original Inferred Date"
    FROM croutreach.eval e;Same here, seem to be missing something conceptually...
    Ultimately hoping to get this query to correctly work:
    SELECT xmlcast(xmlquery('declare default element namespace "http://www.cigna.com/acme/domains/eval/2010/03";
    declare namespace ns7="http://www.cigna.com/acme/domains/derived/fact/2010/03";
    $p/eval/derivedFacts/ns7:derivedFact[/ns7:defId=52657]/ns7:origInferred_dt' passing e.object_value AS "p" RETURNING CONTENT)
    AS TIMESTAMP WITH TIME ZONE) "Original Inferred Date"
    FROM croutreach.eval e;Any assistance would be much appreciated to say the least! :)
    Regards,
    Rick Blanchard

    Hi Rick,
    Ultimately hoping to get this query to correctly work:
    SELECT xmlcast(xmlquery('declare default element namespace "http://www.cigna.com/acme/domains/eval/2010/03";
    declare namespace ns7="http://www.cigna.com/acme/domains/derived/fact/2010/03";
    $p/eval/derivedFacts/ns7:derivedFact[/ns7:defId=52657]/ns7:origInferred_dt' passing e.object_value AS "p" RETURNING CONTENT)
    AS TIMESTAMP WITH TIME ZONE) "Original Inferred Date"
    FROM croutreach.eval e;
    Remove the initial slash in the predicate [ns7:defId=...] :
    xmlcast(
      xmlquery(
        'declare default element namespace "http://www.cigna.com/acme/domains/eval/2010/03"; (::)
         declare namespace ns7="http://www.cigna.com/acme/domains/derived/fact/2010/03"; (::)
         $p/eval/derivedFacts/ns7:derivedFact[ns7:defId=52657]/ns7:origInferred_dt'
         passing e.object_value AS "p"
         RETURNING CONTENT
      AS TIMESTAMP WITH TIME ZONE
    ) "Original Inferred Date"

  • Inbound idoc values when updated from user exit not saved

    I'm trying to process some user exits of an inbound idoc from WE19.
    The values get correctly populated to IDOC_DATA internal tables of IDOC_INPUT_ORDRSP function module in debug kode
    but when the new idoc is generated from WE19 , those segment values (populated by exit) are not shown/saved.
    The user exit is EXIT_SAPLEINM_007.
    Is it not possible to populate segment values of inbound idocs from using user exits. If yes , then during testing using WE19 , every time a new idoc is created it should display those values into the concerned segments. Please help.

    Hello,
    yes is possible it ...
    I think the problem is:
    or
    you have something wrong when to append the new line on internal table
    or
    the exit used is not correct: read the documentation on EXIT_SAPLEINM_0**

  • Trigger setting value when updating

    I need to have a row-level trigger set a value only when an update parameter is not specified in the query. The following trigger doesn't work as expected in SQL Developer - :new.prj_sync_modified_by seems to be the prior value in the row. I need to have :new.prj_sync_modified_by set to 0 whever an update does not specify a value for the prj_sync_modified_by column.
    CREATE OR REPLACE TRIGGER "MQSR"."TR_PROJECT_IU"
    before insert or update
    on PROJECT
    referencing old as old new as new
    for each row
    begin
    if inserting then
    :new.prj_sync_created_dt := sysdate;
    if :new.prj_sync_created_by is null then
    :new.prj_sync_created_by := 0;
    end if;
    end if;
    :new.prj_sync_modified_dt := sysdate;
    if :new.prj_sync_modified_by is null then
    :new.prj_sync_modified_by := 0;
    end if;
    end TR_PROJECT_IU;
    ALTER TRIGGER "MQSR"."TR_PROJECT_IU" ENABLE;
    Thanks in advance,
    Dave

    Thanks. I found the right syntax for the update part:
    if not updating('prj_sync_modified_by') then
    :new.prj_sync_modified_by := 0;
    end if;
    I need to overwrite the prior prj_sync_modified_by value with 0 if no value is specified (not just at row initialization). Between setting a column default and the above (for inserts), I think I'm set.
    Message was edited by:
    user625389

  • PLS-00327 when updating table from a remote table inside a PLSQL procedure

    Hi,
    Inside a PL/SQL procedure,I want to update a table from a remote table :
    begin
    UPDATE rachel1 set NEW_TEN_CODE =
    (SELECT NEW_TEN_CODE FROM rachel@REFI
    WHERE rachel1.OLD_TEN_CODE=rachel.OLD_TEN_CODE@REFI);
    end;
    I receive the error :
    PLS-00327: "RACHEL" is not in SQL scope here
    When I extract the update from the procedure and I run from SQL (without begin ... end), it works :
    SQL> UPDATE rachel1 set NEW_TEN_CODE =
    2 (SELECT NEW_TEN_CODE FROM rachel@REFI
    3 WHERE rachel1.OLD_TEN_CODE=rachel.OLD_TEN_CODE@REFI);
    So, why doesn't the update work inside the PL/SQL procedure ?
    What have I to do ?
    I need to run this command inside the procedure.
    Regards,
    Rachel

    Hi,
    Yes, the owner of the procedure have select on RACHEL@REFI.
    My oracle version is : 8.1.7.4.
    In fact, I've resolved the problem by doing :
    begin
    UPDATE rachel1 set NEW_TEN_CODE =
    (SELECT NEW_TEN_CODE FROM rachel@REFI
    WHERE rachel1.OLD_TEN_CODE=rachel.OLD_TEN_CODE);
    end;
    Regards,
    Rachel

Maybe you are looking for

  • Text editor in Score module agonizingly clunky!  Fix?

    When creating scores from midi regions, the text editor drives me nuts when adding lyrics: The word/character positioning is different between text edit/create mode and what appears on the screen after editing, and different again between that and wh

  • In Lookout, how can I make the equivalent of a "4 changes per day" set-back thermostat?

    Ok... I need some help here.... I have a Pot_TSP (Temperature setpoint) that uses a PLC register as its remote source. I added a night-time temperature setback feature by adding a "DAYTIME" expression as a permissive, and tying two new Pots (Pot_SP1

  • BC templates : Do they create DWT files?

    Hi: When I create a template in BC, are DWT files created? Where are they stored? I thought I could download and edit the DWT file in Dreamweaver after creating the template in BC, but I don't see it anywhere. Thanks, Cam

  • Long running background job

    Hi,           We are facing problem with an MM job, this job some time finishes in few minutes or some times it will be running for a long time so that we should kill the job manually.                                                                  

  • Shared JNDI view among security role

    Hi, We're working on project which needs to expose EJB across different Apps( EAR) in the same OC4J. To my knowledge, in order for those Apps to be able to access the JNDI entry for the exposed EJB, there could be follwing options. * To enable JNDI e