How to select date while Updating record

I Have created Validation through user api hook on Performance Management Module.but when user enter objective ,if is greater then or less then hundred then system raise error as per policy,but when user enter another objective to meet 100 percent then system raise error "hr object lock " because i am using select statement to sum of that object ,any body idea how to select date while inserting or updating any record.
Thansks.

Hi,
drag and drop a af:convertDateTime on top of the select inputDate component
<h:form>
<af:selectInputDate label="Label 1">
<af:convertDateTime pattern="yyyy-MM-dd hh:mm"/>
</af:selectInputDate>
</h:form>
This adds the current time to the selected dat. In JDeveloper 11 you will be able to explicitly change the time in the calendar
Frank

Similar Messages

  • How to insert date into updated record (MySql, PHP)

    I want to be able to update an existing record and automatically include the date the change was made when I submit the data back to the MySql database.
    I saw this thread on how to insert the date on a new record using NOW()
    http://forums.adobe.com/thread/855152?decorator=print&displayFullThread=true#855152
    After reading it I successfully amended my insert.php page.
    Here's the code from my insert.php page which works nicely:
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
      $insertSQL = sprintf("INSERT INTO standardsclient_tbl (client_name, pantone_ref1, pantone_ref1_image, font_ref1, font_ref1_image, `date`) VALUES (%s, %s, %s, %s, %s, NOW())",
                           GetSQLValueString($_POST['client_name'], "text"),
                           GetSQLValueString($_POST['pantone_ref1'], "text"),
                           GetSQLValueString($_POST['pantone_ref1_image'], "text"),
                           GetSQLValueString($_POST['font_ref1'], "text"),
                           GetSQLValueString($_POST['font_ref1_image'], "text"),
                           GetSQLValueString($_POST['date'], "date"));
    This is the update.php page, I changed `date`=%s to `date`=NOW() but all this did was stop me from updating the record at all.
    if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
      $updateSQL = sprintf("UPDATE standardsclient_tbl SET client_name=%s, pantone_ref1=%s, pantone_ref1_image=%s, font_ref1=%s, font_ref1_image=%s, `date`=NOW() WHERE client_ID=%s",
                           GetSQLValueString($_POST['client_name'], "text"),
                           GetSQLValueString($_POST['pantone_ref1'], "text"),
                           GetSQLValueString($_POST['pantone_ref1_image'], "text"),
                           GetSQLValueString($_POST['font_ref1'], "text"),
                           GetSQLValueString($_POST['font_ref1_image'], "text"),
                           GetSQLValueString($_POST['date'], "date"),
                           GetSQLValueString($_POST['client_ID'], "int"));
    Can anyone see where I've gone wrong?
    Thanks

    In update query you have 6 %s but 7 GetSQLValueString. That's your problem.

  • How to select data from structure

    how to select data from structure

    Hi Laxman,
    Structure holds single record of data. You can acess data by using the syntax <b>Structure-field</b>
    Please see sample.
    data: wa_mara  type mara.
    select *
              from  mara
              into wa_mara
              up to 1 rows.
    endselect.
    write:/ wa_mara-mandt,
             wa_mara-matnr,
             wa_mara-maktl.
    if helps plz reward points.
    Regards
    Bhupal Reddy

  • How to select data from a table using a date field in the where condition?

    How to select data from a table using a date field in the where condition?
    For eg:
    data itab like equk occurs 0 with header line.
    select * from equk into table itab where werks = 'C001'
                                                      and bdatu = '31129999'.
    thanks.

    Hi Ramesh,
    Specify the date format as YYYYMMDD in where condition.
    Dates are internally stored in SAP as YYYYMMDD only.
    Change your date format in WHERE condition as follows.
    data itab like equk occurs 0 with header line.
    select * from equk into table itab where werks = 'C001'
    and bdatu = <b>'99991231'.</b>
    I doubt check your data base table EQUK on this date for the existince of data.
    Otherwise, just change the conidition on BDATU like below to see all entries prior to this date.
    data itab like equk occurs 0 with header line.
    select * from equk into table itab where werks = 'C001'
    and <b> bdatu <= '99991231'.</b>
    Thanks,
    Vinay
    Thanks,
    Vinay

  • How to select data from a table by passing document number from another tab

    How to select data from a table by passing document number from another table.
    for eg:-
    I want to display name, adres, region from ADRC table
    by using field delivery document number
    Kind Regards,
    Shanbagavalli.S

    Hi Shanbagavalli,
    There are multiple solutions to this questions a few i will try to answer and then you can take the best required for your requirements.
    **Consider that you have a Internal table having document number from other table..
    SELECT NAME ADRES REGION FROM ADRC
           INTO IT_ADRC
           FOR ALL ENTRIES IN IT_DOC
           WHERE DOCUMENT_NO = IT_DOC-DOCUMENT_NO.
    **Consider that you have 1 document number then
    SELECT NAME ADRES REGION FROM ADRC
         INTO IT_ADRC
         WHERE DOCUMENT_NO = W_DOCUMENT_NO.
    Hope this solves your problem.
    Regards,
    Kunjal

  • How to select data from cluster table

    hi experts,
                   I have a report which picks data from bseg (cluster table ) for a month report it is taking around 4 minutes to process.I feel it is not good when take the report after some months.
    how to select data from these table???how to declare itab for these cluster tables????can we include any search condition or any other kind of internal table???
    please advice.
    mani

    Hi Manikandan,
    The following code may be helpful to understand how to select the data from cluster table.
    Types: Begin of ty_kna1,
    Kunnr type kna1-kunnr,
    adrnr type kna1-adrnr,
    end of ty_kna1,
    begin of ty_bseg,
    belnr type bseg-belnr,
    kunnr type bseg-kunnr,
    end of ty_bseg,
    begin of ty_final,
    belnr type bseg-belnr,
    kunnr type kna1-kunnr,
    adrnr type kna1-adrnr,
    end of ty_final.
    Data: it_kna1 type table of ty_kna1,
    wa_kna1 type ty_kna1,
    it_bseg type table of ty_bseg,
    wa_bseg type ty_bseg,
    it_final type table of ty_final,
    wa_final type ty_final.
    Select kunnr adrnr from kna1 into table it_kna1 where....
    if sy-subrc = 0.
    select belnr kunnr into table it_bseg for all entries in it_kna1 where kunnr = it_kna1-kunnr.
    endif.
    sort it_kna1 by kunnr.
    Loop at it_bseg into wa_bseg.
    move wa_bseg-belnr to wa_final-belnr.
    read table it_kna1 into wa_kna1 with kunnr = wa_bseg-kunnr binary search.
    if sy-subrc = 0.
    move: wa_kna1-kunnr to wa_final-kunnr,
    wa_kna1-belnr to wa_final-belnr.
    endif.
    append wa_final to it_final.
    clear wa_final.
    endloop.
    Loop at it_final into wa_final.
    write: / wa_final-belnr, wa_final-kunnr, wa_final-adrnr.
    endloop.
    Reward if useful.
    Thankyou,
    Regards.

  • How to select data from Maintance View in Program

    Dear All ,
    How to select data from Maintance View V_T052 in abap Program.
    Regards,
    Archana

    TABLES: t179, t179t.
    DATA: v_t179_int TYPE TABLE OF v_t179.
    SELECT * FROM t179
      JOIN t179t ON
        t179prodh = t179tprodh
      INTO CORRESPONDING FIELDS OF TABLE v_t179_int.
    Reward points...

  • Stale data error while updating record

    Hi,
    While updating page getting below error.
    ++++++++++++++++++
    Error
    Unable to perform transaction on the record.
    Cause: The record contains stale data. The record has been modified by another user.
    Action: Cancel the transaction and re-query the record to get the new data.
    ++++++++++++++++++
    - In page navigation, the setForwardURL is done without retaining the AM
    - There is no other user trying to change the values that are just created.
    - Doing pageContext.releaseRootApplicationModule(); before commit.
    - ObjectVersionNumber attribute of entity object, check the Change Indicator checkbox for this attribute.
    Still it is NOT working getting same error.
    Any idea, why this error coming.
    Thanks,
    Srikanth

    OA Framework updates the ObjectVersionNumber attribute in the generic OAEntityImpl Java class. That is, the createObjectVersionNumber(), and updateObjectVersionNumber() methods perform automatic initialization and update of these values.
    Read more in Dev Guide
    Thanks
    --Anil                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Stale data error while updating record on extending standard OAF pages

    We are on Oracle R12. I have a standard oracle shipped page to enter attributes of an inventory item. This page has an APPLY and CANCEL buttons to post the changes to DB. There is one attribute called FORMULA. To create a formula , I created a new custom page.
    I added a custom controller and AM to the standard page and added a new button, "Create Formula" . When the user clicks this button, he can navigate to the new custom page and create a formula. When the user clicks APPLY on this new page, I am navigating him back to the original page , looping through the Entity Object of that page and setting the formula attribute using method
    EO.SetATTRIBUTE.
    This works fine the first time. Then I click the apply button on the original page, the change is saved on teh DB. Now if I click the formula button again and try to modify the formula, on returning to the original page, the formula is updated but I also get the following error :
    Unable to perform transaction on the record.
    Cause: The record contains stale data. The record has been modified by another user.
    Action: Cancel the transaction and re-query the record to get the new data.
    I tried getTransaction().setClearCacheOnCommit(true); after the setattribute but I still get this error . Not sure why this is happening, what I need to do.
    Please help . I did not modify any oracle shipped VOs or EOs.
    thanks
    Satya

    you can also release transaction by using
    pageContext.releaseRootApplicationModule();
    --Prasanna                                                                                                                                                                                                       

  • How to select data in excel

    Hi,
    I am writing a program which selects data from MS Excel, below is the excel sheet colums
    A     B     C
    x     y     z
    When I run the below program i get an error for the line :
    ResultSet rs = stmt.executeQuery("select B from [Sheet1$] where A=x");
    Connection Failedjava.sql.SQLException: [Microsoft][ODBC Excel Driver] Too few parameters. Expected 1.
    Can you please advice how to fix this code ?
    package app;
    import java.sql.*;
    public class TestExcel {
    public TestExcel() {
    public static void main(String[] args) {
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:Excel Files;DBQ=C:\\excel\\expenses1.xls; READONLY=0;", "", "");
    Statement stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery("select B from [Sheet1$] where A=x");
    while (rs.next()){
    String a = rs.getString(1);
    System.out.println(a);
    catch (Exception e) {
    System.out.println("Connection Failed" + e);
    Thx

    That error is the driver's way of saying that you have used table names that don't exist in the database, or column names that don't exist in the table. There's only one such erroneous name in the query.

  • MySQL error while Updating Record

    Hi
    I'm newbie so your help will be welcomed.
    While I'm trying to Update Record, the following error
    occurs:
    " You have an error in your SQL syntax; check the manual that
    corresponds to your MySQL server version for the right syntax to
    use near '' at line 1".
    This is the code that gives me headache:
    "<?php
    require_once('../../../../Inetpub/wwwroot/theHotel/Connections/connHTL.php');
    ?>
    <?php
    $colname_rsBooking = "-1";
    if (isset($_GET['ID'])) {
    $colname_rsBooking = (get_magic_quotes_gpc()) ? $_GET['ID']
    : addslashes($_GET['ID']);
    mysql_select_db($database_connHTL, $connHTL);
    $query_rsBooking = sprintf("SELECT * FROM bookings WHERE ID =
    %s", $colname_rsBooking);
    $rsBooking = mysql_query($query_rsBooking, $connHTL) or
    die('HERE IS THE ERROR, I GUESS' . mysql_error());
    $row_rsBooking = mysql_fetch_assoc($rsBooking);
    $totalRows_rsBooking = mysql_num_rows($rsBooking);
    $colname_rsClient = "-1";
    if (isset($_GET['clientID'])) {
    $colname_rsClient = (get_magic_quotes_gpc()) ?
    $_GET['clientID'] : addslashes($_GET['clientID']);
    mysql_select_db($database_connHTL, $connHTL);
    $query_rsClient = sprintf("SELECT * FROM clients WHERE ID =
    %s", $colname_rsClient);
    $rsClient = mysql_query($query_rsClient, $connHTL) or die('NE
    MOZAM' . mysql_error());
    $row_rsClient = mysql_fetch_assoc($rsClient);
    $totalRows_rsClient = mysql_num_rows($rsClient);
    ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN" "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    etc......"
    I want to know if this is a syntax , MySQL or PHP error. I've
    tried things, but no results.
    PLS HELP!
    Thanks in advance!

    dedurus wrote:
    > " You have an error in your SQL syntax; check the manual
    that corresponds to
    > your MySQL server version for the right syntax to use
    near '' at line 1".
    The error message is clear in one respect - it's an error of
    MySQL
    syntax. What it doesn't tell you is what the error is. The
    way to find
    out is to use echo to display the SQL query onscreen. I
    suspect that
    what's happening is that either ID or clientID haven't been
    defined.
    > $query_rsBooking = sprintf("SELECT * FROM bookings WHERE
    ID = %s",
    > $colname_rsBooking);
    Display the value of the SQL query here
    echo $query_rsBooking.'<br />';
    > $rsBooking = mysql_query($query_rsBooking, $connHTL) or
    die('HERE IS THE
    > ERROR, I GUESS' . mysql_error());
    > $row_rsBooking = mysql_fetch_assoc($rsBooking);
    > $totalRows_rsBooking = mysql_num_rows($rsBooking);
    >
    > $colname_rsClient = "-1";
    > if (isset($_GET['clientID'])) {
    > $colname_rsClient = (get_magic_quotes_gpc()) ?
    $_GET['clientID'] :
    > addslashes($_GET['clientID']);
    > }
    > mysql_select_db($database_connHTL, $connHTL);
    > $query_rsClient = sprintf("SELECT * FROM clients WHERE
    ID = %s",
    > $colname_rsClient);
    And again, here:
    echo $query_rsClient;
    > $rsClient = mysql_query($query_rsClient, $connHTL) or
    die('NE MOZAM' .
    > mysql_error());
    Once you know what the SQL queries look like, you can begin
    troubleshooting.
    David Powers
    Adobe Community Expert
    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    http://foundationphp.com/

  • How to select data from an internal table

    material                          norm                    date last modified
    B2-SP HEAT                 50.000               20090420
    BF COKE                                 575.000               20090419
    GROSS COKE                 200.000               20090419
    B2-SP HEAT                 100.000               20090419
    TWT                                 33.000               20090330
    B7-SP HEAT                 2.000               20090310
    B1-SP HEAT                 1.000               20090309
    B7-SP HEAT                 615.000               20090308
    B2-SP HEAT                 585.000               20090308
    B1-SP HEAT                 100.000               20090308
    B3-SP HEAT                 610.000               20090308
    BF COKE                                 68.500               20090308
    GROSS COKE                 72.600               20090308
    B8-SP HEAT                 600.000               20090308
    B9-SP HEAT                 625.000               20090308
    BX-SP HEAT                 615.000               20090308
    B9-SP HEAT                 58.000               20090307
    B1-SP HEAT                 100.000               20090307
    B6-SP HEAT                 350.000               20090306
    B2-SP HEAT                 888.000               20090306
    Like above there r numerous data in a table :
    how will i select data into another internal table where material above is not repeated with latest modified date.please help.

    Hi Sonu,
    The main task is to move the contents of the one internal table to another with some condition.
    First sort and delete the duplicate entries from the First Internal table like below : 
    sort it_tab by material ascending date_modified descending.
    delete adjacent duplicates from it_tab.
    Then move that Internal table contents to another internal table.
    Define another internal table with the same structure as you have first internal table and then
    Second Step :
    it_itab1 = it_itab.
    If you are using seperate Header line and Body then you can do like below :
           it_itab1[] = it_itab[].
    This will fix the issue.
    Please let me know if you need any further explonation.
    Regards,
    Kittu
    Edited by: Kittu on Apr 24, 2009 12:21 PM

  • How to Select data using same column name from 3 remote database

    Hi,
    Can anyone help me on how to get data with same column names from 3 remote database and a single alias.
    Ex.
    SELECT *
    a.name, b.status, SUM(b.qty) qantity, MAX(b.date) date_as_of
    FROM
    *((table1@remotedatabase1, table1@remotedatabase2, table1@remotedatabase3)a,*
    *(table1@remotedatabase1, table1@remotedatabase2, table1@remotedatabase3)b)*
    WHERE b.dept = 'finance'
    AND a.position = 'admin'
    AND a.latest = 'Y' AND (b.status <> 'TRM') AND b.qty > 0;
    GROUP BY a.name, b.status ;
    NOTE: the bold statements is just an example of what I want to do but I always gets an error beacause of ambiguous columns.
    Thanks in advnce. :)
    Edited by: user12994685 on Jan 4, 2011 9:42 PM

    user12994685 wrote:
    Can anyone help me on how to get data with same column names from 3 remote database and a single alias.Invalid. This does not make sense and breaks all scope resolution rules. And whether this is in a single database, or uses tables across databases, is irrelevant.
    Each object must be uniquely identified. So you cannot do this:
    select * from (table1@remotedatabase1, table1@remotedatabase2, table1@remotedatabase3) a3 objects cannot share the same alias. Example:
    SQL> select * from (dual, dual) d;
    select * from (dual, dual) d
    ERROR at line 1:
    ORA-00907: missing right parenthesisYou need to combine the objects - using a join or union or similar. So it will need to be done as follows:
    SQL> select * from (select * from dual d1, dual d2) d;
    select * from (select * from dual d1, dual d2) d
    ERROR at line 1:
    ORA-00918: column ambiguously definedHowever, we need to have unique column names in a SQL projection - so the join of the tables need to project a unique set of columns. Thus:
    SQL> select * from (select d1.dummy as dummy1, d2.dummy as dummy2 from dual d1, dual d2) d;
    DUM DUM
    X   X
    SQL> I suggest that you look closely at what scope is and how it applies in the SQL language - and ignore whether the objects referenced are local or remote as it has no impact to fundamentals of scope resolution.

  • How to select data before a date

    in previous I need to select data from invoice between date 01-10-2007 and 01-11-2007
    it is work fine.
    select sum(invoice_total) total from invoice
    where com_id = 356
    and invoice_date between TO_DATE('01-10-2007','DD-MM-YYYY') and ADD_MONTHS(TO_DATE('01-10-2007','DD-MM-YYYY'), 1)
    NOW, I need to select from data invoice before 01-10-2007.
    How is the statement?
    Thanks

    please refer to the < operator.
    Sybrand Bakker
    Senior Oracle DBA

  • How to select data from one nested table and into another nested table

    create or replace
    TYPE ctxt_code_rec as object
    ctxt_header varchar2(10),
    header_description varchar2(300),
    status varchar2(30),
    adjacent_code varchar2(300),
    adjacent_desc Varchar2(400),
    adjacent_flag varchar2(4000),
    adjacent_text_href varchar2(4000)
    create or replace
    type ctxt_code_table as table of CTXT_CODE_REC
    d_table ctxt_code_table ;
    v_tab ctxt_code_table ;
    Iam trying to select data from d_table to v_tab
    using and bulk collect into
    select m.*
    bulk collect into p_code_result
    from table(l_loop_diag_code_table1)m
    order by 1;
    Receiving error:
    ora 94007 : not enoughvalues
    Could you please let me know how to solve it?
    Thanks,
    in advance

    >
    create or replace
    TYPE ctxt_code_rec as object
    ctxt_header varchar2(10),
    header_description varchar2(300),
    status varchar2(30),
    adjacent_code varchar2(300),
    adjacent_desc Varchar2(400),
    adjacent_flag varchar2(4000),
    adjacent_text_href varchar2(4000)
    create or replace
    type ctxt_code_table as table of CTXT_CODE_REC
    d_table ctxt_code_table ;
    v_tab ctxt_code_table ;
    Iam trying to select data from d_table to v_tab
    using and bulk collect into
    select m.*
    bulk collect into p_code_result
    from table(l_loop_diag_code_table1)m
    order by 1;
    Receiving error:
    ora 94007 : not enoughvalues
    Could you please let me know how to solve it?
    >
    Not unless you provide the code you are actually using.
    There is no definition of 'p_code_result' in your post and you say you 'trying to select data from d_table' but there is no code that loads 'd_table' in what you posted.
    And the SELECT query you posted actuall selects from an object named 'l_loop_idag_code_table1' which isn't mentioned in your code.
    Post the actual code you are using and all of the structures being used.
    Also explain why you even need to use nested tables and PL/SQL for whatever it is you are really doing.

Maybe you are looking for

  • Hp Laserjet 1012 printing via Bonjour on 10.4.6

    I recently upgraded my OS from 10.3.9 to 10.4.6 and I couldn't find and install drivers for my hp LaserJet 1012 when connected through Airport Express. Printer is visible as a Bonjour printer. USB printing works just fine, so I assume the drivers are

  • Skype keeps giving me the same error over and over...

    Good day everyone! So I ran into this problem like a few months ago, and it is giving me the worse headache ever... See... Everytime I log into Skype, it works fine for the first few times. After a couple of times that my skype has been restarted (Wh

  • Mini stuck in Disk Mode

    I'm having a problem in which my mini is stuck in disk mode after I eject it from itunes, or off the desktop. I've tried resetting it, but nothing happens all I see is disk mode with the large check symbol followed by the ok to disconnect message. I

  • When will Photoshop Elements 11 be released?

    My 30 day trial of PSE10 runs out in 2 days. I am very happy with it and intend to purchase. When does PSE11 come out? Is it better for me to wait? Regards, Russell Message title was edited by: Brett N

  • Translation Pattern Usage Report

    I am trying to determine if a translation pattern is still needed.  Is there a report that can be run?  Call Manager Release 6.1.  Thank you.