About sysdate

hi,
I want to know what's today from system.
===>select to_char(to_date(sysdate,'yyyy-mm-dd hh24:mi:ss'),'day') from dual;
the result is tuesday ,but I want to get the number '2' and Monday is 1 , Friday is 5.......
Thanks for your help!
jing

do not rely oracle document...
using to_char(sysdate,'D') is delivering different result in america, europe, bengladesh...
prefer
select decode(to_char(sysdate,'FMDAY','NLS_DATE_LANGUAGE=american'),'MONDAY',1,'TUESDAY',2...

Similar Messages

  • Hardware Requirement for Oracle Database

    Hi, i need help, i wanna build new server with some requirement of total user who is connect, size of database n etc. Can u tell me how to calculate ram size, processor need and etc to build good server for my company need?
    I remember Oracle before have some excel where we can fill the total user n other information n from that information the excel will tell u how many processor do u need, what ram size do u need n other else. Can someone help me find this excel??

    user11257918 wrote:
    There is 3360 user who wil connect concurrently to the database and there is 20 million customers in my master customer.
    Is really don't have some formula or other things that help me to decide the number of processor and size of the ram?There are formulas. They are generally useless. Any formulas are only as good as the assumptions and, unless you know the assumptions you will not know whether the formulas are in any way valid.
    Questions you need to answer are all around workload.
    3360 concurrent users who only ask about sysdate will not load the system much. 3360 users who only ask 'what is the customer phone number' using only a properly indexed customer name field will likely not have a huge impact, although you may need to play with the index and the buffer cache for a bit. 3360 users who do concurrent 50 table joins with 20M row sort-merges will have a different impact on the system requirements. And 3360 users who perform updates and inserts using randomly assembled dynamic SQL with no bind variables at all will have a completely different impact again.
    (Then again, user 3360 is known to ask some tough questions. But provide good answers as well. ;-) Have to say, I haven't seen much from 3360 lately. Different handle?)
    The usual way to get a reasonable idea of the size is to prototype or benchmark. The best benchmark is a copy or simulation of your proposed environment. Skip this, and you will forever be 'right sizing' the app, no matter how much you calculate.
    One way I've seen it successfully done is to do a small benchmark,use the SpecMARK tables (http://www.spec.org) to scale.

  • Insert date query

    Hi,
    I dont know whether this is the correct forum to post this query. (If not then kindly direct me to correct one..Thanks)
    I have a table containing 3 date columns. 1 of the column contains date and time stamp generated by my application. Now, what I need is, I want to insert the date and time in the 2nd column , which will be +8hrs of 1st column. for eg. 1st column value is ( 5-feb-2012 13:30:00) .. and I want to insert (5feb-2012 21:30:00) in the second column.
    Similarly for the 3rd column the value to be inserted is +24hrs.
    All the exampls I came across talk about sysdate +, which would not work in this case as most of the date and time stamps are from past.
    Kindly suggest how can I do it??
    Thanks for any help in advance.
    Regards,
    Raj

    Hi Raj,
    I suggest you try asking this question on the SQL and PL/SQL Forum PL/SQL
    David

  • Current Date Object

    Hi,
    i´d been searching for this for a long time but still don´t get it! how do i create a new object @universe level wich only delivers the current date or sysdate? i´d read a lot about SYSDATE but no change...
    does the universe support objects that do not reference to a current object member but rather calculates the current date via MDX?
    by the way a need to create such an object @universe, not within the bw query.
    Thanks a lot for help.

    Hi,
    Create an object date1 of type date.
    In select clause,
    dim_date.calendar_date
    in where clause,
    to_char(dim_date.calendar_date,'dd-mon-yyyy') = (select to_char(sysdate-1,'dd-mon-yyyy') from dual).
    Hope this will solve your problem.
    Acc to my knowledge, We can't use directly currentdate() function in universe.
    This link may be help you:
    http://www.gulland.com/wp/?p=18

  • Question about inserting Sysdate (SQL)

    Hi all,
    I got a question about records insert when one of the fields is sysdate.
    I have to store several records representing a log, generated by the execution of a database package.
    Inside my package I wrote an internal procedure devoted to insert a record in my log table for each processing step I wanted to trace (I call this proc each time I want to record a certain step of my package).
    My log table structure is: PREC_LOGS(log_date DATE, log_message VARCHAR2(1000)), no constraints at all.
    Database ver. 8.1.7.1.0 - Production for VMS O.S.
    The 'problem' occurs when several records have the same sysdate (DD-MM-YYYY HH24:MI:SS). In this case, if I select log_date,log_message ... order by log_date, the list of records I get respects the sort condition, but when several records have the same sysdate (DD-MM-YYYY HH24:MI:SS), it doesn't respect the order of the steps theoretically inserted by the internal proc.
    Resault
    25-07-2002 11:10:20 ........ (date changed)
    25-07-2002 11:10:22 Loading data for order nr. 82364 (step 3)
    25-07-2002 11:10:22 Verifying order nr. 82364 (step 2)
    25-07-2002 11:10:22 Procedure started for order nr. 82364 (step 1)
    25-07-2002 11:10:22 Updating conditions for order nr. 82364 (step 4)
    25-07-2002 11:10:22 Procedure accomplished for order nr. 82364 (step 6)
    25-07-2002 11:10:22 Commit changes for order nr. 82364 (step 5)
    25-07-2002 11:10:24 ........ (date changed)
    Please ask for more detail if someone is interested in replying...I realize it's not a very clear explanation of my issue.
    Thanks, Marco

    Hi
    Add a field to the table that is that uses a sequence
    PREC_LOGS(log_id NUMBER(30),log_date DATE, log_message VARCHAR2(1000))
    Create a database sequence
    The insert statement now becomes something like
    INSERT INTO PREC_LOCS(log_id, log_date, log_message)
    VALUES (sequence_name.NEXTVAL, SYSDATE, 'Some message');
    Then order by the log_id when you do your select.
    Daniel

  • Questions about Using APIs to import Bills and Routings - AND COSTS

    Hi Forum - the following is a back-and-forth with a customer about use of APIs - Inventory developer suggested I post the question here. Note the 2nd question - and thanks for any assistance.
    SR# 7332152.994 ALCOA
    Instructions given to ct:
    Q1 - Can I load the bill header and components at the same time?
    You should be able to load the bill header and components at the same time. Customer loads bill and component data inserting enough "other" data for each so that the bill sequence id will be derived. For the component record, the assembly item, org and alternate_bom_designator values will be used by BMCOIN to derive the bill_sequence_id.
    Example:
    INSERT INTO BOM_BILL_OF_MTLS_INTERFACE
    ORGANIZATION_CODE,
    ITEM_NUMBER,
    ALTERNATE_BOM_DESIGNATOR,
    PROCESS_FLAG,
    TRANSACTION_TYPE
    VALUES
    'M1',
    '&PARENT_ITEM',
    NULL,
    '1',
    'CREATE'
    INSERT INTO BOM_INVENTORY_COMPS_INTERFACE b
    ORGANIZATION_CODE,
    ASSEMBLY_ITEM_NUMBER,
    ALTERNATE_BOM_DESIGNATOR,
    COMPONENT_ITEM_NUMBER,
    OPERATION_SEQ_NUM,
    COMPONENT_QUANTITY,
    EFFECTIVITY_DATE,
    PROCESS_FLAG,
    TRANSACTION_TYPE
    VALUES
    'M1',
    '&PARENT_ITEM',
    NULL,
    '&COMPONENT_ITEM',
    1,
    1,
    trunc(SYSDATE),
    1,
    'CREATE'
    Hi Aruna, some additional information that may be useful:
    We can load/create the bill header and components at the same time using the scripts given (as above)
    Required Data for Creating a Routing : assembly_item_id,
    organization_id, routing_type, transaction_type, process_flag
    And following scripts can be used to load routing header and operations equences.
    INSERT INTO BOM_OP_ROUTINGS_INTERFACE
    (assembly_item_id,
    organization_id,
    routing_type,
    transaction_type,
    process_flag)
    VALUES (2255800,207,1,'Create',1);
    INSERT INTO BOM_OP_SEQUENCES_INTERFACE
    (assembly_item_id,
    organization_id,
    operation_seq_num,
    Department_code,
    effectivity_date,
    transaction_type,
    process_flag,
    operation_description)
    VALUES
    (2255800,207,100,'ASSEMBLY',
    to_date('24-FEB-2009'),'Create',1,
    'Paint Wagon');
    Q2: One more question, can an expense item can be added to the bill and can contribute the cost.
    As there is a confusion of what I asked, below I am rephrasing my question
    By an Expense Inventory Item, I mean an item that is just tracked for quantity only i.e.,Checking the attributes - Inventory Item, Stockable, Transactable under Inventory Tab and not checking the attribute - 'Inventory Asset Value'.
    My question here is, For these Expense Inventory Items, What is the difference between having the 'Costing enabled' attribute turned ON as opposed to having it UNCHECKED
    *Q3 I have tried to load the items and I could only load 1st level of components but could not load second level of bom at the same time.
    While inserting I have inserted plan level too.
    Please let me know if I have to do anything different to load second level.*
    Thanks
    James

    You may want to look at using the more4apps bill of materials wizard, an excel based solution for uploading assemblies and their components.

  • Passing sysdate in milliseconds from OAF page to PL/Sql proc

    Hi All,
    I have a requirement wherein I need to pass SYSDATE in milliseconds from OAF page to the PL/SQL package.
    Basically I will be calling a PL/SQL api from AM . So here I need to pass SYSDATE in milliseconds as one of the PL/SQL proc parameters.
    How do you I go about this ?
    Any help is aprreciated.
    Thanks in Advance

    get the current database date by
    oracle.sql.date currentDate=OADBTransaction's method getCurrenctDBDate ()
    (OADBTransaction object can be obtained from AM Object itself).
    Now you may convert this currentDate to java date object.
    currentDateObjAsJavaDate=currentDate.toDate()
    now miliseconds (since1970, I remember so, please see documentation) =currentDateObjAsJavaDate.getTime();

  • How to get the current week from sysdate?

    Hi sir,
    i want to know how to get the current week from sysdate?
    thanks

    Hi Nicolas
    It seems you like to check my post and also make commend ;) thanks for your attention
    Have you ever read the posts above and given solutions ?Yes, I did
    Have you read the docs ? Yes, I checked
    What's the added value here ?Did youYou shared doc with solution(long one), I shared short one which point same solution(Check what Joel posted)..So what is benefit, As you can guess oracle docs are sometimes become so complicated as specialy for beginner...(At least it was like that for me and Belive me somedocs are still sooo complicated even for oracle coworkers ) But for you I dont know ;)
    => Why writting the PS in bold ?Why.. Let me think... Ohh Maybe I am looking some questions(many) and even user get answer they should not changed status so I am reading some posts and try to get problem and loosing time..
    So I am putting that PS wiht BOLD because I dont wanna lose time my friend ;) Because While I am trying to help ppl here In same time I am trying to giving support to my customer prod systems. Which mean time is very important for me...
    Hope my answer could satisfy you..
    One important PS for you.. You may not like my posts (or someone) but my friend I become tired to read&answer and make commend to on your comment which is about my posts.
    I am not newbie in forum(At least I fell like that) and I belive I know how I should make post..
    Thank you
    Regards
    Helios

  • Query about loops in an APEX calendar...

    Hi everyone,</br></br>
    I would like to know how to make a loop with the following settings:</br></br>
    1. I have a calendar on Application Express 3.0.1.00.08.</br>
    2. I do create some events on it, and got a start and end date.</br>
    3. On the calendar I can only see the event on the start date, but I need it to be seen from the start one until the end one...
    </br></br>
    So I went to PL/SQL and made the following tests:</br></br>
    1. created a loop example and tried to understand it:</br></br>
    DECLARE</br>
    a NUMBER := 0;</br>
    FS DATE := SYSDATE;</br>
    FF DATE := (SYSDATE+5);</br></br>
    BEGIN</br></br>
    WHILE ( FS < FF ) LOOP</br>
    a := a + 1;</br>
    FS := FS + 1;</br>
    dbms_output.put_line('paso ' || a); </br>
    END LOOP;</br></br>
    dbms_output.put_line('Dato a: ' || a);</br>
    dbms_output.put_line('Dato FS: ' || FS);</br>
    END;</br></br>
    I do get this as an answer:</br>
    paso 1</br>
    paso 2</br>
    paso 3</br>
    paso 4</br>
    paso 5</br>
    Dato a: 5</br>
    Dato FS: 17-MAY-08</br></br>
    Statement processed.</br></br>
    0.00 seconds</br></br>
    2. Once I had this I decided to modify what I had:</br></br>
    This is the block of code that needs to be repeated.</br></br>
    select '< a title= " TGB SCHEDUL " href = "f?p = &APP_ID.:3:' || :APP_SESSION || '::::P3_ID: ' || ID || ' " > ' || EVENT_NAME || '</a>
    ' EVENT_NAME,
    START_DATE</br>
    from     APP_TGB</br></br>
    So I placed it in the middel of the loop...</br></br>
    DECLARE</br>
    FS DATE := SYSDATE;</br>
    FF DATE := (SYSDATE+5);</br></br>
    BEGIN</br></br>
    WHILE ( FS < FF ) LOOP</br>
    select '< a title= " TGB SCHEDUL " href = "f?p = &APP_ID.:3:' || :APP_SESSION || '::::P3_ID: ' || ID || ' " > ' || EVENT_NAME || '</a>
    ' EVENT_NAME, START_DATE
    from     APP_TGB;</br>
    END LOOP;</br></br>
    END;</br></br>
    And got this message:</br>
    1 error has occurred</br>
    ·     Query cannot be parsed, please check the syntax of your query. (ORA-06550: line 8, column 3: PLS-00428: an INTO clause is expected in this SELECT statement) </br></br>
    Yes it was my mistake, I forgot the cursors in the selects… but here is where I do really need your help as I really don’t know how to implement them, and now with the variables that I have got.</br></br>
    I do really appreciate if anyone can help me out with it.</br></br>
    Best regards.</br></br>
    Jaison González</br></br>

    Hi Dimitri,<br><br>
    Once again, thank you very much for your time and answer,<br><br>
    1. Is it really necessary to do this for your whole table? There is no WHERE clause in your statement <br>
    Yes you are right I in the block of code that I sent you, I don’t have any WHERE clause but on the tests that I made, I have the following:<br><br>
    select START_DATE+level-1<br>
    from ( SELECT '<a title="TGB SCHEDUL" href="f?p=&APP_ID.:3:' ||
    :APP_SESSION || '::::P3_ID: ' || ID || '">' || EVENT_NAME||
    '</a>
    EVENT_NAME, START_DATE, END_DATE from APP_TGB WHERE ID = 141)<br>
    a connect by level <= (END_DATE - START_DATE)<br><br>
    But I as I have more that one event on the calendar, which are identified by different IDs, I remove it (the WHERE clause) thinking about the calendar’s convenience… <br><br>
    2. I guess you want in your outer select also the event_name?
    select start_date+level-1 as sdate, event_name, start_date, end_date
    from (select ... )<br>
    Yes, I will prove it and tell you how it works… sorry about it… <br><br>
    3. Not sure what you mean with that?<br>
    Right now, if I have as start date 5 and end date 10, it shows me on the first day (one) EVENT_NAME, on the second (four) EVENT_NAME, on the third (twelve) EVENT_NAME… and go on till it gets to the 10th…<br><br>
    Thank you very much for your help.<br><br>
    Best regards,<br><br>
    Jaison

  • Converting part of the string to a date and subtract with sysdate.

    HINT! In order solve this you must know how the pnr is assembled. Study this:
    650323-5510, we only need the first six characters. They inform us about when the person (car owner) was born. In this case it is 23 Mars 1965. You have to use several oracle built-in-functions to solve this. Hint! Begin by converting part of the string to a date and subtract with sysdate.
    select to_char(to_date(cast(pnr,'YYMMDDMM'))) from car_owner;
    please what am i doing wrong. i need the result to be something like this
    Hans, Rosenboll, 59,6 years.

    Hi.
    The main problem here is you have only last two digits of year. That could be the problem in a couple of years from now, when somebody born after 2k would get in to your database. For now if we ignore this problem the right solution would be :
    <code>
    SELECT months_between(trunc(SYSDATE),
    to_date('19' || substr('650323-5510',
    1,
    6),
    'YYYYMMDD')) / 12 years_old
    FROM dual
    </code>
    Suppose you are expecting the age of the car owner as a result above code will give you that. One again notice the '19' I appended.
    Best regards.

  • Ask about UTL_FILE in Stored Procedure

    Hi
    I was trying to do an insert in a table which then trigger a stored procedure to write the inserted data to a text file. However, I have some issues here in the Stored Procedure. Thanks for trying to help... [Insert -> Table -> Trigger -> Stored Procedure -> Text File]
    ----User will execute this sql
    ----insert into tester.test_table values ('ab');
    CREATE TABLE TESTER.TEST_TABLE
      LINECODE  VARCHAR2(2 BYTE)
    ----Just for testing purpose
    CREATE TABLE TESTER.TEST_REC_TABLE
      LINECODE  VARCHAR2(2 BYTE)
    CREATE OR REPLACE TRIGGER TESTER.TRIGGER_AUDIT
    AFTER INSERT OR UPDATE
    ON TESTER.TEST_TABLE REFERENCING OLD AS OLD NEW AS NEW
    FOR EACH ROW
    DECLARE
      sLineCode VARCHAR2(2);
    BEGIN
       sLineCode := '';
        IF UPDATING THEN     
          sLineCode := :NEW.LINECODE;
          TRIGGER_PACKAGE.WRITE_FILE(sLineCode);
        END IF;  
        IF INSERTING THEN
          sLineCode := :NEW.LineCode;
          TRIGGER_PACKAGE.WRITE_FILE(sLineCode);
        END IF;
    EXCEPTION
        WHEN others then null;
    END TRIGGER_AUDIT;
    CREATE OR REPLACE PACKAGE BODY TESTER.TRIGGER_PACKAGE
    is
       procedure WRITE_FILE(in_LineCode in varchar2)
       is
         sLineCode varchar2(2);  
         v_FileHandle UTL_FILE.FILE_TYPE;
    ----some checking of the input data for NULL 
       begin  
        if ((rtrim(in_LineCode) IS NULL) or (in_LineCode is null)) then
            sLineCode := 'XX';
        else
            sLineCode := in_LineCode;          -------->PROBLEM HERE?
        end if;
        if (length(sLineCode) > 2) then
          sLineCode := substr(sLineCode,1,2);
        end if;
        Insert into TEST_REC_TABLE (LineCode) values (sLineCode); ----insert data to another table for testing
        EXECUTE IMMEDIATE 'CREATE OR REPLACE DIRECTORY FILEDIR AS ' || '''' || 'c:\' || '''';
        v_FileHandle := UTL_FILE.FOPEN('FILEDIR','Test_Table.txt','w'); ----write to text file in C:\Test_Table.txt
        UTL_FILE.PUT_LINE(v_FileHandle, 'Inserted ' || sLineCode || ' @ ' || TO_CHAR(SYSDATE,'DD-MM-YYYY HH:MI:SS AM'));
        UTL_FILE.FCLOSE(v_FileHandle);           
       exception
          when others then null;
       end;
    end TRIGGER_PACKAGE;
    1) The problem I faced is that when I perform INSERT sql for the new data, it can be successfully be inserted into both tables TEST_REC_TABLE and TEST_TABLE, but it just does not write to the text file.
    2) However, when I just execute the procedure I will get XX for the input data as it is NULL. This XX data will then be seen in TEST_REC_TABLE as "XX" record and Test_Table.txt as "Inserted XX @ 10-01-2014 04:56:06 PM". UTL_FILE did write to textfile so my guess is that it could be due to my poor understanding of logic in the checking of the input data for NULL. Tried but I am still clueless, thanks for pointing out the issue.

    > 1) I'm just testing and learning here with trigger insert...
    Good. In that case its just a wrong choice that you have decided to write to a file from trigger. Oracle base is a good site. They have examples too. Please check that ORACLE-BASE - Database Triggers Overview.
    > 2) How should I do then?
    Just create the object one time
    CREATE OR REPLACE DIRECTORY FILEDIR AS <path>
    The path should be a location in your server where oracle is installed.
    > 3) How should I do then? Use this ?
    EXCEPTION
          WHEN OTHERS THEN
               DBMS_OUTPUT.PUT_LINE
                    ('ERROR ' || TO_CHAR(SQLCODE) || SQLERRM);
               NULL;
    Don't do any thing. Just remove the exception handling. Don't handle unknown exceptions. If at all you want to handle them for logging purpose RAISE it at the end like this.
    exception
      when others then
        <log your messages>
        raise;
    And about exception handling one of the forum member BluShadow has written a nice article PL/SQL 101 : Exception Handling. That would be a nice read.

  • User Name, Date of Birth field / sysdate

    hi! I am writing a procedure/dynamic page to check the logged in person's birthday but has encounterd some problems:
    1. draw these data from the wwsec_person$ table? if i just use
    Select User Name, Date of Birth from portal30.wwsec_person$, it gives me some error, i tried put [] brackets but still the same.
    2. how do i format the sysdate and Date of Birth to to month, day?
    3. how do I run a procedure automatically when someone has logged into the portal?
    thx.

    1) Please provide the full error message, and snippit of code surrounding the error.
    2) TO_CHAR ( SYSDATE, 'Mon, DD' ) -- Read about TO_CHAR
    3) Read about SYSTEM TRIGGERs
    http://technet.oracle.com/docs/products/oracle9i/doc_library/901_doc/appdev.901/a88876/adg13trg.htm#431
    CREATE OR REPLACE TRIGGER someTriggerName
    AFTER LOGIN ON ([someSchemaName.]SCHEMA or DATABASE)
    DECLARE
    BEGIN
        -- Run procedure here User name is in SYSTEM
        --  variable LOGIN_USER.
    END;Good Luck,
    Eric Kamradt

  • Question about sql statement

    Hi expert,
    I have following sql statement, function 'hiroc_get_delta_amount1' and 'hiroc_get_delta_amount2' are separately used in select and where subclause. these two function are exactly same, except that there is a inserting log statement inside. for function 'hiroc_get_delta_amount1' , logs are supposed to write into log table1, whereas for function 'hiroc_get_delta_amount2' , logs are supposed to write into log table2. after running this sql, I got data loaded into log table2, however, there is no data loaded into log table1.
    could you please tell me why there is no data in log table2 for function
    1. sql statement;
    select
    pp.policy_premium_pk,
    pp.policy_fk,
    pp.policy_term_fk,
    pp.risk_fk,
    pp.coverage_fk,
    pp.transaction_log_fk,
    pp.coverage_component_code,
    hiroc_rpt_user.hiroc_get_delta_amount1(pp.policy_fk, pp.policy_term_fk, pp.risk_fk, pp.coverage_fk, pp.transaction_log_fk, pp.coverage_component_code),
    pp.rate_period_from_date
    from PRODBKUPDW_MART.rmv_policy_premium pp
    where pp.rate_period_type_code = 'TERM_COVG'
    and pp.coverage_component_code 'NETPREM'
    and hiroc_rpt_user.hiroc_get_delta_amount2(pp.policy_fk, pp.policy_term_fk, pp.risk_fk, pp.coverage_fk, pp.transaction_log_fk, pp.coverage_component_code) != 0
    group by pp.policy_premium_pk,
    pp.policy_premium_pk,
    pp.policy_fk,
    pp.policy_term_fk,
    pp.risk_fk,
    pp.coverage_fk,
    pp.transaction_log_fk,
    pp.coverage_component_code,
    pp.rate_period_from_date;
    2. log inserting statement used for both functions:
    (1) function 'hiroc_get_delta_amount1'
    insert into HIROC_RPT_USER.LOG_TEST1 values (v_start, sysdate,
    p_policy_fk,p_policy_term_history_fk,p_risk_fk,p_coverage_fk,p_transaction_log_fk,p_comp_code);
    COMMIT;
    (2) function 'HIROC_GET_DELTA_AMOUNT_1'
    insert into HIROC_RPT_USER.LOG_ZB_TEST_1 values (v_start, sysdate,
    p_policy_fk,p_policy_term_history_fk,p_risk_fk,p_coverage_fk,p_transaction_log_fk,p_comp_code);
    COMMIT;

    Are your functions using autonomous transactions?
    We also need more information about the log tables etc. as we cannot tell what the problem would be from just that query, and no data.

  • Query about Data Model Design, UPDATED_ON

    hi on a *.ppt called ODTUG2007_Advanced_APEX.ppt, that i found on google <www.oracle.com/technology/products/database/application_express/ppt/ODTUG2007_Advanced_APEX.ppt>, i found a something that might be very interesting in using in my APEX app... it said something about some Standard Columns, and "phrases" (created_by, created_on, updated_by, updated_on) that i would like to see and learn how to implement.
    So i do appreciate if anyone has got an example, or can explain them to me...
    Best regards.
    Jaison González

    Jaison,
    There's another way to do that might work for you:
    1. Create the fields updated_by and updated_on in the table;
    2. Create in the page the items PX_UPDATED_BY and PX_UPDATED_ON of type "Text field (saves state)";
    3. Go to the properties of the item.
    PX_UPDATED_BY
    Source:
    - Source Type: Database column;
    - Source Value or expression: updated_by
    - Post Calculation Computation: :APP_USER
    Default:
    - Default value: &APP_USER.
    PX_UPDATED_ON
    Source:
    - Source Type: Database column;
    - Source Value or expression: updated_on
    Default:
    - Default value: sysdate
    - Default value type: PL/SQL Expression
    When the user submits the changes, the table fields are updated.
    Regards,
    Ricardo Stumpf
    Brasília - Brazil
    Message was edited by:
    Stumpf

  • Select sysdate from dual (to custom format).

    Dear all,
    i like to SELECT SYSDATE FROM DUAL, and run this result in a query something like:
    SELECT X, Y, Z FROM TABLENAME WHERE ACCESSDATE = (SELECT SYSDATE FROM DUAL);
    The problem is that the value of ACCESSDATE is in an format like DD-MM-YYYY and that sysdate form dual is
    DD-MON-YYYY.
    How do i get sysdate into the format DD-MM-YYYY?
    Thanks already,
    Johan.

    Perhaps usefull for performance:
    first of all: no subselect is not needed. sysdate can be used as an argument directly (all functions are).
    secondly, if accessdate is of type 'date' and the table has a lot of rows, converting it to a char will bypass the index usage. Instead, if you are worrying about the time try this (the display format is of no concern here if the datatype is date):
    SELECT X, Y, Z FROM TABLENAME WHERE ACCESSDATE >trunc(sysdate) and ACCESSDATE < trunc(sysdate+1);
    if accessdate is of type 'varchar2' then this should be enough (and should remain using the indexes on accessdate):
    SELECT X, Y, Z FROM TABLENAME WHERE ACCESSDATE = to_date(sysdate,DD-MM-YYYY);
    Hope this helps,
    L.

Maybe you are looking for