How do I pass the exact datetime parameter in a procedure.

How do I pass the exact datetime parameter in a procedure.
Hi All,
I have a datetime problem which is driving me crazy.
I need pass a datetime field as a parameter in an oracle procedure exactly as below with timestamp.
Example: '6/01/2005 5:25:24 AM'
SQL > exec myprod(‘value1’,’value2’,’value3’, to_date('6/01/2005 5:25:24 AM','dd-mm-yyyy hh24:mi:ss'));
I get an error “INVALID MONTH”
Next Changed to_date to to_char
SQL > exec myprod(‘value1’,’value2’,’value3’, to_char('6/01/2005 5:25:24 AM','dd-mm-yyyy hh24:mi:ss'));
I get a different error, “INVALID NUMBER”
Next pass the datetime as it is.
SQL > exec myprod(‘value1’,’value2’,’value3’, '6/01/2005 5:25:24 AM');
I get an error “INVALID MONTH”
Here is the my procedure.
CREATE OR REPLACE PROCEDURE myprod (
p_value1 varchar2,
p_value2 varchar2,
p_value3 varchar2 ,
p_value4 date )
IS
filehandler UTL_FILE.FILE_TYPE;
va_currentdate DATE;
BEGIN
SELECT sysdate
     INTO va_currentdate
FROM dual;
END;
Do you know any solutions for this problem.
Thanks

What is your NLS_DATE_FORMAT value?
There seem to be some implicit data conversions in your arguments.
SQL> select parameter,value from nls_session_parameters where parameter like '%DATE%';
PARAMETER                                                    VALUE
NLS_DATE_FORMAT                                              YYYY-MM-DD HH24:MI:SS
NLS_DATE_LANGUAGE                                            AMERICAN
SQL> select to_date('6/01/2005 5:25:24 AM','dd-mm-yyyy hh24:mi:ss') from dual;
select to_date('6/01/2005 5:25:24 AM','dd-mm-yyyy hh24:mi:ss') from dual
ERROR at line 1:
ORA-01830: date format picture ends before converting entire input string
SQL> select to_date('6/01/2005 5:25:24 AM','dd-mm-yyyy hh:mi:ss am') from dual;
TO_DATE('6/01/20055
2005-01-06 05:25:24

Similar Messages

  • How can i pass the  parameter for strored procedure from java

    dear all,
    I am very new for stored procedure
    1. I want to write the strored procedure for insert.
    2. How can i pass the parameter for that procedure from java.
    if any material available in internet create procedure and call procedure from java , and passing parameter to procedure from java

    Hi Ram,
    To call the callable statement use the below sample.
    stmt = conn.prepareCall("{call <procedure name>(?,?)}");
    stmt.setString(1,value);//Input parameter
    stmt.registerOutParameter(2,Types.BIGINT);//Output parameter
    stmt.execute();
    seq = (int)stmt.getLong(2);//Getting the result from the procedure.

  • How to find out the exact BAdI

    hi all,
    can any one tell me how to find out the exact badi for the given transaction

    Hi,
    Execute this report !
    It gives you all the badis and user exits present for that particular transaction !
    REPORT z_user_exits_n_badis.
    TABLES:
    tstc,
    tadir,
    modsapt,
    modact,
    trdir,
    tfdir,
    enlfdir,
    sxs_attrt ,
    tstct.
    DATA: jtab LIKE tadir OCCURS 0 WITH HEADER LINE.
    DATA: field1(30).
    DATA: v_devclass LIKE tadir-devclass.
    PARAMETERS:
    p_tcode LIKE tstc-tcode,
    p_pgmna LIKE tstc-pgmna .
    DATA:
    wa_tadir TYPE tadir.
    u2022     START-OF-SELECTION *
    START-OF-SELECTION.
    IF NOT p_tcode IS INITIAL.
    SELECT SINGLE * FROM tstc WHERE tcode EQ p_tcode.
    ELSEIF NOT p_pgmna IS INITIAL.
    tstc-pgmna = p_pgmna.
    ENDIF.
    IF sy-subrc EQ 0.
    SELECT SINGLE * FROM tadir
    WHERE pgmid = 'R3TR'
    AND object = 'PROG'
    AND obj_name = tstc-pgmna.
    MOVE : tadir-devclass TO v_devclass.
    IF sy-subrc NE 0.
    SELECT SINGLE * FROM trdir
    WHERE name = tstc-pgmna.
    IF trdir-subc EQ 'F'.
    SELECT SINGLE * FROM tfdir
    WHERE pname = tstc-pgmna.
    SELECT SINGLE * FROM enlfdir
    WHERE funcname = tfdir-funcname.
    SELECT SINGLE * FROM tadir
    WHERE pgmid = 'R3TR'
    AND object = 'FUGR'
    AND obj_name EQ enlfdir-area.
    MOVE : tadir-devclass TO v_devclass.
    ENDIF.
    ENDIF.
    SELECT * FROM tadir INTO TABLE jtab
    WHERE pgmid = 'R3TR'
    AND object IN ('SMOD', 'SXSD')
    AND devclass = v_devclass.
    SELECT SINGLE * FROM tstct
    WHERE sprsl EQ sy-langu
    AND tcode EQ p_tcode.
    FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
    WRITE:/(19) 'Transaction Code - ',
    20(20) p_tcode,
    45(50) tstct-ttext.
    SKIP.
    IF NOT jtab[] IS INITIAL.
    WRITE:/(105) sy-uline.
    FORMAT COLOR COL_HEADING INTENSIFIED ON.
    u2022     Sorting the internal Table
    SORT jtab BY object.
    DATA : wf_txt(60) TYPE c,
    wf_smod TYPE i ,
    wf_badi TYPE i ,
    wf_object2(30) TYPE c.
    CLEAR : wf_smod, wf_badi , wf_object2.
    u2022     Get the total SMOD.
    LOOP AT jtab INTO wa_tadir.
    AT FIRST.
    FORMAT COLOR COL_HEADING INTENSIFIED ON.
    WRITE:/1 sy-vline,
    2 'Enhancement/ Business Add-in',
    41 sy-vline ,
    42 'Description',
    105 sy-vline.
    WRITE:/(105) sy-uline.
    ENDAT.
    CLEAR wf_txt.
    AT NEW object.
    IF wa_tadir-object = 'SMOD'.
    wf_object2 = 'Enhancement' .
    ELSEIF wa_tadir-object = 'SXSD'.
    wf_object2 = ' Business Add-in'.
    ENDIF.
    FORMAT COLOR COL_GROUP INTENSIFIED ON.
    WRITE:/1 sy-vline,
    2 wf_object2,
    105 sy-vline.
    ENDAT.
    CASE wa_tadir-object.
    WHEN 'SMOD'.
    wf_smod = wf_smod + 1.
    SELECT SINGLE modtext INTO wf_txt
    FROM modsapt
    WHERE sprsl = sy-langu
    AND name = wa_tadir-obj_name.
    FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
    WHEN 'SXSD'.
    u2022     For BADis
    wf_badi = wf_badi + 1 .
    SELECT SINGLE text INTO wf_txt
    FROM sxs_attrt
    WHERE sprsl = sy-langu
    AND exit_name = wa_tadir-obj_name.
    FORMAT COLOR COL_NORMAL INTENSIFIED ON.
    ENDCASE.
    WRITE:/1 sy-vline,
    2 wa_tadir-obj_name HOTSPOT ON,
    41 sy-vline ,
    42 wf_txt,
    105 sy-vline.
    AT END OF object.
    WRITE : /(105) sy-uline.
    ENDAT.
    ENDLOOP.
    WRITE:/(105) sy-uline.
    SKIP.
    FORMAT COLOR COL_TOTAL INTENSIFIED ON.
    WRITE:/ 'No.of Exits:' , wf_smod.
    WRITE:/ 'No.of BADis:' , wf_badi.
    ELSE.
    FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
    WRITE:/(105) 'No userexits or BADis exist'.
    ENDIF.
    ELSE.
    FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
    WRITE:/(105) 'Transaction does not exist'.
    ENDIF.
    AT LINE-SELECTION.
    DATA : wf_object TYPE tadir-object.
    CLEAR wf_object.
    GET CURSOR FIELD field1.
    CHECK field1(8) EQ 'WA_TADIR'.
    READ TABLE jtab WITH KEY obj_name = sy-lisel+1(20).
    MOVE jtab-object TO wf_object.
    CASE wf_object.
    WHEN 'SMOD'.
    SET PARAMETER ID 'MON' FIELD sy-lisel+1(10).
    CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
    WHEN 'SXSD'.
    SET PARAMETER ID 'EXN' FIELD sy-lisel+1(20).
    CALL TRANSACTION 'SE18' AND SKIP FIRST SCREEN.
    ENDCASE.
    Thanks
    Sarada

  • How can i find the exact BADI For a Particular Transaction

    hi ppl,
    How can i find the exact BADI For a Particular Transaction. Is there any Standard transaction or Programs to do this or suggest some other way.

    Use this code:
    *& Report  ZGET_BADI
    REPORT  ZGET_BADI.
    TABLES : TSTC,
    TADIR,
    MODSAPT,
    MODACT,
    TRDIR,
    TFDIR,
    ENLFDIR,
    SXS_ATTRT ,
    TSTCT.
    DATA : JTAB LIKE TADIR OCCURS 0 WITH HEADER LINE.
    DATA : FIELD1(30).
    DATA : V_DEVCLASS LIKE TADIR-DEVCLASS.
    PARAMETERS : P_TCODE LIKE TSTC-TCODE,
    P_PGMNA LIKE TSTC-PGMNA .
    DATA wa_tadir type tadir.
    START-OF-SELECTION.
    IF NOT P_TCODE IS INITIAL.
    SELECT SINGLE * FROM TSTC WHERE TCODE EQ P_TCODE.
    ELSEIF NOT P_PGMNA IS INITIAL.
    TSTC-PGMNA = P_PGMNA.
    ENDIF.
    IF SY-SUBRC EQ 0.
    SELECT SINGLE * FROM TADIR
    WHERE PGMID = 'R3TR'
    AND OBJECT = 'PROG'
    AND OBJ_NAME = TSTC-PGMNA.
    MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
    IF SY-SUBRC NE 0.
    SELECT SINGLE * FROM TRDIR
    WHERE NAME = TSTC-PGMNA.
    IF TRDIR-SUBC EQ 'F'.
    SELECT SINGLE * FROM TFDIR
    WHERE PNAME = TSTC-PGMNA.
    SELECT SINGLE * FROM ENLFDIR
    WHERE FUNCNAME = TFDIR-FUNCNAME.
    SELECT SINGLE * FROM TADIR
    WHERE PGMID = 'R3TR'
    AND OBJECT = 'FUGR'
    AND OBJ_NAME EQ ENLFDIR-AREA.
    MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
    ENDIF.
    ENDIF.
    SELECT * FROM TADIR INTO TABLE JTAB
    WHERE PGMID = 'R3TR'
    AND OBJECT in ('SMOD', 'SXSD')
    AND DEVCLASS = V_DEVCLASS.
    SELECT SINGLE * FROM TSTCT
    WHERE SPRSL EQ SY-LANGU
    AND TCODE EQ P_TCODE.
    FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
    WRITE:/(19) 'Transaction Code - ',
    20(20) P_TCODE,
    45(50) TSTCT-TTEXT.
    SKIP.
    IF NOT JTAB[] IS INITIAL.
    WRITE:/(105) SY-ULINE.
    FORMAT COLOR COL_HEADING INTENSIFIED ON.
    *Sorting the internal Table
    sort jtab by OBJECT.
    data : wf_txt(60) type c,
    wf_smod type i ,
    wf_badi type i ,
    wf_object2(30) type C.
    clear : wf_smod, wf_badi , wf_object2.
    *Get the total SMOD.
    LOOP AT JTAB into wa_tadir.
    at first.
    FORMAT COLOR COL_HEADING INTENSIFIED ON.
    WRITE:/1 SY-VLINE,
    2 'Enhancement/ Business Add-in',
    41 SY-VLINE ,
    42 'Description',
    105 SY-VLINE.
    WRITE:/(105) SY-ULINE.
    endat.
    clear wf_txt.
    at new object.
    if wa_tadir-object = 'SMOD'.
    wf_object2 = 'Enhancement' .
    elseif wa_tadir-object = 'SXSD'.
    wf_object2 = ' Business Add-in'.
    endif.
    FORMAT COLOR COL_GROUP INTENSIFIED ON.
    WRITE:/1 SY-VLINE,
    2 wf_object2,
    105 SY-VLINE.
    endat.
    case wa_tadir-object.
    when 'SMOD'.
    wf_smod = wf_smod + 1.
    SELECT SINGLE MODTEXT into wf_txt
    FROM MODSAPT
    WHERE SPRSL = SY-LANGU
    AND NAME = wa_tadir-OBJ_NAME.
    FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
    when 'SXSD'.
    *For BADis
    wf_badi = wf_badi + 1 .
    select single TEXT into wf_txt
    from SXS_ATTRT
    where sprsl = sy-langu
    and EXIT_NAME = wa_tadir-OBJ_NAME.
    FORMAT COLOR COL_NORMAL INTENSIFIED ON.
    endcase.
    WRITE:/1 SY-VLINE,
    2 wa_tadir-OBJ_NAME hotspot on,
    41 SY-VLINE ,
    42 wf_txt,
    105 SY-VLINE.
    AT END OF object.
    write : /(105) sy-ULINE.
    ENDAT.
    ENDLOOP.
    WRITE:/(105) SY-ULINE.
    SKIP.
    FORMAT COLOR COL_TOTAL INTENSIFIED ON.
    WRITE:/ 'No.of Exits:' , wf_smod.
    WRITE:/ 'No.of BADis:' , wf_badi.
    ELSE.
    FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
    WRITE:/(105) 'No userexits or BADis exist'.
    ENDIF.
    ELSE.
    FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
    WRITE:/(105) 'Transaction does not exist'.
    ENDIF.
    AT LINE-SELECTION.
    data : wf_object type tadir-object.
    clear wf_object.
    GET CURSOR FIELD FIELD1.
    CHECK FIELD1(8) EQ 'WA_TADIR'.
    read table jtab with key obj_name = sy-lisel+1(20).
    move jtab-object to wf_object.
    case wf_object.
    when 'SMOD'.
    SET PARAMETER ID 'MON' FIELD SY-LISEL+1(10).
    CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
    when 'SXSD'.
    SET PARAMETER ID 'EXN' FIELD SY-LISEL+1(20).
    CALL TRANSACTION 'SE18' AND SKIP FIRST SCREEN.
    endcase.
    Regards
    Vinayak

  • How can i pass the Input value to the sql file in the korn shell ??

    Hi,
    How can i pass the Input value to the sql file in the korn shell ??
    I have to pass the 4 different values to the sql file and each time i pass the value it has to generate the txt file for that value like wise it has to generate the 4 files at each run.
    can any one help me out.
    Raja

    Can you please more elaberate., perhaps you should more elaberate.
    sqlplus is a program. you start it from the korn shell. when it's finished, processing control returns to the korn shell. the korn shell and sqlplus do not communicate back and forth.
    so "spool the output from .sql file to some txt file from k shell, while passing the input parameters to the sql file from korn shell" makes no sense.

  • How can I pass the photos from one iphone to another?

    how can I pass the photos from one iphone to another?

    Use the Beaming feature. See the info at the ? In iPhoto for iOS.

  • How can we pass the select-option value to modulepool program?

    hi,
      how can we pass the select-option value to modulepool program ?
      Because if i declared select-options in executable program and i used SSCRFIELDS to define push buttons in selection screen.
               My requirement if enter the values to select-options and press UPDATE pussbotton then i want call screen which contains tablecontrol.
               How i get select-option values to PAI of call screen for getting the data from database table to my internal table?

    Oh I thought that you have selection-screen and again you are working on dialog programming.
    if you want to use select-option directly in module pool then it is not possible.
    but you can do other way.
    create two varaiables
    data : v_kun_low like kna1-kunnr,
             v_kun_high like kna1-kunnr.
    use these two variables in layout ,let user knows that he can not give options like gt,lt,eq ,it will be always BT.
    and also when you see normal report program,you can use multiple values in either low or high,but here it is not possibel.
    use can enter only low value and high value.
    when you come to program point of view
    declare one range
    ranges r_kunnr for kna1-kunnr.
    do the coding like
    r_kunnr-low = v_kun_low.
    r_kunnr-high = v_kun_high.
    r_kunnr-options = 'BT'.
    r_kunnr-sign = 'I'.
    append r_kunnr.
    now you can use r_kunnr in select query ,it will work like select-option.
    other than this there is no option.
    Thanks
    Seshu

  • How can I pass the value to another frame?

    Hi all,
    The following is part of my coding of a frame. Once i click on the jButton2, the selected value will be stored into a variable named NAME and the value will be displayed by a label in same frame. At the same time, a new frame named TESTING3 will be set to visible.
    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt)
    // TODO add your handling code here:
        String name = (String)jList1.getSelectedValue();
        jLabel1.setText(name);       //display the value in a label in same frame
        new testing3().setVisible(true);     //a new frame set to visible
    }      Question: How can I pass the value to TESTING3 frame and display it on that frame?
    Thanks,
    ning.

    just make an archive that save that variable and them get them from de clase were you save it
    public class sav {
    String n;
    public sav {
    n="";
    public void addn(String x){
    n=x;
    public String shown(){
    return n;
    and them save it from the frame
    sav sun = new sav();
    sav.addn(f);
    them call it from the other frame
    sav sin = new sav();
    String s = sin.shown();
    label.setText(s);
    and i think thats you want to do if its not please explain me better
    bye

  • How can i pass the value one from to another form?

    hi all
    how can i pass the value one from to another form  with out use it when ever i want to needed this value that ican useit?
    like i have two fields U_test1 and U_test2  table name @AUSR
    that i have  four form  A! , A2,A3,A4    please tell me in details....?

    Hi,
    U can assign the values to some variables and access then in ur required forms.
    Vasu Natari.

  • How to find out the exact culpirit session

    How to find out the exact culpirit client machine process to kill the session and release.
    Thanks,

    We can not directly solve this mystery, only you can do so.
    V$SESSION contains data for all connected sessions.
    If no unique combination of fields exists that allows you to identify the culprit client session, then you are out of luck.
    See you started this thread with the premise that 1 session connected to the DB is a problem.
    OK, we will accept this as being true.
    Now via SQL how/what can you SELECT so that only 1 row is returned & that row corresponds to "problem client" session?
    Since this is YOUR system & not ours, only you can solve this mystery.

  • How can we pass the entire rows of a table to a web service in a VC model ?

    Hi,
    On the click of the submit button, I have to pass the rows of two tables into an enterprise service. This service also takes other fields of a form as an input.
    How can we pass the entire rows of a table into a service ?
    Regards,
    Nitin

    Hi Nitin,
    It seems that you have two or three different structures to pass data using your webservice. In your main question, two tables, you can join both in one table and from there call the webservice. In order to pass the entire table you need:
    1. Draw a line between your joinned table and your service,
    2. Map the fields,
    3. Create a 'SUBMIT' in your table tool bar. Right click on your table and choose 'Create Toobar', '+', name and choose 'Submit' as your event.
    4. Go to Configure Element (Table View) 'Multiple' at Selection Mode.
    Reward points if helps you to solve your question.
    Regards,
    Gilson Teixeira

  • How can we pass the master report value in to detail  report

    Hi All,
    My question is how can I pass the master report value in to detail (Child) report filter?
    I mean I have one master report if I click on employee name then I have to pass the employee id in to details report filter. Then detail report will display data for that particular employee.
    How can I achieve this one in OBIEE?
    Please help me to resolve this issue. Thanks in advance for your time and support.

    In that case, you should look at using Go Url. In your column formula for the employee name, create a hyperlink to the detail report and pass the employee id.
    Take a look at this post: Re: Dyanmic display of the Image Link URL
    Thanks!

  • How do I pass the credit card section if I do not have a issue number on my maestro

    How do I pass the credit card section without having a issue number

    I am not sure how you can remove your payment details on your iPhone but you can remove this in iTunes on your computer.
    Also, you should have set iTunes to ask for a your password before any download - no password = no download and you will not go bankrupt!

  • Cf10 how do I pass the selected value in cfselect to another .cfm page

    I am new with CF. I am using CF 10 on WIN XP. I am pulling a distinct list of data and want the user to select one to open a new page (detail.cfm) and pass that value to the next page to be used for other queries.
    can it be done?
    Here is my code for cfselect .
    What am I missing
    <cfform name = "Form" action="detail.cfm"
             <cfselect name="trip"
                        query="gettri"
                     value="district_name"
                     required="yes"
                     multiple="yes"
                    size="1">
        </cfselect>
    <br> <input type="Submit" value="Submit">
    </cfform>
    Thank you for your time
    Rob

    I missed it when I typed it in my original question
    The > bracket is in my code.
    I justed checked.
    It should read  ~ "detail.cfm">
    The list works when I excute the page.
    How do I pass the value after I have selected it on the page?
    Thank you

  • How can i pass the name of the file polled by the file adapter to next step

    Hi XI guru's ,
    How can i pass the name of the file polled by the file adapter to next step in a BPM..?
    regards,

    Use Adapter-Specific Message Attributes and map that value in udf to the BPM message.
    Also see this
    /people/michal.krawczyk2/blog/2005/06/11/xi-how-to-retrieve-messageid-from-a-bpm
    Regards,
    Prateek

Maybe you are looking for

  • Mailing .pdf attachments to Presto Printer doesn't work with Firefox but does with IE, how can I fix this?

    Since upgrading to 4.0.1 the email address [email protected] indicates that there is something wrong with any attachment in .pdf format. This happens when I send mail from my yahoo or aol mail accounts when using Mozilla. It does not occur if I'm usi

  • No browser after new 10.2.1 update

    Just updated yesterday to release 10.2.1.537 OS version 10.2.1.1925 build id 648923 on a Z10 STL100-3 Since the update i cannot connect to anything using the browser. It tries to open but all i get is a black screen. Any ideas?

  • Excise vendor invoice

    Hi Experts,            Using movement type 122 in MIGO returned all quanity to vendor. For returned delivery document i am capturing excise invoice because to cancel the posted excise invoice. I am getting this error. PLA-AT2 amount 24.03.2009 is gre

  • Using two domains with iWeb

    I use a domain from GoDaddy.com to post my iWeb pages but I produced a new iWeb site that I want to post to another domain (one which I've already purchased at GoDaddy). It appears though that mobile me only allows one domain. Question: How can I pos

  • JDBC Troubles..

    JDK Version "1.2.2" on Solaris Oracle Version 8.1.5 What type/version of Oracle JDBC driver should I use to connect to the database from the server. [The code runs in the server itself]