How to accept date parameter from java if SP have the datatype as DATE

Dear Gurus,
I have written SP as below
CREATE OR REPLACE PROCEDURE proc1
No NUMBER,
StartDate DATE,
EndDate DATE
AS
BEGIN
DBMS_OUTPUT.PUT_LINE('Start Date ='||to_char(StartDate,'YYYY-MM-DD HH24:MI:SS'));
DBMS_OUTPUT.PUT_LINE('Start Date ='||to_char(EndDate,'YYYY-MM-DD HH24:MI:SS'));
END;
If I want to pass date from java code to above SP. Then how to send Date to SP from Java code.
Means if I print that date in SP then it should be print as it is what i sent from java.
e.g. Start Date = 2008-02-01 00:00:00
End Date = 2008-02-01 23:59:59
Could any one help me in above issue.
Regards
Sanjeev Atvankar

Yes, because there is no default date format in oracle for date value having time part.
Suppose your agreed date format between java and pl/sql is DDMMYYYYHH24MISS.
You create procedure as:
CREATE OR REPLACE PROCEDURE proc1
No NUMBER,
StartDate VARCHAR2,
EndDate VARCHAR2,
AS
  v_start_date date := to_date(startdate,'DDMMYYYYHH24MISS');
  v_end_date date := to_date(enddate,'DDMMYYYYHH24MISS');
BEGIN
/* YOU can use local pl/sql date variables inside your plsql code*/
DBMS_OUTPUT.PUT_LINE('Start Date ='||to_char(StartDate,'YYYY-MM-DD HH24:MI:SS'));
DBMS_OUTPUT.PUT_LINE('Start Date ='||to_char(EndDate,'YYYY-MM-DD HH24:MI:SS'));
END;
/

Similar Messages

  • How do i delete apps from my ipod that have the icloud icon

    I have apps that i use to have on my ipod,but now i dont want them anymore what can i do to get them off. right now it has the icloud icon

    Touch and hold the app until all the apps start to wiggle. Then tap the circled minus sign by the aps yo want to delete.
    Apps that came with the iPod/iOS can't be deleted. You can set a Restrictions which prevents deleting apps.
    You can redownload apps by:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store
    I do not know where you are looking when you say the iCloud icon.

  • How to change a date value from "java.util.Date" to "java.sql.Date"?

    Hi all,
    How to change a date value from "java.util.Date" to "java.sql.Date"?
    I m still confusing what's the difference between them.....
    thanks
    Regards,
    Kin

    Thanks
    but my sql statement can only accept the format (yyyy-MM-dd)
    such as "select * from xx where somedate = '2004-12-31'
    but when i show it to screen, i want to show it as dd-MM-yyyy
    I m using the following to change the jave.util.Date to str and vice versa. But it cannot shows the dd-MM-yyyy. I tried to change the format from yyyy-MM-dd to dd-MM-yyyy, it shows the wrong date in my application.
         public String date2str(java.util.Date thisdate)     {
              if (thisdate != null)     {
                   java.sql.Date thissDate = new java.sql.Date(thisdate.getTime());
                   return date2str(thissDate);
              }     else     {
                   return "";
         public String date2str(java.sql.Date thisdate)     {
              if (thisdate != null)     {
                   SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                   return sdf.format(thisdate);
              }     else     {
                   return "";
         public java.util.Date str2date(String thisdate)     {
              String dateFormat = "yyyy-MM-dd"; // = 1998-12-31
              java.util.Date returndate = null;
              if (thisdate != null)     {
                   SimpleDateFormat dateFormatter = new SimpleDateFormat(dateFormat);
                   try {
                        returndate = dateFormatter.parse(thisdate);
                   } catch (ParseException pe) {
                        System.out.println (pe.getMessage());
              return returndate;
         }

  • How to pass a date parameter from report builder query designer to oracle database

    i'm using report builder 3.0 connected to oracle database. i'm trying to pass a date parameter in the query with no success, i don't
    know the exact syntax. I've tried :
    SELECT * FROM igeneral.GCL_CLAIMS where CREATED_BY IN (:CREATED_BY) AND CLAIM_YEAR IN(:UW_YEAR) AND (LOSS_DATE) >To_Date('01/01/2014','mm/dd/yyyy')
    it worked perfectly.
    However if i try to put a date parameter "From" instead of 01/01/2014 it will not work, a Define Query Parameter popup window appear and error occurred after i fill
    the values (usually i shouldnt get this popup i should enter the value when i run the report)
    SELECT * FROM igeneral.GCL_CLAIMS where CREATED_BY IN (:CREATED_BY) AND CLAIM_YEAR IN(:UW_YEAR) AND (LOSS_DATE) >To_Date(:From,'mm/dd/yyyy')
    appreciate your assistance

    Hi Gorgo,
    According to your description, you have problem when in passing a parameter for running a Oracle Query. Right?
    Based on my knowledge, it use "&" as synax for parameter in Oracle, like we use "@" in SQL Server. In this scenario, maybe you can try '01/01/2014' when inputing in "From". We are not sure if there's any limitation for To_Date()
    function. For your self-testing, you can try the query in sqlplus/sql delveloper. Since your issue is related to Oracle query, we suggest you post this thread onto Oracle forum.
    Best Regards,
    Simon Hou

  • To get date Parameter from an OAF page

    Hi,
    I want to get a date parameter from an OAF page and pass them to a query in Vo as binding variables.
    How can that be done.
    I tried this to get the date from my page but it gives an error when I pass it to the query-
    String v_date = pageContext.getParameter("StartDate");

    My CO --------------------------
    if( pageContext.getParameter("Submit") != null)
    String userid = (new Integer(pageContext.getUserId())).toString();
    String personid = (new Integer(pageContext.getEmployeeId())).toString();
    String v_date = pageContext.getParameter("StartDate")+"";
    String v_end_date = pageContext.getParameter("EndDate")+"";
    System.out.println("call to process request0 : " + userid);
    System.out.println("call to process request0 : " + personid);
    System.out.println("call to process request0 : " + v_date);
    System.out.println("call to process request0 : " + v_end_date);
    Serializable[] params = {personid,v_date,v_end_date};
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    String empUserid = pageContext.getUserName();
    System.out.println(pageContext.getUserName());
    System.out.println("Calling initMoverQuery");
    am.invokeMethod("initMoverQuery", params);
    System.out.println("Call out of initMoverQuery");
    My AM------------------------------------------------------------
    public void initMoverQuery(String pid,String sd,String ed)
    System.out.println("In init Query of AM" +pid);
    EmployeeMoverVOImpl vorep = getEmployeeMoverVO1();
    Number personid = new Number(Integer.parseInt(pid));
    System.out.println("user id"+ personid);
    System.out.println("start date"+ sd);
    System.out.println("end date"+ ed);
    if (vorep == null)
    MessageToken[] tokens = { new MessageToken("OBJECT_NAME", "EmployeeMoverRepVO1")};
    throw new OAException("AK", "FWK_TBX_OBJECT_NOT_FOUND", tokens);
    if (!vorep.isPreparedForExecution())
    // vorep.initQuery(personid,sd1,ed1);
    vorep.setWhereClauseParam(0,personid);
    vorep.setWhereClauseParam(1,sd);
    vorep.setWhereClauseParam(2,ed);
    vorep.executeQuery();
    System.out.println("End SP VO Query");
    }

  • Pass data parameter from URL to Forms

    Hi
    Is it possible to pass a data parameter from asp to Forms?.
    In my asp I have a url to call a form (eg. http://servername:port/forms90/f90servlet/form=testform.fmx). In my testform.fmx I accept 'account no' as a parameter for querying the records. Since I am calling this form from asp, I already have the account no in my asp. I would like to pass this account no to the form automatically.
    Is it possible to pass this data parameter from url to forms?.
    If possible, what changes to be made in the form. Please help.
    sreekumar

    Create a parameter in your form, there's a node for it in the Navigator window. Imagine it is called myParam.
    Pass it on the URL like this:
    http://host/forms90/f90servlet?config=myApp&otherParams=myParam=somevalue
    Regards,
    Robin Zimmermann
    Forms Product Management

  • How to Create adf table from java bean

    Hi,
    How to Create adf table from java class (Not from ADF BC).
    Thanks
    Satya

    @vlsn -- you have to follow what shay said.
    Do the following in Model layer ::
    create a table property java class with your columns setters and getters like :
    *public class gridProps {*
    private int sno;
    private String orderNum;
    *public void setSno(int sno) {*
    this.sno = sno;
    *public int getSno() {*
    return sno;
    *public void setOrderNum(String orderNum) {*
    this.orderNum = orderNum;
    *public String getOrderNum() {*
    return orderNum;
    Create another table java class which will populate the values to your column values and return the collection :
    *public class gridPopulate {*
    private  List<gridProps> gridValues ;
    *public List<gridProps> setToGrid(ArrayList<ArrayList> valuesToSet) {*
    *if (valuesToSet == null) {*
    return gridValues;
    gridValues = new ArrayList<gridProps>();
    if(btnValue.equals("completeBtn"))
    return gridValues;
    for(ArrayList<String> tempArr:valuesToSet)
    gridProps gp = new gridProps();
    gp.setSno(Integer.valueOf(tempArr.get(0)));
    gp.setOrderNum(tempArr.get(1));
    return gridValues;
    Right click gridPopulate class and create this as data control.This class will be seen in Data control list.Under this data control,Drag the grid property collection(created earlier) to your page.Then execute your binding(gridPopulate) according to your logic.
    Thanks.(My jdev version 11.1.1.5.0)

  • How to call gnuplot command from java

    Hi there,
    In our course, we are required to develop an GUI for gnuplot. In case you don't know about gnuplot, it's a plotting program and has lots of command. We want to use java and swing, but now we don't know how to call gnuplot command from java, or how to execute a shell command(script) from java.
    By the way, since we need read in files with several columns of data and allow user to select a column, we want to use JTable. Is that reasonable?
    Thanks a lot for any suggestions!
    Jack

    Hi, there:
    Will using JTable add much overhead? I may have to use several JTables and switch among them. I can add scroll bar to or edit JTables, right?
    BTW, do you have experience about gnuplot? Can I find the command tree of gnuplot somewhere? Or do you know a better place to post question about gnuplot? unix/linux group, maybe.
    Thanks,
    Jack
    P.S. Would you guys answer my question after I use up my duke dollars? :- )

  • Sending Date parameter  from the form to Report

    Dear Friend
    Hi everybody, I am sending the date parameter to my report through a form ,and my date format in the form and in the report as follow : DD/MM/YYYY but when I enter the date as 18/1/2004 the system pass this value as follow : 18-JAN-04 but I want the system to pass my date format as 18/1/2004 not as 18-JAN-04 ,how can I do that
    Best regards
    Jamil

    Ino,
    thanks for your answer.
    You're all rigth abouth the index issue. So I've written my SQL like you say in your post. But i get an error : "ORA-... Non-character found where character expected... " or something like that. I've checked nls_date_format in my client machine and the server (DB 8.1.7.4), and also the regional settings in both machines, and all are set to 'DD-MON-YY'. What can be wrong?
    Thanks again for your time.
    Jaime.

  • Passing date parameter from forms to report

    Hi,
    I'm using forms and reports 6i.
    I want to pass one date parameter from forms to reports.
    Using
    Add_Parameter(pl_id,'P_FROM_DATE',TEXT_PARAMETER,:FROM_DT);
    giving me error REP-0091- Invalid value for parameter 'P_FROM_DATE'
    This i think is because report expects date and here it is converted as varchar.
    Please help

    Hi Divya,
    Even I use this kind of statement
    Add_Parameter(pl_id,'P_FROM_DATE',TEXT_PARAMETER,:FROM_DT);and works fine for me.
    This i think is because report expects date and here it is converted as varchar
    Correct.
    Open the report in the builder and under Data Model -> User Parameters, Go to the Property Inspector of P_FROM_DATE. Under Parameter, set Datatype as Character instead of Date.
    Hope this should work. and tell me if it works(coz it wokred for me).

  • How to pass a parameter from one action1 in block1 to action2 in block2.

    Dear Experts,
    How to pass a parameter from one action1 in block1 to action2 in block2.
    My Process Structure is as follows..
           Process
                Sequential Block
                     Action 1
                     Parallel Dynamic Block
                             Sequential Sub Block
                             Action 2.
    while i am  trying to execute the action1 the following error is shown below:
    Cannot complete action: The activity could not be read.
    Please suggest me how to do?
    Regards,
    Rajesh N

    Hello Rajesh!
    I think you are talk about the mapping parameters of your process.
    This case in design time of your workflow, you have the vision of your blocks and actions, you have on action 1 the output parameter and you have the action 2 an input parameter.
    So you have that make a group mapping on your process, map in this group the action1 outpu parameter with the action2 input parameter.
    Regards, Ronaldo Rampelotti

  • How can I pass parameter from report to form?

    Hi :)
    Now I try to build conference room like this by using form
    and report. And i design that when users click at group report
    then i'll show page that contain questions report and add
    question form. And question form and report must receive the
    same parameter from group report.
    First Problem: is I don't know how group report send the
    same parameter to question report and add question report at the
    same time. And is it possible??? If not please suggest me what
    should I do???
    Second Problem: is I don't know how can I pass parameter from
    report to form. I don't know the way to do it.
    Please tell me!!! Please...
    I look forward to hearing from all of you.
    Thank You.

    One way is to create a link based on that form and attach that
    link with the report. Through links you can pass parameters

  • How to transfer range parameter from vb when using bapi calling

    Hi,everyone.how to transfer range parameter from vb when using BAPI calling?

    Did you get the solution to your problem?  Can you please share it with me. I have a similar problem. I have a VB program that calls RFC function. It works with a single parameter but not with a range of parameters. If you have the solution, could you please share sample codes with me? Thank you so much.

  • How to execute Linux command from Java app.

    Hi all,
    Could anyone show me how to execute Linux command from Java app. For example, I have the need to execute the "ls" command from my Java app (which is running on the Linux machine), how should I write the codes?
    Thanks a lot,

    You can use "built-in" shell commands, you just need to invoke the shell and tell it to run the command. See the -c switch in the man page for your shell. But, "ls" isn't built-in anyays.
    If you use exec, you will want to set the directory with the dir argument to exec, or add it to the command or cmdarray. See the API for the variants of java.lang.Runtime.exec(). (If you're invoking it repeatedly, you can most likely modify a cmdarray more efficiently than having exec() decompose your command).
    You will also definitely want to save the returned Process and read the output from it (possibly stderr too and get an exit status). See API for java.lang.Process. Here's an example
    java.io.BufferedReader br =
    new java.io.BufferedReader(new java.io.InputStreamReader(
    Runtime.getRuntime().exec ("/sbin/ifconfig ppp0").
    getInputStream()));
    while ((s = br.readLine()) != null) {...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to invoke BPEL process from JAVA API

    Hi Guys
    Any idea if you can tell me how to invoke BPEL process from JAVA API ?
    What to do in BPEL process manager to achieve that?
    Regards
    Deepak

    See http://download-west.oracle.com/docs/cd/B31017_01/integrate.1013/b28981/invoke.htm#sthref1373 and the JavaDocs http://download-west.oracle.com/docs/cd/B31017_01/integrate.1013/b28986/toc.htm.

Maybe you are looking for

  • How to access a url in file receiver CC with space in the folder name?

    Hi PI 7.11 sp4: In a file receiver channel I would like to send the message to this folder: de-prod.dk\bu\something\something\PTI eventstanden\archive\" But I get this error message: "Target directory 'F:\usr\sap\XP7\DVEBMGS02\j2ee\cluster\server0\"\

  • How to set units when creating paths with a script?

    I'm trying to update a script that used to work in Photoshop CS4 but which seems to completely ignore the units I'm using in Cloud.  The script below should create a path layer with two lines that form an X across the entire document.  To test, I'm c

  • Security as seen in Internet explorer

    Hi, It would be great in seeing another security feature in safari as seen within internet option (internet Explorer) In internet Explorer: Withing Security tab we can set security in following zones: - Internet - Trusted Sites - Restricted site When

  • MACOS and Mail in different languages

    I need to use MACOS and Mail in two different languages (German and English). Until now, I needed to uncheck all language options except for English. After installing 10.6 I cannot find a language option. Where has it gone?

  • Need advice: v5 versus v5.5

    Newbie with less than a month's experience using a free trial of v5.5 for the specific purpose of creating the interior layout and wraparound cover for a trade paperback needs advice on the following; It didn't take long to realize that my objectives