Need to obtain updateable ResultSet via call to PL/SQL function
I'm using JDBC and the Oracle JDBC driver to call a PL/SQL function that returns a SYS_REFCURSOR. I do this via a CallableStatement object and then cast the output parameter to a ResultSet object. However, I want this ResultSet object I end up with to be updateable. The following code throws an exception stating "Invalid operation for read only resultset: updateString ":
cstmt2 = con.prepareCall("{? = call get_upload_entry_for_update(?)}",
ResultSet.TYPE_FORWARD_ONLY,
ResultSet.CONCUR_UPDATABLE);
cstmt2.registerOutParameter(1, OracleTypes.CURSOR);
cstmt2.setInt(2, newUploadId);
cstmt2.execute();
rs = (ResultSet) cstmt2.getObject(1);
rs.next();
rs.updateString("UPLOAD_FILENAME", fileName);
// . . .So even though, I create the CallableStatement such that ResultSets should be updateable, it's not allowing me to do any updates. Also, in case you're wondering, inside the PL/SQL function, the query on which the cursor is based is a select statement which does specify "for update" at the end.
I can get it to work as follows using a Statement object that executes the SELECT statement directly instead of a CallableStatement that executes a PL/SQL function:
Statement stmt = con.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE);
rs = stmt.executeQuery("select UPLOAD_FILENAME, UPLOAD_FILE from rf_upload where upload_id = "+newUploadId+" for update");
rs.next();
rs.updateString("UPLOAD_FILENAME", fileName);
//. . . Although this works, the project I'm working has a goal to encapsulate all SQL into Functions and Stored Procedures so I'd like to get it working that way instead.
So the bottom-line question is: Using the Oracle JDBC driver, how can I call a PL/SQL function in such a way that I can obtain an updateable ResultSet object?
Thanks for any suggestions. I'd be happy to clarify anything that's unclear.
Hmmm...
I'm still scratching my head about this one, just not sure it's doable, but I'll point out something, maybe it will give you a clue...
In your code, you have:
cstmt2 = con.prepareCall("{? = call get_upload_entry_for_update(?)}",
ResultSet.TYPE_FORWARD_ONLY,
ResultSet.CONCUR_UPDATABLE);I don't think the ResultSet parameters do anything towards your goal of getting an updatable result set via the returned cursor, those parameters affect the result set produced if you were to call:
ResultSet rs2 = cstmt2.executeQuery();and not the result set generated by:
rs = (ResultSet) cstmt2.getObject(1);Futhermore, while the "FOR UPDATE" is almost certainly something you want to do, it also doesn't affect the cursor (I think) but merely locks the affected rows in the DB.
You might try calling rs.getType() and rs.getConcurrency() on the ResultSet you get from getObject, though I suspect they'll merely confirm the bad news that the cursor your getting back isn't right...
You also might try the Oracle-specific getCursor call:
rs = ((OracleCallableStatement)cstmt2).getCursor (1)instead of getObject, though I don't think it will help...
I've been curious enough to dig around through most of my handy references and Oracle's docs and MetaLink and come up mostly empty, although almost 5 years ago Oracle Support said:
" Reference Cursors from a pl/sql stored procedure are not updateable in any language."
Similar Messages
-
SQL report region source to call a pl/sql function using DB link
Hi - I have a pl/sql function fn_dbtype(id NUMBER) defined in database X. The pl/sql function executes couple DML statements and returns a string (a SELECT query). I am able to call this function using SQL Plus (Connected to Database X) as below and it works fine:
declare
vSQL VARCHAR2(100);
begin
vSQL := fn_dbtype(1);
end;
The DML operations completed fine and vSQL contains the "Select" query now.
In APEX:
I am trying to create a SQL report in APEX using SQL query(PL/SQL function returning a sql statement) option. I am trying to figure out what to put in the region source so that the output of the "Select" query is displayed in the report.
Moreover APEX is hosted in a different database instance. So I would need to call this pl/sql function using a DB Link.
Please let me know what I need to put in the region source to execute the pl/sql function which returns the "Select" query thereby displaying the query output in the report. Thanks.
Edited by: user709584 on Mar 19, 2009 2:32 PM
Edited by: user709584 on Mar 19, 2009 2:34 PMtry something like this:
return fn_dbtype(1)@dblink; -
Call a pl/sql function froma jsp
I need to call an pl/sql function which basically returns true or false depending on the count. based on the return value I have to alert a message. how can i call the pl/sql fucntion in a jsp?
thanks for ur help.You call the function the same way you would from anywhere, although i don't recommend you call database functions directly from a JSP page as it's bad form.
-
Calling a PL/SQL function from java
I would like to call a pl/sql function from java. My pl/sql function is taking arrays of records as parameters. How do i proceed? Which specific oracle packages do I have to import?
Please send an example.
TIA,
Darko GuberinaDocumentation here: http://download-uk.oracle.com/docs/cd/B14117_01/java.101/b10983/datamap.htm#sthref185
says JPublisher can publish records too.
But when I change the example given at http://download-uk.oracle.com/docs/cd/B14117_01/java.101/b10983/datamap.htm#sthref190 as following:
PACKAGE "COMPANY" AS
type emp_rec is record (empno number, ename varchar2(10));
type emp_list is varray(5) of emp_rec;
type factory is record (
name varchar(10),
emps emp_list
function get_factory(p_name varchar) return factory;
END;
then I see <unknown type or type not found> at sql or java files generated. Any ideas? -
HTTP - Calling a PL/SQL Function
I am wanting to call a PL/SQL Function over the web.
Say if I am using Oracle APEX and my user is the standard "HR".
How would I call a function from PL/SQL made by the user HR called EXAMPLE_FUNCTION.It depends on where you want to call the function. Easiest method would be to create a region based on the PLSQL function.
If you want to do some plsql function after the page is rendered, then you should find out the event for the field such as onchange or onblurr and call
a Javascript. The javascript can cal the plsql function...
Also note that under the database forums there is a forum for Apex and u can see many samples
Rajesh -
Calling a pl/sql function.
Hi,
I couldn't manage to call a pl/sql function that takes some arguments or no arguments.
I couldn't find an example but searching through previous topics / discussions I could write something like this :
ExpressionBuilder expBuilder = new ExpressionBuilder();
Vector args = new Vector();
Vector parameters = new Vector();
// dynamically fill these vectors if there are any arguments to the function
Expression exp = expBuilder.getFunctionWithArguments(functionName, args);
DataReadQuery query = new DataReadQuery();
query.setSelectionCriteria(exp);
Iterator iter = args.iterator();
while (iter.hasNext())
query.addArgument((String)iter.next());
Object obj = getActiveUnitOfWork().executeQuery(query, parameters);
at the end what I get is NullPointerException, probably I'm missing something.
UnitOfWork(17384)--#executeQuery(DataReadQuery())
UnitOfWork(17384)--java.lang.NullPointerExceptionjava.lang.NullPointerException
at oracle.toplink.internal.queryframework.StatementQueryMechanism.setCallFromStatement(Unknown Source)
at oracle.toplink.internal.queryframework.StatementQueryMechanism.prepareExecuteSelect(Unknown Source)
at oracle.toplink.queryframework.DataReadQuery.prepare(Unknown Source)
at oracle.toplink.queryframework.DatabaseQuery.checkPrepare(Unknown Source)
at oracle.toplink.queryframework.DatabaseQuery.execute(Unknown Source)
at oracle.toplink.queryframework.ReadQuery.execute(Unknown Source)
at oracle.toplink.publicinterface.Session.internalExecuteQuery(Unknown Source)
at oracle.toplink.publicinterface.UnitOfWork.internalExecuteQuery(Unknown Source)
at oracle.toplink.publicinterface.Session.executeQuery(Unknown Source)
at oracle.toplink.publicinterface.Session.executeQuery(Unknown Source)
at com.vnu.publitec.axis.toplink.PersistenceProvider.executeStoredProc(PersistenceProvider.java:420)
at com.vnu.publitec.axis.dispatcher.AxisDispatcherLocalImpl.executeStoredProc(AxisDispatcherLocalImpl.java:280)
at com.vnu.publitec.axis.dispatcher.AxisSessionBean.executeStoredProc(AxisSessionBean.java:215)
at AxisSessionBeanRemote_StatefulSessionBeanWrapper0.executeStoredProc(AxisSessionBeanRemote_StatefulSessionBeanWrapper0.java:501)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:119)
at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:48)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
at java.lang.Thread.run(Thread.java:536)You must use SQL with DataReadQuery, you cannot use expressions. Since a single value is returned the ValueReadQuery can be used to filter the result.
Example:
ValueReadQuery query = new ValueReadQuery("Select My_func(#arg1, #arg2) from dual");
query.addArgument("arg1");
query.addArgument("arg2");
Vector arguments = new Vector(2);
arguments.add("1");
arguments.add("2");
Object result = session.executeQuery(query, arguments);
or,
Vector result = session.executeSelectingCall(new SQLCall("select my_func(1, 2) from dual")); -
For each row of a table call a pl/sql function
Hi,
i have a search form in adf like this:
parameter1:___
parameter2:____
buttonSearch
Table with results
field1 field2 field3
row1 ------ --------- -------
row2 ------ --------- -------
row3 ------ --------- -------
The user inputs the parameters 1 and 2 then press buttonSearch and the query execute and returns rows 1 to 3.
What i need is for each row call pl/sql function and passed the parameter 1 and 2 and field 1 to 3 (plsql function recives 5 parameters (parameter1, parameter2, field1 , field2 and field3) )
my buttonSearch call a java class that execute ExecuteWithParamters method.
I create the call to my plsql function on Application module class and then export as a java interface.
So i have the function to use in the viewcontroller layer, but i don't know where to use it, and how to pass the paramters: the parameter 1 and 2 that user inputs and the row fields.....
any ideas....
thanks!!Hi,
for this you need to call the PLSQL function upon table rendering, which means that you need a field in the table referencing a managed bean. In the managed bean you can use #{row} and resolve it using a ValueExpression. #{row} gives you access to the current rendered row (this is why you need to do it when the table renders) and thus allows you to call getAttribute(name) to get the values of field 1 - 3. The search field value you should get through the bindings reference (assuming the search form uses ADF). Then you create an operation binding for the executeWithParameters and call operationBindingName.getParamsMap().put(argname, argvalue); on it.
Frank
Ps.: I am concerned about the performance you get and wonder if it isn't possible to create a transient attribute that executes the function and displays the results. As I understand, the search parameters are only to filter the result set, which you still can do -
Calling a PL/SQL function in the SQL statement
I have a PL/SQL function which i should call in a SQL statement.
Let's say the function is func1(parameter1,parameter2),
it should be called like this :- SELECT func1() FROM mytable ;
Can any one help me out on this ?
---Thanx in advanceyou can call pl/sql functions from pl/sql using
select fn1('param1','param2') from table;
if you dont want to pass paramters, you have to specify default
value while creating function like below
create function fn1(p1 number default null,p2 varchar2 default
null) return...
now you can call using
select fn1 from table; -
How to use sql call a pl/sql function
Hi there,
I have a pl/sql function package as below:
Create or Replace package test10 as
P_DESFORMAT VARCHAR2(10);
DESFORMAT VARCHAR2(10);
function m_tot_u1Formula(m_o_uns number,m_t_uns number,m_v_uns number)return NUMBER ;
function m_tot_res1Formula(m_o_res number,m_t_res number)return NUMBER;
function m_occ_u1Formula(m_o_uns number,m_t_uns number)return NUMBER ;
function m_onrpun1Formula(m_o_uns in number,m_o_res in number)return NUMBER ;
function m_tenpun1Formula(m_t_res in number,m_t_uns in number)return NUMBER ;
function m_occpun1formula(m_occ_u in number, m_tot_res in number) return number ;
function m_vac_rate1formula(m_v_uns in number,m_tot_u in number) return number;
function m_onrpha1Formula(m_o_res in number,m_area in number) return NUMBER;
function m_tenpha1Formula(m_t_res in number,m_area in number)return NUMBER ;
function m_occpha1Formula(m_area in number,m_tot_res in number)return number;
function P_DESFORMATValidTrigger return boolean;
END test10;
CREATE OR REPLACE PACKAGE BODY test10 AS
function m_tot_u1Formula(m_o_uns number,m_t_uns number,m_v_uns number)return NUMBER is
begin
RETURN m_o_uns + m_t_uns + m_v_uns;
end;
function m_tot_res1Formula(m_o_res number,m_t_res number)return NUMBER is
begin
RETURN m_o_res + m_t_res;
end;
function m_occ_u1Formula(m_o_uns number,m_t_uns number)return NUMBER is
begin
RETURN m_o_uns + m_t_uns;
end;
function m_onrpun1Formula(m_o_uns in number,m_o_res in number)return NUMBER is
begin
IF m_o_uns > 0 THEN
RETURN m_o_res / m_o_uns;
ELSE
RETURN NULL;
END IF;
end;
function m_tenpun1Formula(m_t_res in number,m_t_uns in number)return NUMBER is
begin
IF m_t_uns > 0 THEN
RETURN m_t_res/m_t_uns;
ELSE
RETURN NULL;
END IF;
end;
function m_occpun1formula(m_occ_u in number,m_tot_res in number) return number is
begin
IF m_occ_u > 0 THEN
RETURN m_tot_res / m_occ_u;
ELSE
RETURN NULL;
END IF;
end;
function m_vac_rate1formula(m_v_uns in number,m_tot_u in number) return number is
begin
IF m_tot_u > 0 THEN
RETURN 100 * m_v_uns / m_tot_u;
ELSE
RETURN NULL;
END IF;
end;
function m_onrpha1Formula(m_o_res in number,m_area in number) return NUMBER is
begin
IF m_o_res > 0 THEN
RETURN m_o_res / m_area;
ELSE
RETURN NULL;
END IF;
end;
function m_tenpha1Formula(m_t_res in number,m_area in number)return NUMBER is
begin
IF m_t_res > 0 THEN
RETURN m_t_res / m_area;
ELSE
RETURN NULL;
END IF;
end;
function m_occpha1Formula(m_area in number,m_tot_res in number)return number is
begin
IF m_area > 0 THEN
RETURN m_tot_res / m_area;
ELSE
RETURN NULL;
END IF;
end;
function P_DESFORMATValidTrigger return boolean is
begin
DESFORMAT := P_DESFORMAT;
return (TRUE);
end;
END test10 ;
the package is compiled successfully.
And my sql statement will call those function in this package such as:
select test10.m_tot_u1Formula(m_o_uns ,m_t_uns ,m_v_uns) m_tot_u,
test10.m_tot_res1Formula(m_o_res,m_t_res)m_tot_res,
test.m_occ_u1Formula(m_o_uns ,m_t_uns)m_occ_u,
test10.m_onrpun1Formula(m_o_uns ,m_o_res )m_onrpun,
test10.m_tenpun1Formula(m_t_res ,m_t_uns )m_tenpun,
test10.m_occpun1formula(:m_occ_u , :m_tot_res )m_occpun,
test10.m_vac_rate1formula(m_v_uns ,m_tot_u ) m_vac_rate,
test10.m_onrpha1Formula(m_o_res ,m_area ) m_onrpha,
test10.m_tenpha1Formula(m_t_res ,m_area ) m_tenpha,
test.m_occpha1Formula(m_area , :m_tot_res ) m_occpha
from ..... where.....
Is it right to call those functions? Thanks in advance.
AppcatI spoke too soon on the impracticality of a function-based index on a view. My recollection was that the CBO wasn't smart enough to recognize that a FBI on an expression like (col1*col2) could be used to resolve queries that involved a simple transform (i.e. col2*col1), which tended to force you to have a user-defined function behind the FBI to make sure that someone cleaning up code didn't accidentally make the index unusable. Now that I've actually tested it, my recollection, at least on 10.2, is clearly incorrect.
There's certainly a matter of personal taste here. If I knew what these variables were intended to represent, I'd have no problem maintaining either syntax because it should be relatively obvious whether either piece of code is suspect. I do have to confess that I had to look up the syntax for the NULLIF function yesterday in order to reply to this thread-- my wager is that if I had to look it up, a good fraction of the PL/SQL programmers out there would have had to look it up as well and might not immediately recognize this as an inverted division by 0 test.
From a maintenance standpoint, I would personally rather have the package where I can zoom in on the particular function I'm interested in, rather than looking at a view that may be doing a dozen rather similar calculations. I'm a bit more confident that I (or some new maintenance programmer on my team) could change the logic in the function without inadvertently screwing up any of the other functions in the package than I would be that I (or they) would accidentally screw up the view. Clearly, robust test scripts and an automated test suite would help tremendously in either case, and neither change should be too difficult, but my experience is that the package is the easier construct to modify or add to. I certainly believe that other people/ organizations would have different experiences and other people might prefer the view approach. I certainly wouldn't oppose a view-based approach, just as I wouldn't oppose a package.
There's also still the matter of having a table with every valid input if a view is to be practical. It's certainly possible that such a table exists, but it seems equally possible that there are either many such tables, that these functions are doing calculations on values that aren't stored in tables, etc., in which case a package would be the better solution.
Justin -
Calling a pl/sql function from oracle forms
I have written a pl/sql function in a package.
package name- sup
function name - func
I have written a when-button-pressed trigger .from here I want to call this function.
How can I do that?
Please help..Thanks a lot..
User may select 20-30 check boxes for respective name & id...then at the end , user will hit OK...from here when-button-click will call a procedure....that will update/insert/delete a table data.The procedure I have written is:-
DECLARE
N_CNT Number(1);
D_SYSDATE Constant date :=sysdate;
Begin
select count(1)
into N_CNT
from dbtable L
where L.land_id = :BLK1.LAND_ID and
L.Operatoer_id = :BLK1.Operatoer_id and
L.suppl_id = :BLK1.suppl_id and
L.suppl_prof_id = :BLK1.suppl_prof_id;
if ((N_CNT = 0) and (:LANDLISTE.state = 'A')) then
insert into dbtable
LAND_ID,
STATE,
suppl_prof_id,
suppl_id,
OPERATOER_ID,
SIDST_OPD_DATO,
SIDST_OPD_INIT
values
:BLK1.LAND_ID,
'Y',
:BLK1.suppl_prof_id,
:BLK1.suppl_id,
:BLK1.Operatoer_id,
D_SYSDATE,
:BLK1.SIDST_OPD_INIT
elseif
((N_CNT>0 )and (:LANDLISTE.state = 'A')) then
update dbtable L
set L.SIDST_OPD_DATO = D_SYSDATE,
L.SIDST_OPD_INIT = :BLK1.SIDST_OPD_INIT
where L.land_id = :BLK1.LAND_ID and
L.Operatoer_id = :BLK1.Operatoer_id and
L.suppl_id = :BLK1.suppl_id and
L.suppl_prof_id = :BLK1.suppl_prof_id;
elseif ((N_CNT>0 ) and (:LANDLISTE.state = 'D')) then
delete from dbtable L
where L.land_id = :BLK1.LAND_ID and
L.Operatoer_id = :BLK1.Operatoer_id and
L.suppl_id = :BLK1.suppl_id and
L.suppl_prof_id = :BLK1.suppl_prof_id;
end if;
end;
Will it be able to load multiple data(20-30 at a time) to the table?
Should I write anything to commit the data in the table?
I am very new to oracle forms...please help.. -
Calling stored pl/sql functions
Hello,
Any suggestions on calling a stored pl/sql function from a UIX page and returning the output of the function to the same page?
Thanks,
-JeffHi Jaap,
I followed the instructions on the link you gave me and when I ran my test application I received this error:
C:\jdev903\jdk\bin\javaw.exe -ojvm -classpath C:\msdapp_jeff\web\WEB-INF\classes;C:\msdapp_jeff\web\WEB-INF\lib\CopyProjectLibs.bat;C:\msdapp_jeff\web\WEB-INF\lib\bc4jmt.jar;C:\msdapp_jeff\web\WEB-INF\lib\bc4jct.jar;C:\msdapp_jeff\web\WEB-INF\lib\bc4jdomorcl.jar;C:\msdapp_jeff\web\WEB-INF\lib\collections.jar;C:\msdapp_jeff\web\WEB-INF\lib\bc4jdatum.jar;C:\msdapp_jeff\web\WEB-INF\lib\classes12.jar;C:\msdapp_jeff\web\WEB-INF\lib\nls_charset12.jar;C:\msdapp_jeff\web\WEB-INF\lib\xmlparserv2.jar;C:\msdapp_jeff\web\WEB-INF\lib\uix2-dbg.jar;C:\msdapp_jeff\web\WEB-INF\lib\share-dbg.jar;C:\msdapp_jeff\web\WEB-INF\lib\regexp.jar;C:\msdapp_jeff\web\WEB-INF\lib\cle.jar;C:\msdapp_jeff\web\WEB-INF\lib\jhsruntime.jar;C:\jdev903\BC4J\lib\bc4jmt.jar;C:\jdev903\BC4J\lib\collections.jar;C:\jdev903\BC4J\lib\bc4jct.jar;C:\jdev903\lib\xmlparserv2.jar;C:\jdev903\jlib\jdev-cm.jar;C:\jdev903\j2ee\home\lib\jndi.jar;C:\jdev903\BC4J\lib\bc4jdomorcl.jar;C:\jdev903\BC4J\jlib\bc4jdatum.jar;C:\jdev903\jdbc\lib\classes12.jar;C:\jdev903\jdbc\lib\nls_charset12.jar;C:\jdev903\jlib\jdev-cm.jar;C:\jdev903\jdev\lib\jdev-rt.jar;C:\jdev903\BC4J\jlib\bc4jtester.jar;C:\jdev903\jlib\jdev-cm.jar;C:\jdev903\lib\xmlparserv2.jar;C:\jdev903\jlib\help4-nls.jar;C:\jdev903\jlib\help4.jar;C:\jdev903\jlib\share.jar;C:\jdev903\jlib\jewt4-nls.jar;C:\jdev903\jlib\jewt4.jar;C:\jdev903\jlib\oracle_ice5.jar;C:\msdapp_jeff\web\WEB-INF\lib\bc4jct.jar;C:\msdapp_jeff\web\WEB-INF\lib\bc4jdatum.jar;C:\msdapp_jeff\web\WEB-INF\lib\bc4jdomorcl.jar;C:\msdapp_jeff\web\WEB-INF\lib\bc4jmt.jar;C:\msdapp_jeff\web\WEB-INF\lib\classes12.jar;C:\msdapp_jeff\web\WEB-INF\lib\cle.jar;C:\msdapp_jeff\web\WEB-INF\lib\collections.jar;C:\msdapp_jeff\web\WEB-INF\lib\jhsruntime.jar;C:\msdapp_jeff\web\WEB-INF\lib\nls_charset12.jar;C:\msdapp_jeff\web\WEB-INF\lib\regexp.jar;C:\msdapp_jeff\web\WEB-INF\lib\share-dbg.jar;C:\msdapp_jeff\web\WEB-INF\lib\uix2-dbg.jar;C:\msdapp_jeff\web\WEB-INF\lib\xmlparserv2.jar;C:\jdev903\lib\xmlparserv2.jar;C:\jdev903\jlib\regexp.jar;C:\jdev903\jlib\share.jar;C:\jdev903\jlib\uix2.jar;C:\jdev903\j2ee\home\lib\ojsp.jar;C:\jdev903\j2ee\home\jsp\lib\taglib\ojsputil.jar;C:\jdev903\j2ee\home\oc4j.jar;C:\jdev903\j2ee\home\lib\servlet.jar;C:\jdev903\jdev\lib\ojc.jar;C:\jdev903\BC4J\lib\bc4jhtml.jar;C:\jdev903\BC4J\lib\datatags.jar;C:\jdev903\BC4J\lib\bc4juixtags.jar;C:\jdev903\BC4J\lib\bc4j_jclient_common.jar -Djbo.project=empdep0 -Dhttp.proxyHost=http -Dhttp.proxyPort=80 -Dhttp.nonProxyHosts=*.oasas.state.ny.us test.test
oracle.jbo.JboException: STRINGMANAGER: StringManager oracle.jbo.common.CommonMessageBundle (33001) exception oracle.jbo.NoXMLFileException: JBO-26001: XML File not found for the Container empdep0.jpx
void oracle.jbo.client.Configuration.loadFromClassPath(java.lang.String)
Configuration.java:301
oracle.jbo.ApplicationModule oracle.jbo.client.Configuration.createRootApplicationModule(java.lang.String, java.lang.String, oracle.jbo.common.ampool.EnvInfoProvider)
Configuration.java:1090
oracle.jbo.ApplicationModule oracle.jbo.client.Configuration.createRootApplicationModule(java.lang.String, java.lang.String)
Configuration.java:1073
void test.test.main(java.lang.String[])
I'm pretty clueless on this one. What do you think?
-Jeff -
CALLING a STORED SQL FUNCTION from Java 1.1.8
I am trying to execute a stored function in JAVA 1.1.8, from an Oracle
8i Database. My stored function is simple, it converts an Input Number to an output TIME string. I am unsure how to code the call from Java. Are SQL STORED PROCEDURES treated the same as SQL STORED FUNCTIONS? Do you use the CallableProcdure class or something else?
Thanks for your input.yep - same way. Except no return value.
-
Calling a PL/SQL function returning Netsed Table Rows
Hi,
I am trying to call a Function which returns Nested Table rows (as Out Parameter) in Java .
When I am trying to use
pstmt.registerOutParameter(3, OracleTypes.OTHER);
to capture the Out parameter in Java code , I get the follwoing error :
java.sql.SQLException: Invalid column type
I have even tried using OracleTypes.JAVA_OBJECT ,but I get the same error.
If I use OracleTypes.JAVA_STRUCT I get
java.sql.SQLException: Parameter Type Conflict: sqlType=2008
error.
Please help .
Am I doing the right thing ?
Thanks in advance.
Ninadhttp://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/files/jdbc20/jdbc20.html
-
Calling a PL/SQL from VB with IN argument of object type
I need to call a PL/SQL function in Oracle 8.1.6 from VB. One of the IN arguments is an object type (TYPE). How would I instantiate the variable of Oracle object type on VB side so that it can be passed to the Oracle?
Thank youYou have some flaws in your code.
First - don't use same identifier for pl sql variables ( including parameters) and column names. In your case oracle will evaluate the where clause as where column_name=column_name which is probably not what you want. The next one - you should ensure that select into yields one row , not more, not less, otherwise you 'll run into exception.
To actually print the desired values, you have to use dbms_output aware client ( sqlplus is such one) and for sqlplus in particular you have to issue set serveroutput on
Here is a very basic example how can you get it to work:
SQL> SELECT * FROM V$VERSION;
BANNER
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for Linux: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
SQL> CREATE OR REPLACE PROCEDURE FIND_EMPLOYEES
2 (p_first_name IN VARCHAR2)
3 IS
4 LAST varchar2(10);
5 BEGIN
6 SELECT LAST_NAME INTO LAST FROM EMPLOYEES WHERE FIRST_NAME = p_first_name;
7 dbms_output.put_line(LAST);
8 EXCEPTION
9 WHEN no_data_found THEN
10 dbms_output.put_line('There is no one employee with such first name!');
11 WHEN too_many_rows THEN
12 dbms_output.put_line('There are many employees with such first name, try with another one!');
13 END FIND_EMPLOYEES;
14 /
Procedure created.
SQL> SET SERVEROUTPUT ON
SQL> EXEC FIND_EMPLOYEES('Julia')
There are many employees with such first name, try with another one!
PL/SQL procedure successfully completed.
SQL> EXEC FIND_EMPLOYEES('Eugenia')
There is no one employee with such first name!
PL/SQL procedure successfully completed.
SQL> EXEC FIND_EMPLOYEES('Adam')
Fripp
PL/SQL procedure successfully completed.Best regards
Maxim -
Call PL/SQL Function in ABAP over XI
Hi all,
is it possible to call a PL/SQL function in a BW-ABAP over XI and to get back the return value of the function. What proxy do i need and how should the coding look like if it is possible.
I am thankful for every little help.
PeterYou can do a client proxy to JDBC scnario in XI. If you have a stored procedure on the Database side you can call it using SQL XML message type.
Search for the JDBC receiver adapter documentation on help.sap.com
VJ
Maybe you are looking for
-
How to hook up the Qosmio G20 to a TV?
Hi, I posted here a long time ago and I still haven't found a solution to this problem. I want to hook my laptop up to my TV. I'm always in a different room so I'll be either hooking it up to a 21" Toshiba, or a 32"Sony or a 51"Toshiba - I don't know
-
Hello, I just want to be able to use my DVD-RW like a hard drive, like in windows. I'm new to mac, so maybe I'm missing something, but I simply dragged a file onto the RW, it copied to it, then I couldn't add anything else. I also have Toast if this
-
On checking through my keywords I noticed I had 2 entries for Scotland one of was Scotland, whilst the other is Scotland , i.e a space between the d and the ,. There are about 1200 images where I need to remove that space - any suggestions would be v
-
Hi! The state of the card is OP_READY! The Get Data E0 tag shows: key indentifier: 01 key version number: FF key type: 80 key length: 10 Here is the log: Secure Channel with ISK 13 00 A4 04 00 08 A0 00 00 00 03 00 00 00 02 61 70 05 00 C0 00 00 70 114
-
Hi, I have a macbook unibody, But I still need used some windows aplicacion, like microsoft money and microsoft messenger, I really dont like messenger for mac, because I Need used the web cam. Now I have installed paralle desktop on my mac, but I ca