Cf inserts wrong date!

Hi!
I want the registered users of my site to send each other
messages.
I have a database with 2 tables for the messages: the first
is for new messages, the second is for saved messages. When a user
logs on & goes to their message inbox the page lists 2
catergories from the 2 respective tables.
After reading a new message, the user has the option to save
the message (at which point the site has been programmed to follow
this procedure:
1) get the field entries for this message from the new
message table
2)input the exact same data into the same fields within the
saved message table
3)delete the entry from the new message box
Everything works fine bar one thing:
When a user sends a new message the table is given todays
date (unformatted) to input into a field. This enters correctly. On
the message inbox page it lists the date correctly. On the full
message page it also lists the date correctly. After clicking
"save" and the data is transfered to the saved message table, the
date is inputted with the year being 1899!!
I cannot figure out why this is happening. The strange thing
is that my code for inputting the new message date of today using
"now()" there is no problem. when i try to save the message my code
wont allow to input the date as an exact copy. I've tried
formatting the date at each entry point and on both entry points,
but the date remains 1899 on the saved message table.
Both the table fields for the date are set as date format.
Any idea's on why this is happening?
Thanks!

peewee_larkin wrote:
>
> When a user sends a new message the table is given
todays date (unformatted)
> to input into a field. This enters correctly. On the
message inbox page it
> lists the date correctly. On the full message page it
also lists the date
> correctly. After clicking "save" and the data is
transfered to the saved
> message table, the date is inputted with the year being
1899!!
You are probably missing quotes or whatever your database
uses to
distinguish a date from a number. Use cfqueryparam to solve
this.
Jochem
Jochem van Dieten
Adobe Community Expert for ColdFusion

Similar Messages

  • Wrong date value is inserting

    Hi All!
    When I call the procedure insertDate that inserting the date it inserts wrong value, sometimes the date is more than a year off, otherwise the value of new Timestamp(date.getTime()) is giving the right date at the moment of setting the parameter.
    Why is it happening and how to fix that?
    Here is the source:
    private static Date formatDate(int year, int mon, int mday, int hour, int min, int sec) {
    Date date = null;
    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    String textDate = (1900 + year) + "-" + mon + "-" + mday + " " + hour + ":" + min + ":" + sec;
    System.out.println(textDate);
    try {
    date = format.parse(textDate);
    System.out.println(date.toString());
    } catch (ParseException ex) {
    Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
    return date;
    Date date = formatDate(111, 6, 29, 12, 59, 45);
    CallableStatement cs = connection.prepareCall("{ call insertDate(?)}");
    cs.the pasetTimestamp(1, new Timestamp(date.getTime()));
    Thank you!
    Regards,
    Astrid

    I'm using MySQL.
    If I store Timestamp mostly I got '0000-00-00 00:00:00' and sometimes something like '2013-11-08 15:09:46'.
    I've made changes in order to insert not Timestamp directly, but string. And it works properly by inserting exact date and time - '2011-07-01 08:29:33'.
    My procedure now looks like
    CREATE PROCEDURE `saveQueryResult`(date1 VARCHAR(50))
    BEGIN
         DECLARE d DATETIME;
         SET d = TIMESTAMP(date1);
         INSERT INTO values_ (submit_date)
         VALUES (d);
    END$$
    DELIMITER ;

  • Can not insert/update data from table which is created from view

    Hi all
    I'm using Oracle database 11g
    I've created table from view as the following command:
    Create table table_new as select * from View_Old
    I can insert/update data into table_new by command line.
    But I can not Insert/update data of table_new by SI Oject Browser tool or Oracle SQL Developer tool .(read only)
    Anybody tell me, what's happend? cause?
    Thankyou
    thiensu
    Edited by: user8248216 on May 5, 2011 8:54 PM
    Edited by: user8248216 on May 5, 2011 8:55 PM

    I can insert/update data into table_new by command line.
    But I can not Insert/update data of table_new by SI Oject Browser tool or Oracle SQL Developer tool .(read only)so what is wrong with the GUI tools & why posting to DATABASE forum when that works OK?

  • Report returns wrong data when run on server

    Hi,
    I'm runing CRS XI R2 on Windows Server 2003 SP2.  When I refresh a report in the Crystal Reports XI Designer, I'm getting correct data.  But when I schedule the report to run on the server it returns wrong data.  The data is different from what I see when I refresh it from the designer.  In the report I have running totals set up to count customers that meet a certain criteria.  The report is very large.  It take almost 2 hours to refresh.
    I was wondering what is causing the difference in running total data between refreshing it on the designer and running it on the server.  Is it returning wrong data b/c of it not reading all the records?  Should I be making any changes to the server settings?  I saw that under pageserver, there are options for  setting the 'Minutes Before an Idle Report Job is Closed' and 'Database Records To Read When Previewing Or Refreshing a Report".  Do either of those have anything to do with the report returning incorrect data when being scheduled to run on the server?
    Thanks,
    Kim

    Hi Xuandao,
    You would need to Use Cell Binding and Trigger concept to accomplish this.
    Its simple, however, you would have to work on a trial and error basis to understand this concept as implementing the same is subject to your dashboard and WEBI Design.
    Open you LiveOffice.
    Insert your WEBI, Now, go to Object Properties of your WEBI, select the second tab that says Prompt, Here, it lists the prompts that you have for your WEBI. This would also enlist your BEx variables as well. Select this BEx variable and click on the button that says Prompt at the bottom of this window. Here, select choose Excel Data Range and click on the cell select button on the right (small button that lets you choose what cell you want to bind this prompt to), Now select a free cell that would not be even populated later on when you run the dashboard say A1 (remember the value that you select). Click on OK and again OK. The WEBI Refreshes and you can see all the prompt values at the cell A1. These are all the possible values stored for your BEx prompt variables (these values are fetched from BW system dynamically).
    Now, save this LiveOffice, Go to you dashboard. Connect your dashboard to your Live office. Go to Data-> connections-> Now, select the WEBI and in the right hand pane  go to Usage tab, here, Click on Trigger cell button on the right hand side and select A1 in you LiveOffice.
    It should work fine.
    Let me know.
    Rgds,
    Sreekul Nair

  • Please help! Looking for script to insert current date on page.

    I currently use a Dreamweaver Extension that lets you insert
    current date and time on your web page.
    The problem is, I don't know Javascript and cannot edit the
    Javascript codes to "remove the time"
    I only need the current date that will change every day.
    Do you know where I can get this script, I goggled and got
    several but I'm looking for something authentic.
    Also is it possible to have your page validate when you use
    Javascript embedded in your HTML?
    Thanks everyone,
    Patrick

    quote:
    Originally posted by:
    Newsgroup User
    Webethics wrote:
    > The problem is, I don't know Javascript and cannot edit
    the Javascript codes
    > to "remove the time"
    > I only need the current date that will change every day.
    JavaScript generates the date by using the clock on the
    computer of each
    visitor to your site. If a visitor's clock has the wrong
    date, your site
    will also display the wrong date.
    > Do you know where I can get this script, I goggled and
    got several but I'm
    > looking for something authentic.
    I don't know what you mean by "authentic". Date generation in
    JavaScript
    is one of the most basic features of the language, so if it
    works, it's
    "authentic".
    > Also is it possible to have your page validate when you
    use Javascript
    > embedded in your HTML?
    Yes, but you shouldn't embed JavaScript in XHTML.
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/
    So mr. Powers are there people that use Javascript Date in
    their page?
    Would you recommend it?
    I could use PHP but I don't know PHP,
    How do I come up with the string in this format, say,
    Wednesday, October 29th, 2008 that will change to a new day
    according to the server time and date.
    Thanks so much for your help and I have two of your books! I
    will be taking PHP classes in December.
    Patrick

  • RFC is not inserting the data

    Hi all,
                    I did File to RFC scenario. My problem is when i send message the message is showen as processed successfully in SXMB_MONI. But RFC is not inserting my data in a specified table. I couldn't found where i am wrong.
    my sender strucure is:
    <MANDT>
    <WORKDATE>
    <EMPLOYEENUMBER>
    <CATSHOURS>
    R3 table name is ZTESTCATSDB
    My RFC source code is :
    FUNCTION Z_POST_TEST.
    ""Local Interface:
    *"  TABLES
    *"      CATSRECORDS_IN STRUCTURE  ZTESTCATSDB OPTIONAL
    *"      RETURN STRUCTURE  BAPIRET2 OPTIONAL
      data wa_cats like ZTESTCATSDB.
      data wa_catdb like ZTESTCATSDB.
      data ztab  like ZTESTCATSDB OCCURS 0 WITH HEADER LINE.
      loop at catsrecords_in into wa_cats.
        ztab-WORKDATE = wa_cats-workdate.
        ztab-empnum = wa_cats-empnum.
        ztab-catshours = wa_cats-catshours.
        append ztab.
      endloop.
      insert ZTESTCATSDB from table ztab.
      commit work.
    ENDFUNCTION.
                          Plese tell me any one where i am wrong it is very urgent for me.
    Thanks,
    Satish.

    You should always check the system return code (sy-subrc) after any insert and update statement like this:
    insert ...
    if sy-subrc > 0.
      message E...
    else.
      commit work.
    endif.
    Hope that helps,
    Stefan

  • Insertion of data between 2 tables ( 1 to * relationship )

    Hi all, I am new to Oracle ADF, I have a problem with the insertion of data between 2 tables (Table A and Table B), I have the ratio 1 to *, and I need to insert data in table B (* Relationship) when insert in Table A all goes well, but when inserted in Table B, I need the primary key value in Table A () in the value field in table B that is as foreign key.
    Ie
    Value Table A
    coda = 20 -> primary key
    Table B values
    1 set of values
    val_1,
    val_2,
    val_3,
    coda = 20 -> need this value is constant up to do a Commit.
    set of values 2
    val_1,
    val_2,
    val_3,
    coda = 20 -> need this value is constant up to do a Commit.
    How I can do it?
    thanks

    Thanks for you answers 'M.Jabr'
    I was wrong, because the relationship 1 to * between tables A and B, I was writing the groovy expression in each table, in this case in Table B (A.codSolicitude), but now I notice that within the DataControls, but specifically in the control data of Table A, there is a relationship between the board B, and I thought to insert into the related table that appears as a master/detail, and first inset in table A and then in Table B in the same page master/detail, and A.CodSolicitude value is automatically filled in Table B, and performed the Commit and everything works. !
    Thanks for you help.
    Now if you can give me some examples with images that are on the web similar to this problem would be great:) Thanks!

  • Bridge CS6 occasionally displaying wrong 'Date Created' for .NEF's

    I noticed this problem only recently, and this the third time it happens (that I know of).
    Sometimes my Bridge puts a wrong Date Created (not Date File Created or Date File Modified) on a NEF RAW file, whilst the next one (taken perhaps just a few seconds or a minute later) has the proper date. Strangely the Date File Created & Modified do show the proper creation date.
    Example to clarify:
    Metadata viewed on my D90 itself
    Photo 1 taken on: 30/09/2013, 9:03:26 PM (DD-MM-YYYY)
    Photo 2: 30/09/2013, 9:07:52 PM
    Photo 3: 30/09/2013, 9:08:12 PM
    Photo 4: 30/09/2013, 9:08:34 PM
    Photo 5: 30/09/2013, 9:08:54 PM
    Photo 6: 30/09/2013, 9:09:34 PM
    viewing in bridge:
    Photo 1: Date Created: 30/09/2013, 9:03:26 PM
                   Date File Created: 30/09/2013, 9:03:26 PM
                   Date File Modified: 30/09/2013, 9:03:26 PM
    Photo 2: Date Created: 30/09/2013, 9:07:52 PM
                   Date File Created: 30/09/2013, 9:07:52 PM
                   Date File Modified: 30/09/2013, 9:07:52 PM
    Photo 3: Date Created: 23/09/2013, 7:42:02 PM
                   Date File Created: 30/09/2013, 9:08:12 PM
                   Date File Modified: 30/09/2013, 9:08:12 PM
    Photo 4: Date Created: 30/09/2013, 9:08:34 PM
                   Date File Created: 30/09/2013, 9:08:34 PM
                   Date File Modified: 30/09/2013, 9:08:34 PM
    Photo 5: Date Created: 04/09/2013, 10:14:45 AM
                   Date File Created: 30/09/2013, 9:08:54 PM
                   Date File Modified: 30/09/2013, 9:08:54 PM
    Photo 6: Date Created: 04/09/2013, 10:15:06 AM
                   Date File Created: 30/09/2013, 9:09:34 PM
                   Date File Modified: 30/09/2013, 9:09:34 PM
    As you can see, it's not a 'stable' deviation.
    I could live with it, apart from one problem: the batch rename function only has 'Date Created' as option for renaming with date.
    It's also quite annoying for my photography study, since my teachers might get confused by the wrong date in the Metadata when I turn my photo in.
    I tried compacting the cache whilst my camera's SD card wasn't connected (so the files aren't 'available' anymore), no difference.
    Another thing I tried was to hook my SD card up on a different computer, same result.
    So it might be my SD card, but that doesn't explain why the correct date is shown on my D90 itself, though.
    If anybody here has an idea how to fix / avoid this problem, help is much appreciated.
    Greetings,
    Alex

    I have never inserted the 8GB card in the D3000 before just a minute ago.
    And I just took 7 rapid photo's of my previous post (~1s interval)
    All 7 displayed actual date in my camera, the first 4 displayed a wrong date in bridge (24/09/2013, times; 2:12:16PM, 2:12:20PM, 3:09:24PM and 3:10:26PM). Last 3 displayed proper time in bridge.
    So yea, I'm pretty sure something is wrong. I'll try formatting the SD card (as suggested before) but however you look at it, this doesn't add up.
    edit:
    Well I figured out one thing: if I view the photo's directly on my SD card through bridge, it shows the same date for Date Created, Date File Created and Date File Modified.
    Quite logical, to be honest, since I am viewing the date the file was created on the camera.
    However, if I export photo's with Adobe Photo Downloader (or whatever it's called again), it displays the date those copies were created (by Date File Created). Date File Modified is still ~the same as Date Created since it hasn't been modified since the original creation.
    edit2:
    The formatting seems to have solved the issue, for now anyway. Still have no clue why the SD card got such (occasional) cases of drunkness.

  • How to insert sign date "now()" in database ?????

    I am a newbie.  Using DW CS5 I have been able to get a number of web pages on my web site to work well.  My problem is with my “sign in form”.  I want to add in the sign in form a hidden field for the date that the user signs up.
    But the signup_date value in the database is not been entered.  I do have a “work around”.  If I replace the last “%s” in the $insertSQL statement with NOW(), the correct signup_date is entered in the database table “users”.  However, I want to learn to do it “right”.  My questions:
    1.      What is the “best” way to accomplish my desire results?
    2.      What do the “%s” stand for in the $insertSQL statement?  I think it is an array, but I do not understand this line of code that DW generated.  Can you explain is plain English?
    Below is the important part of the code (I hope I sent enough to explain the problem) for the sign form: (disregard the /////// they are only there to indicate different sections of the code).
    //This is the code from the input form for the hidden field "signup_date"
    </tr>
        <tr>
          <td align="left" valign="top"><input name="signup_date" type="hidden" id="signup_date" value="NOW()" />
          <td><input type="submit" name="Submit" value="Join Now!"></td>
        </tr>
      </table>
    //This is the dreamweaver code to insert the date into the data base:
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "frJoin")) {
      $insertSQL = sprintf("INSERT INTO users (first_name, last_name, email_address, username, info, user_level, signup_date) VALUES (%s, %s, %s, %s, %s, %s, %s)",
                           GetSQLValueString($_POST['first_name'], "text"),
                           GetSQLValueString($_POST['last_name'], "text"),
                           GetSQLValueString($_POST['email_address'], "text"),
                           GetSQLValueString($_POST['username'], "text"),
                           GetSQLValueString($_POST['info'], "text"),
                           GetSQLValueString($_POST['user_level'], "text"),
                           GetSQLValueString($_POST['signup_date'], "date"));
    Thanks !!

    I do have a “work around”.  If I replace the last “%s” in the $insertSQL statement with NOW(), the correct signup_date is entered in the database table “users”.  However, I want to learn to do it “right”.
    Your "workaround" is actually the correct method. The way that you think is "right", by entering the date into a hidden field, is actually the wrong way. Hidden fields can be manipulated. Inserting data directly into the query is the desired method, like the method you are currently using. It's not a "workaround", it's the correct method. You hidden field is not working because you have not told the page that the NOW() in the hidden field should be processed through php. NOW() is MySQL function. Use php to echo current date in hidden field if you want to use the "wrong" method of processing the date into your query.
    <td align="left" valign="top"><input name="signup_date" type="hidden" id="signup_date" value="<?php echo date("Y-m-d H:i:s"); ?>" />

  • TRUNC() giving wrong data in different versions of Oracle DB

    Hi All,
           I have two oracle data base versions. I need to insert into one temp table with select statement. When i use the same query in both environment am getting different results. Can you please help me on that.
    Version:1
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod
    PL/SQL Release 10.2.0.4.0 - Production
    CORE 10.2.0.4.0 Production
    TNS for 32-bit Windows: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    Version: 2
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
    PL/SQL Release 10.2.0.5.0 - Production
    CORE 10.2.0.5.0 Production
    TNS for IBM/AIX RISC System/6000: Version 10.2.0.5.0 - Productio
    NLSRTL Version 10.2.0.5.0 - Production
    Query we used:
    insert into my_temp_table
    select v_name,trunc(d_charge_date)
    from table1;
    my_temp_table structure:
    v_name               varchar2(30),   
    d_charge_date     date;
    Note: Date columns represented with mm/dd/yyyy format....
    in table1 i have data like this....
    v_name
    d_charge_date
    xxx
    12/2/2012
    yyy
    10/23/2010
    abc
    9/29/2013
    after the insertion into temp table am getting the result like below...
    select * from my_temp_table;
    If i run this query in version 1 am getting the correct data..
    v_name
    d_charge_date
    xxx
    12/2/2012
    yyy
    10/23/2010
    abc
    9/29/2013
    but if i run the same insert query in version 2 getting the wrong data
    v_name
    d_charge_date
    xxx
    12/2/2011
    yyy
    12/2/2011
    abc
    12/2/2011
    If i remove the trunc from the insertion statement i didn't get the wrong data like above...
      I don't know the exactly reason. So can you please help me to identify this cause...

    Hi i think the global temporary table having this issue in version b what i have mentioned above.
    insert into /*+append*/global_temporary_temp
    (v_policy_no,n_seq_no,d_next_chgdue_date,v_charge_freq,v_cntr_stat_code,v_iu_au_base,d_cntr_start_date)
    select distinct a.v_policy_no,a.n_seq_no,trunc(a.d_next_chgdue_date),a.v_charge_freq,b.v_cntr_stat_code,c.v_iu_au_base,b.d_cntr_start_date
    from table_a a,table_2 b,table_3 c
    where a.v_status = 'A'
    and a.v_charge_freq is not null
    and trunc(a.d_next_chgdue_date) <= trunc(sysdate)
    and b.v_cntr_stat_code in ('NB010')
    and a.v_policy_no = b.v_policy_no
    and a.n_seq_no = b.n_seq_no
    and a.v_plri_code = c.v_plan_code
    and a.v_parent_event_code = c.v_parent_event_code
    and a.v_charge_pcode = c.v_charge_pcode
    and a.v_charge_code = c.v_charge_code

  • Oralce query giving wrong data

    Hi all oracle experts :
    in oracle backend ( LOV ) user is selecting 'long text' instead of 'short text' and as a result user is getting wrong data Ship_To_Adress ( column ). here what i need is :
    Upon data is coming from Long_Text table - it should not bring the wrong data Ship_To address.. It should give no value on the report.
    feasibility of modifying query to maintain two Scenarios - Irrespective of Long or Short text - User should not give wrong 'Ship To' address on the pick ticket.
    please go through the following query and make necessary changes. thanks in advance for your precious time valuable advice
    looking the feasibility of modifying query to maintain two Scenarios - Irrespective of Long or Short text - User should not give wrong 'Ship To' address on the pick ticket.
    Thanks in advance
    Shiva
    SELECT
         wpsv.pick_slip_number          "Pick Slip #",
         wdd.source_header_number          "Sales Order #" ,
         wdd.source_line_number          "Sales Order Line #" ,
    nvl(round(ool.unit_selling_price,2),0) "unitsell price" ,
    (nvl(round(ool.unit_selling_price,2),0))*nvl(wpsv.primary_qty,0) "Extended sell rice",
         '*'||wpsv.transaction_id||'*'          "Task ID" ,
         wpsv.transaction_id               "Task ID#" ,
         msi.segment1               "Item",
         msi.description               "Item Description",
         msi.segment1 || ' - ' ||msi.description               "Item - Description",
         wdd.requested_quantity_uom          "UOM",
         wdd.serial_number               "Serial #",
         wnd.delivery_id               "Delivery#",
         wpsv.from_subinventory          "Pick from Sub-inventory",
         wpsv.from_subinventory          || ' - ' ||
              SELECT
                   segment1||'.'||segment2||'.'||segment3||'.'||segment4
              FROM
                   INV.MTL_ITEM_LOCATIONS
              WHERE
                   inventory_location_id     = DECODE(msi.reservable_type,2,wdd.locator_id,wpsv.from_locator_id)
         ) "Pick From",
              SELECT
                   segment1||'.'||segment2||'.'||segment3||'.'||segment4
              FROM
                   INV.MTL_ITEM_LOCATIONS
              WHERE
                   inventory_location_id     = DECODE(msi.reservable_type,2,wdd.locator_id,wpsv.from_locator_id)
         )                    "Pick from Location",
         wpsv.to_subinventory "Deliver to Sub-inventory",
              select
                   segment1||'.'||segment2||'.'||segment3||'.'||segment4
              from
                   inv.mtl_item_locations
              where
                   inventory_location_id     = wpsv.to_locator_id
         )                    "Deliver to Location",
         wpsv.primary_qty          "Quantity to be Picked",
         party.party_name||CHR(10)||
         DECODE(ship_loc.address1, NULL, '',ship_loc.address1||CHR(10))||
         DECODE(ship_loc.address2, NULL, '',ship_loc.address2||CHR(10))||
         DECODE(ship_loc.address3, NULL, '',ship_loc.address3||CHR(10))||
         DECODE(ship_loc.address4, NULL, '',ship_loc.address4||CHR(10))||
         DECODE(ship_loc.city, NULL, NULL, ship_loc.city || ', ') || DECODE(ship_loc.state, NULL, NULL, ship_loc.state || ', ') || DECODE(ship_loc.postal_code, NULL, NULL,      ship_loc.postal_code || ', ') || DECODE(ship_loc.country, NULL, NULL, ship_loc.country) SHIP_TO_ADDRESS,
         NVL(h.shipping_instructions, '-') shipping_instructions,
         NVL(h.shipment_priority_code,'-') shipment_priority_code,
    NVL(OL.MEANING,'-') "Freight Terms",
         NVL(FLV.meaning, '-') shipping_method,
         NVL(QQA.quote_attachment, '-'),
         RSA.name,
         NVL(h.packing_instructions, '-') packing_instructions,
         NVL(H.CUST_PO_NUMBER,'-') customer_po#
    FROM
    apps.oe_order_lines_all ool,
         APPS.WSH_PICK_SLIP_V               WPSV,
         WSH.WSH_DELIVERY_DETAILS          WDD,
         INV.MTL_SYSTEM_ITEMS_B          MSI,
         WSH.WSH_DELIVERY_ASSIGNMENTS     WDA,
         WSH.WSH_NEW_DELIVERIES          WND,
         APPS.ORG_ORGANIZATION_DEFINITIONS     ORG,
         WMS.WMS_DISPATCHED_TASKS          WDT,
         APPS.OE_ORDER_HEADERS_ALL          H,
         APPS.HZ_CUST_SITE_USES_ALL          SHIP_SU,
         APPS.HZ_PARTY_SITES               SHIP_PS,
         APPS.HZ_LOCATIONS               SHIP_LOC,
         APPS.HZ_CUST_ACCT_SITES_ALL          SHIP_CAS,
         APPS.HZ_PARTIES                PARTY,
         APPS.FND_LOOKUP_VALUES          FLV,
    APPS.OE_LOOKUPS OL,
              SELECT
                   OOH.header_id,
                   MAX(DECODE(rownum,1, FDST.short_text, ''))||CHR(10)||CHR(10)||MAX(DECODE(rownum,2, FDST.short_text, ''))||MAX(DECODE(rownum,3, FDST.short_text, ''))||CHR(10)||CHR(10)||MAX(DECODE(rownum,4, FDST.short_text, '')) quote_attachment
              FROM
                   APPS.FND_ATTACHED_DOCUMENTS     FAD
                   , APPS.FND_DOCUMENTS_TL          FDT
                   , APPS.FND_DOCUMENTS_SHORT_TEXT     FDST
                   , APPS.FND_DOCUMENTS               FD
                   , APPS.FND_DOCUMENT_CATEGORIES_TL     FDC
                   , APPS.OE_ORDER_HEADERS_ALL          OOH
                   , APPS.ORG_ORGANIZATION_DEFINITIONS OOD
              WHERE
                   OOD.organization_id =?Organization ? AND
                   OOH.ORDER_NUMBER = ?SO#? AND
                   OOH.org_id = OOD.operating_unit AND
                   TO_CHAR(OOH.header_id) = FAD.pk1_value AND
                   FAD.document_id = FDT.document_id AND
                   FAD.entity_name = 'OE_ORDER_HEADERS' AND
                   FDT.media_id = FDST.media_id AND
                   FDT.language = 'US' AND
                   FAD.document_id = FD.document_id AND
                   FD.category_id = FDC.category_id AND
                   FDC.language = 'US' AND
                   FDC.user_name ='APS_Pack/AR Invoice/CI/SO Ack Printing'
              GROUP BY
                   OOH.header_id
         ) QQA
         , APPS.RA_SALESREPS_ALL RSA
    WHERE
         wpsv.move_order_line_id     =wdd.move_order_line_id          AND
         (wdd.source_header_number = ?SO#? )                    AND
         wdd.inventory_item_id     = msi.inventory_item_id(+)          AND
         wdd.organization_id          = msi.organization_id(+)          AND
         wdd.delivery_detail_id     = wda.delivery_detail_id          AND
         wda.delivery_id          = wnd.delivery_id(+)               AND
         wdd.organization_id = org.organization_id               AND
         wdt.TRANSACTION_TEMP_ID(+)=wpsv.transaction_id          AND
         wdt.organization_id (+)      =?Organization ?               AND
         wdd.organization_id          =?Organization ?               AND
         wdd.source_header_number      = h.order_number               AND
         h.salesrep_id = RSA.salesrep_id(+) AND
         h.org_id = RSA.org_id(+) AND
         h.org_id                = org.operating_unit               AND
         SHIP_PS.party_id          = PARTY.party_id(+)           AND
         H.ship_to_org_id          = SHIP_SU.site_use_id(+)           AND
         SHIP_SU.cust_acct_site_id     = SHIP_CAS.cust_acct_site_id(+)      AND
         SHIP_CAS.party_site_id     = SHIP_PS.party_site_id(+)           AND
         SHIP_LOC.location_id(+)     = SHIP_PS.location_id           AND
         H.shipping_method_code     = FLV.lookup_code(+)          AND
         FLV.lookup_type(+)          = 'SHIP_METHOD'               AND
         FLV.language(+)          = 'US'                    AND
         QQA.header_id(+)           = TO_CHAR(H.header_id)           AND
         wpsv.line_status          = 'UNPICKED'               AND
    H.FREIGHT_TERMS_CODE=OL.LOOKUP_CODE(+)
    AND OL.LOOKUP_TYPE(+) ='FREIGHT_TERMS' AND
    OOL.header_id = wdd.source_header_id(+) AND
    OOL.line_id = wdd.source_line_id(+) AND
         EXISTS(
              SELECT
                   'Y'
              FROM
                   INV.MTL_ONHAND_QUANTITIES_DETAIL OHQ
              WHERE
                   WDD.inventory_item_id     = OHQ.inventory_item_id     AND
                   WDD.organization_id     = OHQ.organization_id     AND
                   WPSV.from_subinventory = OHQ.subinventory_code
              GROUP BY
                   'Y'
              HAVING
                   SUM(transaction_quantity) >0
    ORDER BY
         2, 11, 12, 6, 3

    Thank you very much indeed for your reply - yes youre right. in oracle backend there are dropdown selections : 1) short text and 2) long text. as per the table user has to select short text so that he will get the correct output , but if by mistake user selects long text then the table is pulling wrong data. so here we need the query to be changed if user selects long text report shouldnt show any data..
    i am not sure but as per my little knowledge in oracle i believe that the problem is lying in the folloiwng query line.. please help me out in this regard. i have a screen shots of oralce backend where user is selecting long text / short text but here theres no option of inserting the files...
    DECODE(ship_loc.address1, NULL, '',ship_loc.address1||CHR(10))||
    DECODE(ship_loc.address2, NULL, '',ship_loc.address2||CHR(10))||
    DECODE(ship_loc.address3, NULL, '',ship_loc.address3||CHR(10))||
    DECODE(ship_loc.address4, NULL, '',ship_loc.address4||CHR(10))||
    DECODE(ship_loc.city, NULL, NULL, ship_loc.city || ', ') || DECODE(ship_loc.state, NULL, NULL, ship_loc.state || ', ') || DECODE(ship_loc.postal_code, NULL, NULL, ship_loc.postal_code || ', ') || DECODE(ship_loc.country, NULL, NULL, ship_loc.country) SHIP_TO_ADDRESS,
    Thank you very much once again
    Shiva

  • Refresh jTable after inserting new data into the Database

    Hey all,
    I'm using Netbeans 6.5 to create a Desktop Application which is connected to a Java DB (Derby).
    The first simple steps were all very successfull:
    Create the jTable and bind it to the Database => everything works fine. When the application starts it correctly shows all data from the database.
    The problem starts when I try to insert new data to the database.
    For that reason I've created textfields and a button "Save". When I press the button it successfully inserts the data to the database but they are not displayed in the jTable (when the application starts they are all there, they are not updated at runtime) . I've tried table.invalidate() and table.repaint() but they just don't work.
    Any help will be GREATLY appreciated. But please have in mind that most of the code is Netbeans-generated and most of it not editable.
    Many thanks in advance.
    George

    Once again you are right my friend. I jumped to conclusion way too fast, when I shouldn't. (Give me a break, I've been busting my head with this well over a week). The response I saw when I did that was that indeed a line is added to the jTable. Because I falsly set the index of the object to be added to be second to last the row appeared on the table, what I didn't see at the time was that the last one disappeared. Hmm...
    A new adventure begins...
    So after a few hours of messing around with it here are my observations:
    1) It was not an observable list. When I add the new element with employeesList.add(newEmp); , the table gets notified but a get a bunch of exceptions:
    xception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException: Index: 84, Size: 84
            at java.util.ArrayList.RangeCheck(ArrayList.java:546)
            at java.util.ArrayList.get(ArrayList.java:321)
            at org.jdesktop.swingbinding.impl.ListBindingManager$ColumnDescriptionManager.validateBinding(ListBindingManager.java:191)
            at org.jdesktop.swingbinding.impl.ListBindingManager.valueAt(ListBindingManager.java:99)
            at org.jdesktop.swingbinding.JTableBinding$BindingTableModel.getValueAt(JTableBinding.java:713)
            at javax.swing.JTable.getValueAt(JTable.java:1903)
            at javax.swing.JTable.prepareRenderer(JTable.java:3911)
            at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:2072)
            at javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:1974)
            at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:1897)
            at javax.swing.plaf.ComponentUI.update(ComponentUI.java:154)
            at javax.swing.JComponent.paintComponent(JComponent.java:743)
            at javax.swing.JComponent.paint(JComponent.java:1006)
            at javax.swing.JViewport.blitDoubleBuffered(JViewport.java:1602)
            at javax.swing.JViewport.windowBlitPaint(JViewport.java:1568)
            at javax.swing.JViewport.setViewPosition(JViewport.java:1098)
            at javax.swing.plaf.basic.BasicScrollPaneUI$Handler.vsbStateChanged(BasicScrollPaneUI.java:818)
            at javax.swing.plaf.basic.BasicScrollPaneUI$Handler.stateChanged(BasicScrollPaneUI.java:807)
            at javax.swing.DefaultBoundedRangeModel.fireStateChanged(DefaultBoundedRangeModel.java:348)
            at javax.swing.DefaultBoundedRangeModel.setRangeProperties(DefaultBoundedRangeModel.java:285)
            at javax.swing.DefaultBoundedRangeModel.setValue(DefaultBoundedRangeModel.java:151)
            at javax.swing.JScrollBar.setValue(JScrollBar.java:441)
            at javax.swing.plaf.basic.BasicScrollBarUI.scrollByUnits(BasicScrollBarUI.java:907)
            at javax.swing.plaf.basic.BasicScrollPaneUI$Handler.mouseWheelMoved(BasicScrollPaneUI.java:778)
            at javax.swing.plaf.basic.BasicScrollPaneUI$MouseWheelHandler.mouseWheelMoved(BasicScrollPaneUI.java:449)
            at apple.laf.CUIAquaScrollPane$XYMouseWheelHandler.mouseWheelMoved(CUIAquaScrollPane.java:38)
            at java.awt.Component.processMouseWheelEvent(Component.java:5690)
            at java.awt.Component.processEvent(Component.java:5374)
            at java.awt.Container.processEvent(Container.java:2010)
            at java.awt.Component.dispatchEventImpl(Component.java:4068)
            at java.awt.Container.dispatchEventImpl(Container.java:2068)
            at java.awt.Component.dispatchMouseWheelToAncestor(Component.java:4211)
            at java.awt.Component.dispatchEventImpl(Component.java:3955)
            at java.awt.Container.dispatchEventImpl(Container.java:2068)
            at java.awt.Component.dispatchEvent(Component.java:3903)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4256)
            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3965)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3866)
            at java.awt.Container.dispatchEventImpl(Container.java:2054)
            at java.awt.Window.dispatchEventImpl(Window.java:1801)
            at java.awt.Component.dispatchEvent(Component.java:3903)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
            at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException: Index: 84, Size: 84
            at java.util.ArrayList.RangeCheck(ArrayList.java:546)
            at java.util.ArrayList.get(ArrayList.java:321)
            at org.jdesktop.swingbinding.impl.ListBindingManager$ColumnDescriptionManager.validateBinding(ListBindingManager.java:191)
            at org.jdesktop.swingbinding.impl.ListBindingManager.valueAt(ListBindingManager.java:99)
            at org.jdesktop.swingbinding.JTableBinding$BindingTableModel.getValueAt(JTableBinding.java:713)
            at javax.swing.JTable.getValueAt(JTable.java:1903)
            at javax.swing.JTable.prepareRenderer(JTable.java:3911)
            at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:2072)
    ... and a lot morewhich from my poor understanding means that the jTable succesfully notices the change but it is not able (??) to adjust to the new change. What is more interesting is that when I plainly add the element to the end of the list (without an idex that is), a blank row appears at the end of my Table. The weird thing is that I've bound the table to some text fields below it, and when I select that empty row all the data appear correctly to the text fields.
    I tried going through:
                    org.jdesktop.observablecollections.ObservableCollections.observableList(employeesList).add(newEmp);as well as
                    help = org.jdesktop.observablecollections.ObservableCollections.observableListHelper(employeesList);
                    help.getObservableList().add(newEmp);
                    help.fireElementChanged(employeesList.lastIndexOf(newEmp));and
                    obsemployeesList = org.jdesktop.observablecollections.ObservableCollections.observableList(employeesList);
                    obsemployeesList.add(newEmp);and I still get the same results (both the exeptions and the mysterious empty row at the end of the table
    So, I'm again in terrible need of your advice. I can't thank you enough for the effort you put into this.
    Best regards,
    George
    Edited by: tougeo on May 30, 2009 11:06 AM
    Edited by: tougeo on May 30, 2009 11:21 AM
    Edited by: tougeo on May 30, 2009 11:30 AM

  • How to insert the data which is present in the variable into the table

    Hi,
    Let's consider that I have one table and I have stored the table column names in one variable and their values in another variable.
    I want to insert the data that is present in the variables into the table.
    I tried the following way :
    Declare
    V_columns    Varchar2(50) := 'Empno';
    V_values       Number(10) := 101;
    Begin
    Insert Into Emp (V_columns) Values (V_values);
    End;
    The above procedure gives an error : PL?SQL : ORA-00904 : "V_COLUMNS": invalid identifier
    Using the Execute Immediate, we can insert the data which is present in the variables into the table.
    Is there any other way to insert the data which is present in the variable into the table..?
    Can anyone please give me the solution..?
    Thanks..

    plz use this...
    DECLARE
       v_columns   VARCHAR2 (50) := 'Empno';
       v_values    NUMBER (10)   := 101;
    BEGIN
       EXECUTE IMMEDIATE    'Insert Into Emp ('
                         || v_columns
                         || ') Values ('
                         || v_values
                         || ')';
       COMMIT;
    END;

  • Downloads with Safari show wrong date

    Hi, this is my first post and I'm stumped.
    When I download a file (i.e. PDF) via Safari on either my Imac or Macbook (4.03 and 4.02) both running Leopard 10.5.7 it shows up in my downloads folder with the wrong date: wrong year, month, and day.
    When I download the same file with Firefox the download date is correct.
    Does anyone have any suggestions to remedy this annoying problem? Thanks.

    Ok. I just downloaded a PDF via Safari that shows the creation date as: 23/12/08 1:10 AM.
    Same file downloaded via Firefox shows date correctly: today at 9:16 PM.
    The date from Safari has been all over the map... 03, 07, 00 etc. all different.
    Message was edited by: i-Mack

  • Wrong Dates in Sent Folder

    After doing a clean install of 10.5 and importing all of my mail messages from my .mac account, I noticed that many of the messages in my sent folder had the wrong date. Apparently they were marked with the date on which I first synchronized my 10.5 Mail with my .mac account. I've since tried to rebuild that folder, and when I do that, those problematic messages show up as sent "Today" at the time I rebuilt, even though many of them are nearly a year old. Any suggestions as to what might be causing this? I've read several threads regarding problems with the sent folder, but none with this specific date problem.
    Thanks.
    One more thing...
    All sent message show up with the correct date when I access the sent folder online through .mac.
    Message was edited by: James Casey1

    I tried several experiments and noticed that if you move the messages in "sent messages" with wrong dates to another folder (for example to the "inbox") then they get back to their correct date.
    Apparently rebuilding mail boxes at this point doesn't fix anything, as if you move the messages into "sent messages" again then the date gets wrong again.
    Funny enough, when the message is back into "sent messages" and appears there with the wrong date, if you make a text search FROM THE INBOX on all folders in the search results these messages will appear as located in "sent messages" with THE RIGHT DATE!!! Doing the same search when you are in "sent messages" will show the message with the wrong date!!!
    So I am now sure there is BIG BUG in Mail about this.
    So unless Apple fix this, I guess the only way is to put all the messages from your "sent messages" with wrong dates in a folder where they appear with the correct date, save or export your "sent messages" folder messages, delete entirely your "sent messages" folder, and reload all you "sent messages" again.
    However I have no safe procedure for this and it won't prevent the bug to reoccur later on...

Maybe you are looking for

  • Anime tv series missing from psn

    Hi, I have noticed that some anime tv series are now missing from psn like guilty crown, jormungand and robotics;notes especially.  I like to buy a few new episodes of an anime every few weeks from the psn store and have been doing this for a long ti

  • Differences

    Hi friends,                   Can u plz tell d 1) Difference b/w Smartforms and SAP scripts 2) Difference b/w LSMW and BDC. 3) Difference b/w Classical and Interactive Report

  • IMAP Alternate partition problem

    IMAP partition problem IMAP is set so all boxes are on a separate partition .. and until recently, worked fine. one day (shortly after 10.4.9 upgrade) after "rebuilding" an IMAP inbox from Mail.app everything went down.. and came up again with all IM

  • Why can't I access the download link for the newest Flash Player build?

    So I want to update my Adobe Flash Player... If I head over to Adobe.com and go to Download > Adobe Flash Player, I am sent to http://get.adobe.com/flashplayer/?promoid=JZEFT Then, if I click "Install Now" (also my anti-virus does accept software ins

  • Recovering Lightroom settings

    Hi, I am just completing an involuntary migration from XP to Windows 7 following a computer failure. Fortunately I have access to the discs from the old system. I have Lightroom setup and working and I just wondered if there is any way I can recover