473,396 Members | 1,893 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

oracle function call problem .....

dmjpro
2,476 2GB
i have a function which returns boolean ....

how will i write .... registerOutParameter of CallableStatement
as there is no Types.BOOLEAN .... plz help me out .....thanxxx
Mar 13 '07 #1
4 2202
dmjpro
2,476 2GB
here this is what i want ....

look at the code carefully .....

import java.sql.*;

class JDBCTEST
{
public static void main(String args[]) throws Exception
{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection l_con = DriverManager.getConnection("jdbc:oracle:thin:@172 .20.0.207:1522:BCCLPROD","pis","p0i0s4");
CallableStatement csmt = l_con.prepareCall("{?=call sfn_pis_holiday_checking(?,?)}");
csmt.registerOutParameter(1,Types.BIT);
csmt.setInt(2,2007);
csmt.setDate(3,new java.sql.Date(100000));
csmt.execute();
}
}
and the oracle function code is .....

function sfn_pis_holiday_checking
(p_calendar_year IN number,p_calendar_date In DATE)
return boolean
AS
l_count number:=0;
begin
l_count := 0;
begin
select count(a.CALENDAR_DATE) into l_count
from T_PIS_HOLIDAY_CALENDAR_DTL a,
T_PIS_HOLIDAY_CALENDAR_HDR b
where a.CALENDAR_ID = b.CALENDAR_ID
and b.CALENDAR_YEAR = p_calendar_year
and a.holiday_type='N'
and trunc(a.CALENDAR_DATE) = trunc(p_calendar_date);
exception
when others
then
l_count := 0;
end;
IF l_count <> 0
THEN
return TRUE;
ELSE
return FALSE ;
END IF;
end;
now i get an error ...


PLS-00382: expression is of wrong type
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
void oracle.jdbc.driver.OracleStatement.doExecuteWithTi meout()
int oracle.jdbc.driver.OraclePreparedStatement.execute Update()
boolean oracle.jdbc.driver.OraclePreparedStatement.execute ()
void AnnTest1.main(java.lang.String[])
Exception in thread main
why this happens ... plz help me out .... thanxxxxx
Mar 13 '07 #2
r035198x
13,262 8TB
i have a function which returns boolean ....

how will i write .... registerOutParameter of CallableStatement
as there is no Types.BOOLEAN .... plz help me out .....thanxxx
Can you be more specific dj? What are you trying to do now?
Mar 13 '07 #3
dmjpro
2,476 2GB
if my function returns boolean type then what should i do code in JDBC-2.0

CallableStatement.registerOutParameter(col_num,Typ es.what)


plz help me out ......
Mar 13 '07 #4
dmjpro
2,476 2GB
plz help me out ... it's urgent .....

thanxxx
Mar 15 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Roger Redford | last post by:
Dear Experts, I'm attempting to marry a system to an Oracle 817 datbase. Oracle is my specialty, the back end mainly, so I don't know much about java or javascript. The system uses javascript...
11
by: Rosco | last post by:
Does anyone have a good URL or info whre Oracle and Access are compared to one another in performance, security, cost etc. Before you jump on me I know Oracle is a Cadillac compared to Access the...
9
by: mcbill20 | last post by:
Hello all. I just installed Oracle 10g developer tools on a machine running XP Pro and Office XP. Before this I had just the Oracle 9 client installed. I the previous configuration, I was able to...
0
by: totierne | last post by:
comp.databases.ms-access, I want to know how to use Oracle views with session variables in Access. The parameterised views in access, are migrated to views with per session variables. The...
12
by: Newbie | last post by:
how can i call an oracle function to get data without using a select statement or stored procedures? given a project_no, i need to call the function: ops$sqltime.pa_new_job_no_fn which will...
0
by: Parveen | last post by:
I'm using VB.NET as a front-end for an application that uses an Oracle database. At one point in my code I insert a record into a table in my Oracle database. I then call a function in another...
2
by: John | last post by:
My application needs to call Oracle function using oracle client 9.2. The oracle function returns boolean value from its returned parameter. The name space that I used is system.data.oracleclient....
3
by: Steve Kershaw | last post by:
I'm not even sure this can be done. I have a requirement to call an Oracle function (that returns a value) from C# code. The Oracle function is as follows: FUNCTION get_rec_final_qtr_count (...
2
dmjpro
by: dmjpro | last post by:
this is my funciton block in oracle ....... Function PIM_TEST ( param1 IN DATE DEFAULT SYSDATE, param2 IN OUT DATE) RETURN DATE IS -- -- To modify this template, edit file...
8
by: colmkav | last post by:
Can someone tell me how I can access the return value of a function called from Oracle as opposed to a store proc from oracle? my oracle function is get_num_dates_varposfile. I am only used to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.