Hi All,
I am invoking a procedure which takes 2 IN parameters and both are dates which are passed as string.In the procedure I am using those 2 IN parameters to query the db and fetch record between those two dates.
In java I m doin something like:- - String s_dt= "14/03/2006 09:30:30";
-
String e_dt= "15/04/2008 09:30:30";
-
String query = "begin ? := pkg.temp_proc(?, ?); end;";
-
CallableStatement proc = con.prepareCall(query);
-
proc.setString(1, s_dt);
-
proc.setString(2, e_dt);
In the procedure I m doing this :- - CREATE OR REPLACE PACKAGE BODY pkg
-
AS
-
Procedure temp_proc
-
(pv_startdate_in IN VARCHAR2,
-
pv_enddate_in IN VARCHAR2)
-
as
-
Begin
-
-
select * from table_temp where col_one between to_date(pv_startdate_in,'DD/MM/YYYY HH24:MI:SS') AND to_date(pv_enddate_in,'DD/MM/YYYY HH24:MI:SS')
-
-
end;
-
end pkg;
When I run my java code I get the following error message:- ORA-01830: date format picture ends before converting entire input string
I have gone mad trying to figure out why it is throwing this error.
Any help would be highly appreciated.
Thanks in advance,
Hussain
3 1603
Hi All,
I am invoking a procedure which takes 2 IN parameters and both are dates which are passed as string.In the procedure I am using those 2 IN parameters to query the db and fetch record between those two dates.
In java I m doin something like:- - String s_dt= "14/03/2006 09:30:30";
-
String e_dt= "15/04/2008 09:30:30";
-
String query = "begin ? := pkg.temp_proc(?, ?); end;";
-
CallableStatement proc = con.prepareCall(query);
-
proc.setString(1, s_dt);
-
proc.setString(2, e_dt);
In the procedure I m doing this :- - CREATE OR REPLACE PACKAGE BODY pkg
-
AS
-
Procedure temp_proc
-
(pv_startdate_in IN VARCHAR2,
-
pv_enddate_in IN VARCHAR2)
-
as
-
Begin
-
-
select * from table_temp where col_one between to_date(pv_startdate_in,'DD/MM/YYYY HH24:MI:SS') AND to_date(pv_enddate_in,'DD/MM/YYYY HH24:MI:SS')
-
-
end;
-
end pkg;
When I run my java code I get the following error message:- ORA-01830: date format picture ends before converting entire input string
I have gone mad trying to figure out why it is throwing this error.
Any help would be highly appreciated.
Thanks in advance,
Hussain
Run this statement before running your code: -
-
ALTER SESSION SET nls_Date_format = 'DD/MM/YYYY HH24:MI:SS'
-
/
-
Hi,
I guess, Your Proc returns some data and it is the first parameter..
second and third would be your Date parameters.. -
String query = "begin ? := pkg.temp_proc(?, ?); end;";
-
CallableStatement proc = con.prepareCall(query);
-
proc.setString(2, s_dt);
-
proc.setString(3, e_dt);
-
Regards
Veena
Hi All,
I am invoking a procedure which takes 2 IN parameters and both are dates which are passed as string.In the procedure I am using those 2 IN parameters to query the db and fetch record between those two dates.
In java I m doin something like:- - String s_dt= "14/03/2006 09:30:30";
-
String e_dt= "15/04/2008 09:30:30";
-
String query = "begin ? := pkg.temp_proc(?, ?); end;";
-
CallableStatement proc = con.prepareCall(query);
-
proc.setString(1, s_dt);
-
proc.setString(2, e_dt);
In the procedure I m doing this :- - CREATE OR REPLACE PACKAGE BODY pkg
-
AS
-
Procedure temp_proc
-
(pv_startdate_in IN VARCHAR2,
-
pv_enddate_in IN VARCHAR2)
-
as
-
Begin
-
-
select * from table_temp where col_one between to_date(pv_startdate_in,'DD/MM/YYYY HH24:MI:SS') AND to_date(pv_enddate_in,'DD/MM/YYYY HH24:MI:SS')
-
-
end;
-
end pkg;
When I run my java code I get the following error message:- ORA-01830: date format picture ends before converting entire input string
I have gone mad trying to figure out why it is throwing this error.
Any help would be highly appreciated.
Thanks in advance,
Hussain
try to put cast or convert functions
i think it will help u..
Sign in to post your reply or Sign up for a free account.
Similar topics
by: chandan |
last post by:
hi,
I have a insert trigger on a table. I want commit to happen after
insert before invoking the trigger. So that if a quey is made before
the completion of the trigger.Modified Data should be...
|
by: steingold |
last post by:
Hi All.
Is it possible to define an external stored procedure to be executed
not with the executing user privileges, but instead with the user who
created the stored procedure privileges in db2...
|
by: pinney.colton |
last post by:
I would like to create a stored procedure which creates a temp table to
store some XML. The # of fields of XML is dependent upon the contents
of another table in the application, so the first part...
|
by: balaji krishna |
last post by:
Hi, I need to handle the return set from COBOL stored procedure from my invoking Java program. I do not know, how many rows the stored proc SQL fetches.I have declared the cursor in that proc, but i...
|
by: prasadbodas2000 |
last post by:
Hi,
I need a sample code in ASP or VB wherein ADO command object is used to invoke oracle stored procedure. The stored procedure (SP) should have oracle specific custom data types (CDT) as...
|
by: phanikumarparimi |
last post by:
Hi all ,
I need to write a stored procedure which will be called when an after insert trigger fires.The Parameters for the SP called would be transition tables.Can anyone help me out in how...
|
by: hussain123 |
last post by:
Hi All,
I am invoking a procedure which takes 2 IN parameters and both are dates which are passed as string.In the procedure I am using those 2 IN parameters to query the db and fetch record between...
|
by: Vish4u |
last post by:
Hello Everyone,
I have a encountered a strange issue with the execution of my stored procedure on clients machine.
My stored procedure contains a cursor in which there is a select statement...
|
by: eeriehunk |
last post by:
Hi All,
I wrote a procedure to clear all my text fields and disable all buttons in my form. And I call this procedure in a button (insert button). when I presses the insert button, after all my...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |