More than 1 cursor in a stored procedure
Is it possible to open more than 1 cursor in a stored procedure? I have 2 stored procedure which use the same 2 parameters, and figured I could probably combine the two. Thanks
If you used the example provided by SBH more or less as it was posted, then both cursors were closed before they got to coldfusion. If you are passing them out of you procedures for processing by another piece of code you need to leave them open. More along the lines of:
create procedure protest(p_empno number,
p_ename out varchar2,
p_sal out number,
p_dummy out varchar2) is
cursor c1 is
select ename,sal
from employee
where empid = p_empno;
cursor c2 is
select name
from stname;
begin
open c1;
open c2;
end;Just make sure to close them in your calling code once you have finished with them.
John
Similar Messages
-
Can we execute more than one SQL in Stored Procedure?
Please help me with this.
I am connecting to SQL SERVER
Thanks
VenuHi Venu,
>>1) Get the input parametrs for SP in from file
You can pass parameters to the SP from the payload of the message. I am not sure what do you mean by "Getting the parameters for SP in form file"..
>>2 Configure Receiver JDBC adapter(Synchronous)which executes a STORED PROCEDURE that has some processing logic containing more than one sql statment
This is no problem. You can have any number of select /update statements inside the stored procedure. But your stored procedure will not return data to XI and that will not be sent as a response to your BPM
3) Send the response from SP to a BPM
yes.You can have another Stored procedure that have only one select statement to send response to BPM. You may have to define abstract interfaces .
hence for 2) and 3) the message payload would be something like this
<StatementName1>
<storedProcedureName action= EXECUTE>
<table>realStoredProcedureeName</table>
<param1 [isInput=true] [isOutput=true] type=SQLDatatype>val1</param1>
</storedProcedureName >
</StatementName1>
<StatementName2>
<anyName action= SQL_QUERY>
<access>SQL-String with optional placeholder(s)</access>
<key>
<placeholder1>value1</placeholder1>
<placeholder2>value2<placeholder2>
</key>
</anyName >
</StatementName2>
Regards
Arul
PS: Mark usefull answers and for more info about points - read the post "Rules of engagement" at the top of the XI forum -
Retrieving cursor from a stored procedure
Hi,
Is there any means to retrieve a cursor from a stored procedure using java.sql.* package, without using database specific type code like OracleTypes.CURSOR?
Regards,
Shalin.Hi,
I had some across this problem some time ago. Although, there is no direct answer to this solution, there is a "kloog" that you can apply.
Please note that the signature for registerOutParameter(int parameterIndex, int sqlType), and note that where ever sqlType is mentioned it is an int.
Now JDBC is an interface and the implementation is given by Oracle. So to register an "out" parameter all you have to do is registerOutParameter(1, OracleTypes.CURSOR). It works!
Or otherwise try and find out what the int value of CURSOR is and replace. This is because not all databases can support returning a "cursor" type, since ORACLE and few other databases have a concept of "STORED PROCEDURE" and PLSQL is specific to ORACLE.
I hope this helps!
Cheers,
John. -
How to get an UPDATABLE REF CURSOR from the STORED PROCEDURE
using C# with
ORACLE OLE DB version: 9.0.0.1
ADO version: 2.7
I returns a REF CURSOR from a stored procedure seems like:
type TCursor is ref cursor;
procedure test_out_cursor(p_Dummy in varchar, p_Cur out TCursor) is
begin
open p_Cur for select * from DUAL;
end;
I create an ADO Command object and set
cmd.Properties["IRowsetChange"].Value = true;
cmd.Properties["Updatability"].Value = 7;
cmd.Properties["PLSQLRSet"].Value = 1;
cmd.CommandText = "{CALL OXSYS.TEST.TEST_OUT_CURSOR(?)}";
and I use a Recordset object to open it:
rs.Open(cmd, Missing.Value,
ADODB.CursorTypeEnum.adOpenStatic,
ADODB.LockTypeEnum.adLockBatchOptimistic,
(int) ADODB.CommandTypeEnum.adCmdText +
(int) ADODB.ExecuteOptionEnum.adOptionUnspecified);
The rs can be opened but can NOT be updated!
I saved the recordset into a XML file and there's no
rs:baseschema/rs:basetable/rs:basecolumn
attributes for "s:AttributeType" element.
Any one have idea about this?
thanks very muchIt is not possible through ADO/OLEDB.
Try ODP.NET currently in Beta, it is possible to update DataSet created with refcursors. You need to specify your custom SQL or SP to send update/insert/delete.
As I remember there is a sample with ODP.NET Beta 1 just doing this. -
Ref Cursors in a stored Procedure
Can some help me with an answer to the below question.
How many ref cursors can be declared in a stored procedure in oracle?
Thanksuser533016 wrote:
You are right. Keeping so many cursors open is not good at all. But i was doing this to see where it breaks and is there something that definitely controls the number of refcursors in allowed a PL/SQL block.As Karthick already mentioned you have the OPEN_CURSORS parameter which defines how many open cursors you may have in any one session.
However, this doesn't just apply to Ref Cursors. If you open explicitly defined cursors then this will also count towards that, as well as issuing select statements as they are implicit cursors... e.g.
declare
cursor c1 is
select * from emp;
cursor c2 is
select * from dept;
v_c1 c1%ROWTYPE;
v_c2 c2%ROWTYPE;
v_cnt number;
begin
open c1; -- now we have 1 open cursors
loop
fetch c1 into v_c1;
exit when c1%notfound;
open c2; -- now we have 2 open cursors
loop
fetch c2 into v_c2;
exit when c2%notfound;
select count(*) -- this counts as opening cursor number 3.
into v_cnt
from payroll;
-- after the select statement the implicit cursor is automatically closed, so now we have 2 open again
end loop;
close c2; -- after this we just have 1 more open
end loop;
close c1; -- after this we have no open cursors
end; -
Passing Ref Cursor to Oracle Stored Procedure Via C#
Hi all,
I am new to oracle and stuck with an issue. I have three insert stored procedures for three different tables. Two of them have multiple rows to be inserted, which is currently done via iterating through each row and insert to db in C# code. My requirement is to merge these three procedures in one and instead of iterating from C# code send table rows as (ref cursor or collection) to procedure and the procedure will handle the rest.
I read that ref cursor only works if you're data is in database as it reference the memory but in my case data is build on client side.
I am using Oracle 11i and ASP.Net 2.0
Can any help me on this please?
Edited by: 929463 on Apr 23, 2012 12:38 AM929463 wrote:
I am new to oracle and stuck with an issue. I have three insert stored procedures for three different tables. Two of them have multiple rows to be inserted, which is currently done via iterating through each row and insert to db in C# code. My requirement is to merge these three procedures in one and instead of iterating from C# code send table rows as (ref cursor or collection) to procedure and the procedure will handle the rest.Why a single procedure? How is the procedure to determine the target table to insert the data into? And please - no dynamic SQL as that is 99% of the time wrong.
A ref cursor is something that PL/SQL creates - with the purpose of passing the cursor handle to your code. This enables the actual SQL statement for that cursor to be moved from client code, into a PL/SQL stored proc. It abstracts the client from having to understand SQL, understand the data model and so on. All clients use the same PL/SQL proc and thus the same code for creating that cursor. Thus no issue of some clients getting it half right or half wrong and dealing with data inconsistencies between clients.
The PL/SQL proc can be tuned and optimised, modified for catering for data model changes and so on. Without your client code having to be even recompiled as it is isolated against these server changes.
For all other interaction (running PL/SQL code, doing insert/update/delete/etc SQL statements), you need to create the cursor yourself in your code.
Also, the SQL engine only sees cursors. There are no differences between cursors. The client (e.g. PL/SQL) can call it a reference cursor, or an implicit cursor, or a DBMS_SQL cursor.. the SQL engine does not know that and does not care.
A ref cursor is simply a special type of client interface to a SQL cursor, allowing PL/SQL to create that SQL cursor and then pass the handle of that SQL cursor to other code to consume that cursor.
Okay, so if you want to insert data, you need in your code to create a cursor. This can be a SQL INSERT cursor - the actual insert statement. Or it can be a PL/SQL call - an anonymous PL/SQL code block that calls a stored proc that performs the insert (after applying validation and business logic).
The cursor will have one or more bind variables. Your client will pass values for these variables and the server-side code (SQL or PL/SQL) will be executed using this as variable data.
You can for example create a cursor as follows:
begin
DoFunkyInsert( :1, :2, :3 );
end;
{code}
3 bind variables are expected. You can now in the client build an array for each of these variables, containing a 100 values each (total of a 100 rows to insert). Do a single execute of the cursor, and tell Oracle that the bind is actually a 100 element array.
The complete array ships to Oracle - Oracle opens a loop and execute the cursor for each element in the array.
This is called bulk binding.
An alternative approach is to define the bind variable as a collection (a non-scalar value). And then code the PL/SQL procedure to open a loop and iterate through the collection/array, inserting a row per iteration.
The binding itself is more complex as your code know needs to understand Oracle object types and be able to define an array/collection that is a valid Oracle non-scalar data type.
The +Oracle Call Interface+ (OCI) is quite flexible in this regard. However, as you work via an abstraction layer (e.g. ADO, OleDB, ODBC, etc) your code is subject to whatever functionality this abstraction layer makes available to your code. And this is seldom includes all the power, functionality and flexibility of the (more complex) OCI itself. -
How do I get the returned cursor from a stored procedure to an asp.
Sorry if this topic has been answered before but I am new to Oracle and ASP. I have been asked to create some stored procedures and access the results from the ASP. I will be passing one variable in and could be getting upto 200 rows returned.
I have no trouble with the stored procedure but have no clue how to retrieve the data returned by it.Assuming that the stored procedure has a single argument, an OUT cursor, you should be able to do
SQLExecDirect
{call <stored_proc>() }
SQLFetch
SQLGetData
We'll handle all the 'magic' underneath.
Justin Cave
ODBC Development -
How to pass more than one value to the procedure
How can I pass more than one letting date to this procedure. If it is only one letting date, I do not have a problem but when it is more than one letting date at the same time then I am stuck. please help
example I would like to pass this three letting dates : '01/17/2010', '01/27/2010','05/22/2010'
CEATE OR REPLACE PROCEDURE TPLCP.PLANHOLDERSLIST
P_LettingDate IN VARCHAR2,
p_results OUT sys_refcursor
AS
BEGIN
OPEN p_results FOR
SELECT DISTINCT DECODE (TRIM (MIN (j.route)), NULL, 'N/A',TRIM (MIN (j.route))) rt,l.lcontid conid,
SUBSTR (q.cprojnum, 1, 10) pr, SUBSTR (l.letting, 3, 2)|| '-'|| SUBSTR (l.letting, 5, 2)|| '-'|| SUBSTR (l.letting, 1, 2) lt,
(q.cdescr) jbtyp, INITCAP (q.clocat1 || q.clocat2) loc
FROM vendor v,
vendaddr r,
letprop l,
planhold p,
proposal q,
project j,
propproj k,
bidlet bd
WHERE v.vendor = r.vendor
AND k.contid = q.contid
AND k.pcn = j.pcn
AND l.lcontid = k.contid
AND p.vendor = v.vendor
AND l.letting = p.letting
AND TO_CHAR (bd.datelet, 'MM/DD/YYYY') IN P_LettingDate
AND l.CALL = p.CALL
AND r.addrnum = p.billto
AND bd.letting = l.letting
GROUP BY v.vendor,
r.addrnum,
v.vnamel,
r.aaddr1,
p.billto,
r.acity,
r.astate,
q.cdescr,
q.clocat1,
q.clocat2,
bd.letting,
r.azipcode,
r.vasst1,
r.aphone,
l.letting,
l.lcontid,
q.cprojnum;
END PLANHOLDERSLIST;you can create your on array type and then pass that as the parameter. I use the suffix of ttyp to represent a table type. The name of the column when using the table() syntax is columnvalue.
I altered my session to set the default date format to match your format. you could have used the to_date function to set the values for the arr type.
Hope this helps.
create type msw_ttyp as table of date
create or replace
procedure msw_test(p_arr in msw_ttyp) as
v integer;
begin
select count(*)
into v
from table(p_arr);
dbms_output.put_line('count: '||v);
for rec in (select column_value
from table(p_arr))
loop
dbms_output.put_line(rec.column_value);
end loop;
end msw_test;
alter session set nls_date_format = 'MM/DD/YYYY';
set serveroutput on size 1000000
exec msw_test(msw_ttyp('01/17/2010', '01/27/2010','05/22/2010'));
begin
msw_test(msw_ttyp(to_date('01/17/2010', 'MM/DD/YYYY'),
to_date('01/27/2010', 'MM/DD/YYYY'),
to_date('05/22/2010', 'MM/DD/YYYY')));
end;
/ -
Using more than one sysrefcursors in a procedure.
Hi,
can we use 2 -3 sysrefcursors to get 3 different resultset out from a single plsql procedure for particular page on front end? each sysrefcursor with with different select?
I have to fetch resultset and fire a query for searching data, finding aggregate on few fields and one more query for finding aggregates.
can we do this?
Could you please reply this with simple example?
Thanks a lot.>
can we use 2 -3 sysrefcursors to get 3 different resultset out from a single plsql procedure for particular page on front end? each sysrefcursor with with different select?
I have to fetch resultset and fire a query for searching data, finding aggregate on few fields and one more query for finding aggregates.
can we do this?
Could you please reply this with simple example?
>
You can pretty use as many as you like. Just define them as OUT parameters (or IN OUT) and open them all before the procedure returns.
I've seen 50 used in one procedure at a large financial institution. Of course they had performance problems related to that.
Keep in mind that every cursor you open causes Oracle to perform ALL of the parsing and read consistency work needed to service ALL of the cursors. So if you open three cursors but the user only uses one of them the work for the other two is wasted and can contribute to performance issues.
Here is an example using one cursor. You can add more to expand the example.
CREATE OR REPLACE TYPE SCOTT.local_type IS OBJECT (
empno NUMBER(4),
ename VARCHAR2(10));
CREATE OR REPLACE TYPE SCOTT.local_tab_type IS TABLE OF local_type;
CREATE OR REPLACE PACKAGE SCOTT.test_refcursor_pkg
AS
TYPE my_ref_cursor IS REF CURSOR;
-- add more cursors as OUT parameters
PROCEDURE test_proc(p_ref_cur_out OUT test_refcursor_pkg.my_ref_cursor);
END test_refcursor_pkg;
CREATE OR REPLACE PACKAGE BODY SCOTT.test_refcursor_pkg
AS
PROCEDURE test_proc(p_ref_cur_out OUT test_refcursor_pkg.my_ref_cursor)
AS
l_recs local_tab_type;
BEGIN
-- Get the records to modify individually.
SELECT local_type(empno, ename) BULK COLLECT INTO l_recs
FROM EMP;
-- Perform some complex calculation for each row.
FOR i IN l_recs.FIRST .. l_recs.LAST
LOOP
DBMS_OUTPUT.PUT_LINE(l_recs(i).ename);
END LOOP;
-- Put the modified records back into the ref cursor for output.
OPEN p_ref_cur_out FOR
SELECT * from TABLE(l_recs);
-- open more ref cursors here before returning
END test_proc;
END;
SET SERVEROUTPUT ON SIZE 1000000
DECLARE
l_cursor test_refcursor_pkg.my_ref_cursor;
l_ename emp.ename%TYPE;
l_empno emp.empno%TYPE;
BEGIN
test_refcursor_pkg.test_proc (l_cursor);
LOOP
FETCH l_cursor
INTO l_empno, l_ename;
EXIT WHEN l_cursor%NOTFOUND;
DBMS_OUTPUT.PUT_LINE(l_ename || ' | ' || l_empno);
END LOOP;
CLOSE l_cursor;
END;
/ -
Problem passing REF CURSOR to JAVA STORED PROCEDURE
Hi,
I've written a small Java class with a static method and
imported that into Oracle 8i. The method expects a
java.sql.ResultSet object as parameter. According to the
documentation of Oracle, a REF CURSOR (cursor variable) maps to
java.sql.ResultSet in JDBC.
The definition of the Java Stored Procedure was accepted without
problems:
CREATE OR REPLACE PROCEDURE RESULTSETPASSINGTESTPROC (row
WASTypes.GenericCurType)
as language java
name 'sqlj.ResultSetPassingTest.testResultSetPassing
(java.sql.ResultSet)';
WASTypes is a package containing the definition of the generic
cursor:
CREATE OR REPLACE PACKAGE WASTYPES
is
TYPE GenericCurType IS REF CURSOR;
END WASTypes;
In a function I'm opening the cursor via
'Open cursorVariable for sqlStatement';
Then this cursor variable is passed to the java method and the
error ORA-03113 is shown.
I tried to solve the problem by changing the type of the
parameter to oracle.sql.REF without success.
Does anybody know what wents wrong?
Thanks in advance.
JanHi,
I've written a small Java class with a static method and
imported that into Oracle 8i. The method expects a
java.sql.ResultSet object as parameter. According to the
documentation of Oracle, a REF CURSOR (cursor variable) maps to
java.sql.ResultSet in JDBC.
The definition of the Java Stored Procedure was accepted without
problems:
CREATE OR REPLACE PROCEDURE RESULTSETPASSINGTESTPROC (row
WASTypes.GenericCurType)
as language java
name 'sqlj.ResultSetPassingTest.testResultSetPassing
(java.sql.ResultSet)';
WASTypes is a package containing the definition of the generic
cursor:
CREATE OR REPLACE PACKAGE WASTYPES
is
TYPE GenericCurType IS REF CURSOR;
END WASTypes;
In a function I'm opening the cursor via
'Open cursorVariable for sqlStatement';
Then this cursor variable is passed to the java method and the
error ORA-03113 is shown.
I tried to solve the problem by changing the type of the
parameter to oracle.sql.REF without success.
Does anybody know what wents wrong?
Thanks in advance.
Jan -
Cursor Not working stored Procedure but it working in anonymous Procedure
Hi Gurus....
My problem looks different.....my code was working as anonymous block where as it was not working as stored Procedure
Declare
cursor c_tblspace is
select fs.tablespace_name TBL_SPC_NAME
, round((100 *((sum(fs.bytes)) / df.bytes)), 2) PCT_Free
from sys.dba_data_files df
, sys.dba_free_space fs
,partition_tables ms
where df.file_id(+) = fs.file_id
and fs.tablespace_name =ms.tbspc_nam
group by fs.file_id, df.bytes, fs.tablespace_name;
begin
for rec_tblspace in c_tblspace
loop
if ( rec_tblspace.PCT_Free > 5 )
then
insert into t_space (tbspc_nm,ftr_spc)
values(rec_tblspace.TBL_SPC_NAME,'full');
dbms_output.put_line(rec_tblspace.TBL_SPC_NAME||' is full');
end if;
end loop;
end;where as it working while i want to create a stored Procedure...
create or replace procedure p_upd_space is
cursor c_tblspace is
select fs.tablespace_name TBL_SPC_NAME
, round((100 *((sum(fs.bytes)) / df.bytes)), 2) PCT_Free
from sys.dba_data_files df
, sys.dba_free_space fs
,partition_tables ms
where df.file_id(+) = fs.file_id
and fs.tablespace_name =ms.tbspc_nam
group by fs.file_id, df.bytes, fs.tablespace_name;
begin
for rec_tblspace in c_tblspace
loop
if ( rec_tblspace.PCT_Free > 5 )
then
insert into t_space (tbspc_nm,ftr_spc)
values(rec_tblspace.TBL_SPC_NAME,'full');
dbms_output.put_line(rec_tblspace.TBL_SPC_NAME||' is full');
end if;
end loop;
end;It was throwing following error...
PL/SQL: ORA-00942: table or view does not existJustin is right. You are creating definer right stored procedure.
Roles are disabled during definer rights stored procedure compilation and execution.
Here is the test case:
#1. Anonymous Procedure
HRDEMO@fmw//scripts> conn / as sysdba
SYS@fmw//scripts> create user todd identified by oracle;
SYS@fmw//scripts> grant dba to todd; --DBA role granted
SYS@fmw//scripts> conn todd/oracle
TODD@fmw//scripts> declare
2 cursor c is select * from dba_data_files;
3 begin
4 null;
5 end;
6 /
PL/SQL procedure successfully completed.
#2. Stored Procedure
TODD@fmw//scripts> create or replace procedure p1
2 is
3 cursor c is select * from dba_data_files;
4 begin
5 null;
6 end;
7 /
Warning: Procedure created with compilation errors.
TODD@fmw//scripts> show error
3/27
PL/SQL: ORA-00942: table or view does not exist -
REF CURSOR RETURNED FROM STORED PROCEDURE OPENED WITH CURRENT_USER PRIVILEGES
Hi.
I was wondering if anyone knows when this bug will be fixed. The bug# is 899567 off of metalink.
I am running into this problem as well, and we do not want to use OCI/SQLNet as the fix. We have an application with secure data concerns and only want to give access to stored procedures to an application user.
Thanks,
BradI'm using version 8.1.6.0.0 on a W2K server.
PS: a strange behaveour
if i try to insert a row using the following anonymous pl/sql block
begin
insert into objects select 2, 'B', ref(c) from meta.classes c where id =1;
end;
i get the following error msg
ERROR at line 1:
ORA-06552: PL/SQL: Compilation unit analysis terminated
ORA-06553: PLS-302: component 'OBJ_T' must be declared
but if i use only the sql command from the sql plus prompt
insert into objects select 2, 'B', ref(c) from meta.classes c where id =1;
the row is inserted.
OBJ_T is the object type(id number, label varchar2, class ref class_t),
OBJECTS is a table of obj_t,
CLASS_T is an object type(id number, label varchar2)
CLASSES is a table of CLASS_T.
null -
Server Crashes when using Cursor Vars in Stored Procedure
Can anyone make a suggestion
We are experiencing a problem that causes our Weblogic Server to crash
when a JDBC call is made to our Oracle database.
Host Details
Operating System: Solaris Version 8
SunOS 5.8 Generic_108528-15 sun4u sparc SUNW,UltraAX-i2
WebLogic Server 6.1 SP1 09/18/2001 14:28:44 #138716
Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
JDBC Driver Weblogic JDriver for Oracle
The jdbc command that causes the problem is similar the spcursor
example code file:
// Here we prepare a CallableStatement using a WebLogic extension
// to JDBC that supports binding an Oracle cursor to an output
// parameter. Register the output parameter type as OTHER . . .
cstmt =
(weblogic.jdbc.common.OracleCallableStatement)conn.prepareCall("BEGIN
OPEN ? FOR select * from emp; END;");
cstmt.registerOutParameter(1, java.sql.Types.OTHER);
The crash happens when the re.next() method is invoked after the
execute()
This is the core dump message that is generated:
An unexpected exception has been detected in native code outside the
VM.
Unexpected Signal : 11 occurred at PC=0xd339f37c
Function name=kpcxk2u
Library=/u01/app/oracle/product/8.1.7/lib/libclntsh.so.8.0
Current Java thread:
at weblogic.db.oci.OciCursor.arrayFetch(Native Method)
at weblogic.db.oci.OciCursor.oci_arrayFetch(OciCursor.java:2002)
at weblogic.jdbc.oci.ResultSet.next(ResultSet.java:759)
at weblogic.jdbc.pool.ResultSet.next(ResultSet.java:180)
at weblogic.jdbc.rmi.internal.ResultSetImpl.next(ResultSetImpl.java:132)
at weblogic.jdbc.rmi.internal.ResultSetImpl_WLSkel.invoke(Unknown
Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:296)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:265)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
Dynamic libraries:
0x10000 /opt/bea/jdk131/jre/bin/../bin/sparc/native_threads/java
0xff350000 /usr/lib/libthread.so.1
0xff390000 /usr/lib/libdl.so.1
0xff200000 /usr/lib/libc.so.1
0xff330000 /usr/platform/SUNW,UltraAX-i2/lib/libc_psr.so.1
0xfe480000 /opt/bea/jdk131/jre/lib/sparc/hotspot/libjvm.so
0xff2e0000 /usr/lib/libCrun.so.1
0xff1e0000 /usr/lib/libsocket.so.1
0xff100000 /usr/lib/libnsl.so.1
0xff0d0000 /usr/lib/libm.so.1
0xff310000 /usr/lib/libw.so.1
0xff0b0000 /usr/lib/libmp.so.2
0xff080000 /opt/bea/jdk131/jre/lib/sparc/native_threads/libhpi.so
0xff050000 /opt/bea/jdk131/jre/lib/sparc/libverify.so
0xfe440000 /opt/bea/jdk131/jre/lib/sparc/libjava.so
0xff020000 /opt/bea/jdk131/jre/lib/sparc/libzip.so
0xfe230000 /opt/bea/jdk131/jre/lib/sparc/libnet.so
0xfe160000 /usr/lib/nss_files.so.1
0xd3700000 /opt/bea/wlserver6.1/lib/solaris/oci817_8/libweblogicoci37.so
0xd3000000 /u01/app/oracle/product/8.1.7/lib/libclntsh.so.8.0
0xfd090000 /usr/lib/libC.so.5
0xfd3b0000 /u01/app/oracle/product/8.1.7/lib/libwtc8.so
0xfd070000 /usr/lib/libgen.so.1
0xfd050000 /usr/lib/libsched.so.1
0xfd020000 /usr/lib/libaio.so.1
0xfafd0000 /opt/bea/wlserver6.1/lib/solaris/libmuxer.so
Local Time = Thu Apr 3 10:39:37 2003
Elapsed Time = 178
# The exception above was detected in native code outside the VM
# Java VM: Java HotSpot(TM) Client VM (1.3.1-b24 mixed mode)
# An error report file has been saved as hs_err_pid7599.log.
# Please refer to the file for further information.
Abort - core dumped
TIA
TonyTony,
"Tony Ross" <[email protected]> wrote in message
news:[email protected]...
Thanks Mitesh for your response.
We have followed your advice on using the 901 driver and updating the
config.xml file. Alas it has not stopped the Solaris WLS from
crashing.Actually, Mitesh sugested you replacing weblogic driver
with oracle one. As it follows from the stacktrace, it has
not been done.
I'd also recommend moving to oracle thin driver as it
doesn't have native code thus is more stable.
Regards,
Slava Imeshev
In addition to this we tried using WLS 6.1 SP2 on a Win2000 box
(connecting to same database). We managed to crash this instance as
well. The core dump is as follows:
An unexpected exception has been detected in native code outside the
VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at
PC=0x6021bc08
Function name=kpcxk2u
Library=C:\Oracle\Ora81\BIN\oracommon8.dll
Current Java thread:
at weblogic.db.oci.OciCursor.arrayFetch(Native Method)
- locked <2956f78> (a weblogic.db.oci.OciCursor)
at weblogic.db.oci.OciCursor.oci_arrayFetch(OciCursor.java:2022)
at weblogic.jdbc.oci.ResultSet.next(ResultSet.java:759)
- locked <3423480> (a weblogic.db.oci.OciConnection)
at weblogic.jdbc.rmi.internal.ResultSetImpl.next(ResultSetImpl.java:133)
at weblogic.jdbc.rmi.internal.ResultSetImpl_WLSkel.invoke(Unknown
Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
atweblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267)
atweblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:2
2)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
Dynamic libraries:
0x00400000 - 0x00405000 c:\bea\jdk131\bin\java.exe
0x77F80000 - 0x77FFB000 C:\WINNT\System32\ntdll.dll
0x77DB0000 - 0x77E0D000 C:\WINNT\system32\ADVAPI32.dll
0x77E80000 - 0x77F36000 C:\WINNT\system32\KERNEL32.DLL
0x77D30000 - 0x77DA1000 C:\WINNT\system32\RPCRT4.DLL
0x78000000 - 0x78046000 C:\WINNT\system32\MSVCRT.dll
0x6D420000 - 0x6D4EE000 c:\bea\jdk131\jre\bin\hotspot\jvm.dll
0x77E10000 - 0x77E75000 C:\WINNT\system32\USER32.dll
0x77F40000 - 0x77F7C000 C:\WINNT\system32\GDI32.DLL
0x77570000 - 0x775A0000 C:\WINNT\System32\WINMM.dll
0x6D220000 - 0x6D227000 c:\bea\jdk131\jre\bin\hpi.dll
0x6D3B0000 - 0x6D3BD000 c:\bea\jdk131\jre\bin\verify.dll
0x6D250000 - 0x6D266000 c:\bea\jdk131\jre\bin\java.dll
0x6D3C0000 - 0x6D3CD000 c:\bea\jdk131\jre\bin\zip.dll
0x6D2A0000 - 0x6D2BB000 c:\bea\jdk131\jre\bin\jdwp.dll
0x6D1D0000 - 0x6D1D5000 c:\bea\jdk131\bin\dt_socket.dll
0x75030000 - 0x75043000 C:\WINNT\System32\ws2_32.dll
0x75020000 - 0x75028000 C:\WINNT\System32\WS2HELP.DLL
0x74FD0000 - 0x74FED000 C:\WINNT\system32\msafd.dll
0x75010000 - 0x75017000 C:\WINNT\System32\wshtcpip.dll
0x6D340000 - 0x6D348000 C:\bea\jdk131\jre\bin\net.dll
0x75050000 - 0x75058000 C:\WINNT\System32\WSOCK32.dll
0x782C0000 - 0x782CC000 C:\WINNT\System32\rnr20.dll
0x77980000 - 0x779A4000 C:\WINNT\System32\DNSAPI.DLL
0x77340000 - 0x77353000 C:\WINNT\System32\iphlpapi.dll
0x77520000 - 0x77525000 C:\WINNT\System32\ICMP.DLL
0x77320000 - 0x77337000 C:\WINNT\System32\MPRAPI.DLL
0x75150000 - 0x75160000 C:\WINNT\System32\SAMLIB.DLL
0x75170000 - 0x751BF000 C:\WINNT\System32\NETAPI32.DLL
0x77BE0000 - 0x77BEF000 C:\WINNT\System32\SECUR32.DLL
0x751C0000 - 0x751C6000 C:\WINNT\System32\NETRAP.DLL
0x77950000 - 0x7797A000 C:\WINNT\system32\WLDAP32.DLL
0x77A50000 - 0x77B45000 C:\WINNT\system32\OLE32.DLL
0x779B0000 - 0x77A4B000 C:\WINNT\system32\OLEAUT32.DLL
0x773B0000 - 0x773DE000 C:\WINNT\System32\ACTIVEDS.DLL
0x77380000 - 0x773A2000 C:\WINNT\System32\ADSLDPC.DLL
0x77830000 - 0x7783E000 C:\WINNT\System32\RTUTILS.DLL
0x77880000 - 0x7790D000 C:\WINNT\System32\SETUPAPI.DLL
0x77C10000 - 0x77C6E000 C:\WINNT\System32\USERENV.DLL
0x774E0000 - 0x77512000 C:\WINNT\System32\RASAPI32.DLL
0x774C0000 - 0x774D1000 C:\WINNT\System32\RASMAN.DLL
0x77530000 - 0x77552000 C:\WINNT\System32\TAPI32.DLL
0x71730000 - 0x717BA000 C:\WINNT\system32\COMCTL32.DLL
0x70BD0000 - 0x70C20000 C:\WINNT\system32\SHLWAPI.DLL
0x77360000 - 0x77379000 C:\WINNT\System32\DHCPCSVC.DLL
0x777E0000 - 0x777E8000 C:\WINNT\System32\winrnr.dll
0x777F0000 - 0x777F5000 C:\WINNT\System32\rasadhlp.dll
0x10000000 - 0x10055000
C:\bea\wlserver6.1\bin\oci901_8\weblogicoci37.dll
0x0DE20000 - 0x0DE3A000 C:\Oracle\Ora81\BIN\OCI.dll
0x780A0000 - 0x780B2000 C:\WINNT\System32\MSVCIRT.dll
0x60400000 - 0x60502000 C:\Oracle\Ora81\BIN\OraClient8.Dll
0x60600000 - 0x60682000 C:\Oracle\Ora81\BIN\oracore8.dll
0x60800000 - 0x60848000 C:\Oracle\Ora81\BIN\oranls8.dll
0x0DE40000 - 0x0DE46000 C:\Oracle\Ora81\BIN\oravsn8.dll
0x60200000 - 0x60264000 C:\Oracle\Ora81\BIN\oracommon8.dll
0x60000000 - 0x6011F000 C:\Oracle\Ora81\BIN\orageneric8.dll
0x60350000 - 0x60356000 C:\Oracle\Ora81\BIN\orawtc8.dll
0x60A00000 - 0x60A2B000 C:\Oracle\Ora81\BIN\oranl8.dll
0x60B00000 - 0x60BAA000 C:\Oracle\Ora81\BIN\oran8.dll
0x60E00000 - 0x60E10000 C:\Oracle\Ora81\BIN\orancrypt8.dll
0x61100000 - 0x61137000 C:\Oracle\Ora81\BIN\oranro8.dll
0x0DE50000 - 0x0DEAE000 C:\Oracle\Ora81\BIN\orannzsbb8.dll
0x61500000 - 0x6150E000 C:\Oracle\Ora81\BIN\oranldap8.dll
0x61700000 - 0x6171C000 C:\Oracle\Ora81\BIN\oraldapclnt8.dll
0x61900000 - 0x61906000 C:\Oracle\Ora81\BIN\oranhost8.dll
0x62100000 - 0x62106000 C:\Oracle\Ora81\BIN\oranoname8.dll
0x0DEB0000 - 0x0DEB6000 C:\Oracle\Ora81\BIN\orancds8.dll
0x62300000 - 0x62306000 C:\Oracle\Ora81\BIN\orantns8.dll
0x62500000 - 0x62508000 C:\Oracle\Ora81\BIN\orannds8.dll
0x0DEC0000 - 0x0DEDC000 C:\Oracle\Ora81\BIN\orannms8.dll
0x62700000 - 0x62741000 C:\Oracle\Ora81\BIN\ORATRACE8.dll
0x62900000 - 0x62B1B000 C:\Oracle\Ora81\BIN\orapls8.dll
0x63100000 - 0x63108000 C:\Oracle\Ora81\BIN\oraslax8.dll
0x63200000 - 0x63272000 C:\Oracle\Ora81\BIN\orasql8.dll
0x64700000 - 0x6470C000 C:\Oracle\Ora81\bin\orantcp8.dll
0x64500000 - 0x6450D000 C:\Oracle\Ora81\bin\orannts8.dll
0x75500000 - 0x75504000 C:\WINNT\System32\security.dll
0x782D0000 - 0x782EE000 C:\WINNT\system32\msv1_0.dll
0x11260000 - 0x11265000 C:\bea\wlserver6.1\bin\wlntio.dll
0x77920000 - 0x77943000 C:\WINNT\system32\imagehlp.dll
0x72A00000 - 0x72A2D000 C:\WINNT\system32\DBGHELP.dll
0x690A0000 - 0x690AB000 C:\WINNT\System32\PSAPI.DLL
Local Time = Thu Apr 03 17:31:00 2003
Elapsed Time = 327
# The exception above was detected in native code outside the VM
# Java VM: Java HotSpot(TM) Client VM (1.3.1_01 interpreted mode)
So now we have a situation where - we can crash either server with a
call to a function. We can now run the spcursors.java example without
problem. The procedure that does crash the WLS can be run successfully
from within sqlplus (it involves multiple subqueries and outer joins).
FYI - the cursors we are returning in the function are weak cursor
types (TYPE ref_cursor IS REF CURSOR)
Any other suggestions greatly welcomed.
Tony
Mitesh Patel <[email protected]> wrote in message
news:<[email protected]>...
Please do the following:
Make sure you have login delay sec=1 for connection pool in config.xml
Should have TestConnOnReserve=true
and use 901 driver instead of 817 driver. Using suggested driver, stillyou can connect to
your original database.
Thanks,
Mitesh
Tony Ross wrote:
Can anyone make a suggestion
We are experiencing a problem that causes our Weblogic Server to crash
when a JDBC call is made to our Oracle database.
Host Details
Operating System: Solaris Version 8
SunOS 5.8 Generic_108528-15 sun4u sparc SUNW,UltraAX-i2
WebLogic Server 6.1 SP1 09/18/2001 14:28:44 #138716
Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
JDBC Driver Weblogic JDriver for Oracle
The jdbc command that causes the problem is similar the spcursor
example code file:
// Here we prepare a CallableStatement using a WebLogic extension
// to JDBC that supports binding an Oracle cursor to an output
// parameter. Register the output parameter type as OTHER . . .
cstmt =
(weblogic.jdbc.common.OracleCallableStatement)conn.prepareCall("BEGIN
OPEN ? FOR select * from emp; END;");
cstmt.registerOutParameter(1, java.sql.Types.OTHER);
The crash happens when the re.next() method is invoked after the
execute()
This is the core dump message that is generated:
An unexpected exception has been detected in native code outside the
VM.
Unexpected Signal : 11 occurred at PC=0xd339f37c
Function name=kpcxk2u
Library=/u01/app/oracle/product/8.1.7/lib/libclntsh.so.8.0
Current Java thread:
at weblogic.db.oci.OciCursor.arrayFetch(Native Method)
atweblogic.db.oci.OciCursor.oci_arrayFetch(OciCursor.java:2002)
at weblogic.jdbc.oci.ResultSet.next(ResultSet.java:759)
at weblogic.jdbc.pool.ResultSet.next(ResultSet.java:180)
atweblogic.jdbc.rmi.internal.ResultSetImpl.next(ResultSetImpl.java:132)
atweblogic.jdbc.rmi.internal.ResultSetImpl_WLSkel.invoke(Unknown
Source)
atweblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:296)
atweblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:265)
atweblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:
atweblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
Dynamic libraries:
0x10000/opt/bea/jdk131/jre/bin/../bin/sparc/native_threads/java
0xff350000 /usr/lib/libthread.so.1
0xff390000 /usr/lib/libdl.so.1
0xff200000 /usr/lib/libc.so.1
0xff330000 /usr/platform/SUNW,UltraAX-i2/lib/libc_psr.so.1
0xfe480000 /opt/bea/jdk131/jre/lib/sparc/hotspot/libjvm.so
0xff2e0000 /usr/lib/libCrun.so.1
0xff1e0000 /usr/lib/libsocket.so.1
0xff100000 /usr/lib/libnsl.so.1
0xff0d0000 /usr/lib/libm.so.1
0xff310000 /usr/lib/libw.so.1
0xff0b0000 /usr/lib/libmp.so.2
0xff080000 /opt/bea/jdk131/jre/lib/sparc/native_threads/libhpi.so
0xff050000 /opt/bea/jdk131/jre/lib/sparc/libverify.so
0xfe440000 /opt/bea/jdk131/jre/lib/sparc/libjava.so
0xff020000 /opt/bea/jdk131/jre/lib/sparc/libzip.so
0xfe230000 /opt/bea/jdk131/jre/lib/sparc/libnet.so
0xfe160000 /usr/lib/nss_files.so.1
0xd3700000/opt/bea/wlserver6.1/lib/solaris/oci817_8/libweblogicoci37.so
0xd3000000 /u01/app/oracle/product/8.1.7/lib/libclntsh.so.8.0
0xfd090000 /usr/lib/libC.so.5
0xfd3b0000 /u01/app/oracle/product/8.1.7/lib/libwtc8.so
0xfd070000 /usr/lib/libgen.so.1
0xfd050000 /usr/lib/libsched.so.1
0xfd020000 /usr/lib/libaio.so.1
0xfafd0000 /opt/bea/wlserver6.1/lib/solaris/libmuxer.so
Local Time = Thu Apr 3 10:39:37 2003
Elapsed Time = 178
# The exception above was detected in native code outside the VM
# Java VM: Java HotSpot(TM) Client VM (1.3.1-b24 mixed mode)
# An error report file has been saved as hs_err_pid7599.log.
# Please refer to the file for further information.
Abort - core dumped
TIA
Tony -
Problem in more than one Routines in Pricing Procedure
Hi,
I have one pricing procedure. I have created two 971 & 981 routines (CalType) as per my requirements. The issue is that both the routines are not working correctly if they are assigned together is the pricing procedure. But if I assign any one of them only then they work work together.
I tried putting the Break-Point in both the routines and found that the control is passed to the first routine i.e 971 only and not 981 when it's corresponding condition type is entered.
I have activated both the routines nad executed the report RV80HGEN also.
Kindly advise a solution. ThanksHi Aparna,
thanks for the reply.
I am assigning different routines to different condition types. and according to the steps sequence 971 comes first and then comes 981. However i am able to go into Debug Mode in 971 but not in 981.
I am not able to understand this sort of behaviour. Kindly elaborate your solution.
Thanks. -
OCI8: returning cursors from stored procedures
The short version of my question is:
In OCI8, how do open a cursor from the database stored procedure, return it to my C++ program and fetch from it, given that in OCI8 cursors and cursor functions are becoming obsoleted?
The long version of the same question is:
I am converting my C++ code from the Oracle 7.3 OCI driver to the Oracle8 OCI driver. One thing I did very frequently in Oracle 7.3 OCI code is open a multi-row select cursor within a stored procedure and return that cursor to my program. In the program, I would then do the fetching with the returned cursor. This was very useful, as it allows me to change the queries in the stored procedure (for example, to append information to certain columns or make some data in all uppercase) without recompiling the application due to a changed SQL string.
My 7.3 psuedocode is as follows:
stored procedure def:
TYPE refCurTyp IS REF CURSOR;
FUNCTION LoadEmployeeData RETURN refCurTyp;
stored procedure body:
FUNCTION LoadEmployeeData RETURN refCurTyp IS
aCur refCurTyp;
BEGIN
OPEN aCur FOR
SELECT emp_id, emp_name
FROM employee_table
ORDER BY emp_name;
return aCur;
END;
OCI code: // all functions are simplified, not actual parameter listing
// declare main cursor variable #1 and return cursor variable #2
Cda_Def m_CDAstmt, m_CDAfunction;
// open both cursors
oopen(m_CDAstmt, ...);
oopen(m_CDAfunction, ...);
// bind cursor variable to cursor #2
oparse(&m_CDAstmt, "BEGIN :CUR := MYPACKAGE.LoadEmployeeData; END;");
obindps(&m_CDAstmt, SQLT_CUR, ":CUR", &m_CDAfunction);
// run cursor #1
oexn(&m_CDAstmt);
// bind variables from cursor #2, and fetch
odefineps(&m_CDAfunction, 1, SQLT_INT, &m_iEmpId);
odefineps(&m_CDAfunction, 2, SQLT_CHAR, &m_pEmpName);
while (!ofen(&m_CDAfunction))
// loop: do something with fetch
// values placed in m_iEmpID and m_pEmpName
This works perfectly, and has really helped to make my code more maintainable. Problem is, in Oracle 8 OCI both cursors and the cursor functions (such as oopen()) are becoming obsoleted. Now it uses statement and environment handles. I know I can still use Cda_Def and cursors--for a while--within OCI8, but I need to know the official up-to-date method of returning a cursor from the database and fetching within my C++ code. Any code fragment, or explanation of what I need to do in OCI8 would be appreciated (perhaps I need to bind to a statement handle instead? But the stored procedure still returns a cursor.)
The Oracle8 OCI has a new SQLT_ type, SQLT_RSET, which the header file defines as "result set type". Unfortunately, it's almost completely undocumented in the official documentation. Am I supposed to use this instead of the obsolete SQLT_CUR?
Thanks,
Glen MazzaEmail me diorectly and I will get you some code that might help. I fail to see the relevance of posting this type of information in the JDeveloper forum.
Maybe you are looking for
-
Exclusão em massa de DEPÓSITOS associados ao CADASTRO DE ITEM
Bom dia experts! Estou com um problema resultante de um processo que necessito alterar. Em um processo de implantação, o cliente utilizou a configuração de TODOS OS DEPÓSITOS PARA TODOS OS ITENS. Ou seja, em um universo de 5000 itens, tenho 150 DEPÓS
-
URGENT:Income Tax Problem in Payroll
Hi dear friends, when India payroll is run the Conveyance Allowance is not considering for Income TAX Exemption. I had assigned the TAX Code correctly with limit 800 per month. When i check the technical Wage Type /130 ,it contains only HRA amount wh
-
Install of itunes v 12.1 fails on windows 8.1
I have just tried to update iTunes to 12.1 on Windows 8.1 and it fails looking for iTunes.msi file. I tried downloading software then installing but it also fails. Now iTunes has stopped working. Any suggestions folks? Thanks Allan
-
Problem in ME_READ_PO_FOR_PRINTING
Hi All, Can somebody please let me know from where do we get the input parameters NAST and ENT_SCREEN for the function module ME_READ_PO_FOR_PRINTING for the program FM06PE02. Thanks !!!
-
How to use Satellite P100 with MS Vista and MS Bluetooth stack?
I'm using my Sat P100 for more than one year. I just reinstalled Windows Vista Ultimate from scratch, and because I'm really not so much satisfied with Toshiba's Bluetooth stack, I'm trying to use original Microsoft's Bluetooth stack, which comes wit