How to store this value in date variable?

Hi sir,
i am having one query which is
select to_char(date '1900-01-01' + 1439/(24*60),'DD/MM/YYYY HH24:MI:ss')from dual;
when i am running this query i am getting this value: 01/01/1900 23:59:00
and this value i am inserting in one variable which has date datatype.
here i am storing like this:
v_nshiftmax := to_char(date '1900-01-01' + 1439/(24*60),'DD/MM/YYYY HH24:MI:SS');
while storing getting error: not a valid month
how to store it in this variable?
thanks

964430 wrote:
why using TO_DATE (), to improve performance avoid function calling if you can do without it, just use v_nshiftmax := date '1900-01-01' + 1439/(24*60); remove TO_CHAR() function only, as you already converted it to date.Please prove to us that TO_DATE(...) is slower that using DATE '...'
Both are internal functions that take a string and turn it into a date.

Similar Messages

  • Store multiple values into a variable

    I was wondering if it was possible to store multiple values into one varaible. Something along the lines of...
    Oracle: 10g
    --Table xSample (this is obviously a dumbed down version of the table for the sake of showing what I want to accomplish
    S_ID   YEAR
    1         2009
    2         2009
    3         2009
    4         2009
    --Query
    select     s_id
    into       pID
    from      xSample
    where    year = 2009;Basically the reason I was trying to figure out how to store multiple values into a variable is b/c I was going to use that variable (pID) as a parameter and have it's values passed dynamically when the proc was called. The values would go into a query that would look something like:
    select *
    from cust_data
    where person_id in (pID)
    aka
    select *
    from cust_data
    where person_id in (1,2,3,4)Not sure if this is possible, but if anyone knows of a way I could accomplish this that would be great.
    Edited by: user652714 on Dec 23, 2009 9:37 AM

    Here's a basic idea building a comma seperated list, then consuming it in another query (taking the in list approach from Tom's post, linked earlier).
    create table xsample (s_id number not null, year number);
    insert into xsample select level, 2009 from dual connect by level <=4;
    commit;
    declare
       --4000 should be lots ... hopefully?
       v_parameter_list varchar2(4000);
    begin
      --create the comma seperated list
      select
        substr(max(sys_connect_by_path(s_id, ',') ), 2, 4000)
      into
        v_parameter_list
      from
        select s_id, row_number() over(order by 1) as rn
        from xsample
        where year = 2009
      start with rn = 1
      connect by prior rn = rn - 1;
      --consume the comma seperated list
      for x in
        with data as
          select
            trim( substr (txt,
            instr (txt, ',', 1, level  ) + 1,
            instr (txt, ',', 1, level+1)
            - instr (txt, ',', 1, level) -1 ) ) as token
          from
            select ','||v_parameter_list||',' txt
            from dual
          connect by level <= length(v_parameter_list)-length(replace(v_parameter_list,',',''))+1
        select *
        from xsample
        where s_id in (select * from data) 
      loop
        dbms_output.put_line('next item = ' || x.s_id);
      end loop;
    end;
    /

  • How to load this value into the master data display attribute

    Hi ,
    Please share me the knowldege how to load this kind of data into master data display attribtes ..
    Raj + Ravi Ltd (PCG: 13592)
    While loading this data ,i got the error message stating that '+' should not be part of the attributes and () should not be part of the attribute ..but i need all the information as it is available in the example data .
    Do i need to maintain RSKC Settings else some other things required ..
    Please guide me ..
    Regards,
    Raj

    HI,
    Maintain these symbols in RSKC and try to reload the data....

  • How to find the value of a variable in other program

    How to find the value of a variable in other program say I am in a FM and this FM is being called in from other program and I want to know some of the variable details of the program from the FM itself. Imagine if this is a txn. and I need to know the details from some of the programs while executing the same transaction
    Regards
    Vin

    Hi Vinayak,
         you will be having your first program values in internal table or some variables,
        when you are calling the second program you wii use like this,
        SUBMIT <Second Program Name> USING SELECTION-SCREEN '1000'
                           WITH s_emp(second program select-options)   IN t_emp(first program variables)
                           WITH p_chk   EQ t_chk
                           WITH p_r1    EQ t_r1
                           WITH p_month EQ t_month
                           WITH s_cust1 IN t_cust1
                           WITH p_r2    EQ t_r2
                           WITH s_cust2 IN t_cust2
                           WITH s_week  IN t_week
                           AND RETURN.
    you have pas like this to get your first program details.

  • How to store the flat file data into custom table?

    Hi,
    Iam working on inbound interface.Can any one tell me how to store the flat file data into custom table?what is the procedure?
    Regards,
    Sujan

    Hie
    u can use function
    F4_FILENAME
    to pick the file from front-end or location.
    then use function
    WS_UPLOAD
    to upload into
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL FUNCTION 'F4_FILENAME'   "Function to pick file
        EXPORTING
          field_name = 'p_file'     "file
        IMPORTING
          file_name  = p_file.     "file
      CALL FUNCTION 'WS_UPLOAD'
       EXPORTING
         filename                       = p_file1
        TABLES
          data_tab                      = it_line
    *then loop at it_line splitting it into the fields of your custom table.
    loop at it_line.
              split itline at ',' into
              itab-name
              itab-surname.
    endloop.
    then u can insert the values into yo table from the itab work area.
    regards
    Isaac Prince

  • How to set default value to date type attribute.

    Hi,
    How to set default value to date type attribute.
    E.g I want to set u201C01/01/1999u201D to date attributes.
    First i want to set value and then i want to fetch the same & want to check equals.
    please suggest solution.
    Regards,
    Smita

    Hi,
    In wdinit() method u can set the date
    DateFormat df = new SimpleDateFormat("MM/dd/yyyy");
    Date today = Calendar.getInstance().getTime();
    String reportDate = df.format(today);
    wdContext.currentContextElement().setFromDate(reportDate);
    Another way you have set the this formate like that
    1. Create a Simple type under "Dictionaries->SimpleType" called DateFormat
    2. Select the type as "date"
    3. Go to the "Representation" tab and set the format as "dd/MM/yyyy" (or whatever u want, but month should be MM)
    4.Bind the context attribute to the type created now.
    Hope this helps u.
    Best Regards
    Vijay K

  • How to get the value of a variable defined in javascript in JSP

    how to get the value of a variable defined in javascript in/through JSP????

    In Javascript you can use the DOM to access the input element and set it's value before submitting the form. Then it's value will just be passed.

  • How to get the value of a variable in FOX?

    Hi,
    In the FOX program how to get the value of a variable defined in planning area?
    can anyone give me some sample code?
    thanks

    Adding to the last reply,
    you can use VARI(variable) to get the count of the values.
    In the latest version of BPS, you may also use the following new foreach construct:
    FOREACH var IN VARIABLE  variable_id.
    Regards - Ravi

  • How to search this value in oracle database to find out the table

    Hi expert,
    I know there is a value in oracle database, please show me how to search this value in oracle database to find out the table holding this value.
    Many Thanks,

    918440 wrote:
    Hi friends,
    this question is really practical, I already know there is value from application saved in database, I want to search the whole database to figure out which table the value is contained.write SQL that writes SQL to query every table.
    Handle:     918440
    Status Level:     Newbie
    Registered:     Mar 2, 2012
    Total Posts:     20
    Total Questions:     10 (10 unresolved)
    why do you waste time here when you NEVER get any answer to any question you post?

  • Which table stores this value Transmission Servlet Base URL

    Hi All,
    EBS r12 12.1.3
    From the screen in Payment
    Update Payment System: FirstDataNorth
    i am looking for table that stores this value
    Transmission Servlet Base URL
    did look in these tables FND_PROFILE*but not available.
    Please help!
    Regards,

    Hi,
    I am not sure, whether you are looking at the correct place. Can you also let us know what made you ask to check the infromation from table.
    But there are configuration file which stores these information. I believe the source we are looking info might be wrong.
    Also have a look at:
    Oracle Payments Implementation Guide
    Best Regards,

  • How do I edit value of PATH variable in AIX?

    How do I edit value of PATH variable in AIX?

    Hi Sandy,
    You need to edit .profile file from the users home directory...
    (Please note DOT before filename, which make the file hidden...)
    use "ls -a" command to list hidden files.
    its a basic question, why don't you search google for such issues.
    It will also help you to understand the system better...
    Regards.
    Rajesh Narkhede

  • How to store and retrieve blob data type in/from oracle database using JSP

    how to store and retrieve blob data type in/from oracle database using JSP and not using servlet
    thanks

    JSP? Why?
    start here: [http://java.sun.com/developer/onlineTraining/JSPIntro/contents.html]

  • How to store the value to variable?

    hi
    plz c the below code...
    my prblm is i want to store the value of wa_final-preis into new_xeipa-preis if there is only one ebeln...
    if there are more procss orders then i want to save the first value to new_xeipa-preis wn second record comes then new_xeipa-preis should be replaced by new value and old_xeipa-preis replaced by old value....
    how to do this?
    LOOP AT xeipa INTO wa_xeipa.
      idx = sy-tabix.
      CLEAR: wa_xeina.
        READ TABLE xeina INTO wa_xeina WITH KEY infnr = wa_xeipa-infnr.
        IF sy-subrc is INITIAL.
        wa_final-infnr = wa_xeipa-infnr.
        wa_final-ebeln = wa_xeipa-ebeln.
        wa_final-bedat = wa_xeipa-bedat.
        wa_final-matnr = wa_xeina-matnr.
        wa_final-lifnr = wa_xeina-lifnr.
        wa_final-peinh = wa_xeipa-peinh.
        wa_final-preis = wa_xeipa-preis.        "net price
        wa_final-bprme = wa_xeipa-bprme.
        wa_final-bwaer = wa_xeipa-bwaer.
        IF ( wa_final-infnr is NOT INITIAL ) AND ( wa_final-ebeln is NOT INITIAL ) .
        ABWEICHUNG = ( new_xeipa-preis / old_xeipa-preis ) * 100 .
        ENDIF.
        append wa_final to it_final.
        ENDIF.

    Hi Smitha,
    Check the below given code.
    LOOP AT xeipa INTO wa_xeipa.
      idx = sy-tabix.
      CLEAR: wa_xeina.
        READ TABLE xeina INTO wa_xeina WITH KEY infnr = wa_xeipa-infnr.
        IF sy-subrc is INITIAL.
        wa_final-infnr = wa_xeipa-infnr.
        wa_final-ebeln = wa_xeipa-ebeln.
        wa_final-bedat = wa_xeipa-bedat.
        wa_final-matnr = wa_xeina-matnr.
        wa_final-lifnr = wa_xeina-lifnr.
        wa_final-peinh = wa_xeipa-peinh.
        wa_final-preis = wa_xeipa-preis.        "net price
        wa_final-bprme = wa_xeipa-bprme.
        wa_final-bwaer = wa_xeipa-bwaer.
    " First time this value is not populated. When the second value comes in,
    " New value gets populated in OLD variable and New value is replaced with the latest.
        *IF idx NE 1.*
          *old_xeipa-preis = new_xeipa-preis.*
        *ENDIF.*
        *new_xeipa-preis = wa_xeipa-preis.*
      IF ( wa_final-infnr is NOT INITIAL ) AND ( wa_final-ebeln is NOT INITIAL ) .
        ABWEICHUNG = ( new_xeipa-preis / old_xeipa-preis ) * 100 .
        ENDIF.
        append wa_final to it_final.
        ENDIF.
    ENDLOOP.
    I hope this is what you were looking for.
    Thanks & Regards,
    Ram.
    Edited by: ram Kumar on Jun 12, 2009 5:16 PM

  • How to store three values in a suitable data structure?

    Hi Friends!
    Usually, if we want to store a single value we choose vector/set data structure.
    And for two values we prefer map<int, vector<int>> or multimap<int, vector<int>>.
    If I want to store three values like;
    1=>3=>2  4  5
    1=>5=>7
    2=>3=>10  12
    Then, which data structure is suitable for it?
    And how to insert entry into it?
    Could anyone help me?

    You could try   
         typedef vector<int> INTVEC;
         typedef map<int, INTVEC> INTMAP;
         typedef multimap<int, INTMAP> INTMULT;
    You should convince yourself that the above is equivalent to (but hopefully easier to understand)
         typedef multimap<int, map<int, vector<int>>> INTMULT;
    When you try to store values in an object of this type, remember to build it from the inside out:
         Build an INTVEC with the values you want (such as 2 4 5 per your first example).
         Assign that INVEC to an INTMAP with a suitable key (3 in your example).
         Insert that INTMAP into an INTMULT with its appropriate key (1 per your example).
         Repeat these three steps using 7, 5, 1, respectively.
         Repeat again using 10 12, 3, 2, respectively.
    Alternately, you could define a structure like
         struct INTSTRUCT{
              int key;
              vector<int> vec;};
    and then define your multimap as <int, INSTSTRUC>.   This allows you to assign values to both members of a structure object directly and then insert the structure into the multimap with the appropriate key.
    On the other hand, if you change your concept by removing the second => and always put the "second" int as the first element of the vector, as in
         1 => 3 2 4 5
         1 => 5 7
         2 => 3 10 12
    you could simplify things to a multimap<int, vector<int>> you are already familiar with.
    A slightly different concept change to
         1 => 3 => 2 4 5
                  5 => 7
         2 => 3 => 10
    would allow you to use map<int, map<int, vector<int>>> where element [1] of this object contains a map with two elements and element [2] contains a map with a single element.
    Or you could tell us how you intend to use the data and maybe somebody can suggest a more practical approach.
    Yes, I could understand the way you explained as
     typedef multimap<int, map<int, vector<int>>> INTMULT;
    and I used typedef
    multimap<int, map<int, set<int>>> INTMULT;
    but, when I used it, I get,
    1=>3=>2
    1=>3=>4
    1=>3=>5
    1=>5=>7
    2=>3=>10
    2=>3=>12

  • How to store resultset value to  Some other variable

    ResultSet rset1=stmt1.executeQuery("SELECT count(*) FROM
    user_details_table" );
    while(rset1.next())
    System.out.println("No.of Connected Users In UserDetails Table: " + rset1.getInt(1));
    int x=rset1.getInt(1);
    to store tht resultset value into integer variable.Bt tht statement is giving error. Pls help me.
    Thanks....

    try
    ResultSet rset1=stmt1.executeQuery("SELECT count(*) FROM
    user_details_table" );
    while(rset1.next())
    int x=rset1.getInt(1);
    System.out.println("No.of Connected Users In UserDetails Table: " + x);
    }

Maybe you are looking for

  • Availibility check at Storage location level

    Dear all, we have implemented inventory management ( not wm and lean wm ) , my business scenerio is when i am creating the STO the availibility check is carried out which is considering all the storage locations of supplying site e.g  SL01 - Unrestri

  • SQL Developer 1.5.3 - Why is "Find and Replace" now a model dialog?

    In SQL Developer 1.5.3 the find and replace dialog is now a modal dialog. This prevent you from copying content from below it. Basically only option is to type instead of copy and paste Very frustrating!

  • Can't edit in Address Book

    My Address Book stopped accepting any editing whatsoever. I have a MacBook Intel Core, I work with Tiger 10.4.11, and run address book version 4.0.4. For a few weeks now, when I get into Address book the Edit button is dimmed, and no change is possib

  • Trouble compiling cldc 1.02

    I'm trying to install j2me, and I downloaded midp, j2mewtk, cldc, and midp-palm. Where I'm having the most trouble currently is trying to build cldc. I'm running NT4, but I don't have cl, which the build wants to use. I do have g++. Can anyone help m

  • Disabling tab functionality in a field

    Dear all, How do you disable tab functionality in a field in sap b1 2005? I would just like to have a formatted search on the field. Regards, Monil