REFERENCE CURSOR NOT CLOSING - Urgent!!!!!!
I have some Oracle Stored Fucntions which return REFERENCE TYPE CURSOR. I noticed they are not closing. I even tried the following , but no luck. Any help is much needed.
PACKAGE Types
AS
PRAGMA SERIALLY_REUSABLE;
TYPE ref_cursor IS REF CURSOR;
END Types;
Thanks Justin.
As you have replied to my query , I am placing the next again.
I am using the following code :
counter = 1;
parm_status = OCIParamGet(stmthp, OCI_HTYPE_STMT, errhp, &mypard, (ub4) counter);
/* Loop only if a descriptor was successfully retrieved for
current position, starting at 1 */
while (parm_status==OCI_SUCCESS)
/* Retrieve the data type attribute */
OCIAttrGet((dvoid*) mypard, (ub4)OCI_DTYPE_PARAM, (dvoid*) &dtype,(ub4 *) 0, (ub4) OCI_ATTR_DATA_TYPE, (OCIError *) errhp );
When I have a stored proc with a reference cursor open then the above code works fine. But if I close the cursor before returning from the procedure then in the above case OCIParamGet() is returning a parameter descriptor , which raises unhandled exception when being called from OCIAttrGet().
I think as the memory got freed where the reference cursor points , oracle should return some exception that could be handled but instead I receive unhandled exception.
Is this a problem with Oracle or I need to something else at the client side.
Please let me know all your views.
Regards
Sutanu
Similar Messages
-
Cursors are not closed when using Ref Cursor Query in a report ORA-01000
Dear Experts
Oracel database 11g,
developer suite 10.1.2.0.2,
application server 10.1.2.0.2,
Windows xp platform
For a long time, I'm hitting ORA-01000
I have a 2 group report (master and detail) using Ref Cusor query, when this report is run, I found that it opens several cursors (should be only one cursor) for the detail query although it should not, I found that the number of these cursors is equal to the number of master records.
Moreover, after the report is finished, these cursors are not closed, and they are increasing cumulatively each time I run the report, and finally the maximum number of open cursors is exceeded, and thus I get ORA-01000.
I increased the open cursors parameter for the database to an unbeleivable value 30000, but of course it will be exceeded during the session because the cursors are increasing cumulatively.
I Found that this problem is solved when using only one master Ref Cursor Query and create a breake group, the problem is solved also if we use SQL Query instead of Ref Query for the master and detail queries, but for some considerations, I should not use neither breake group nor SQL Query, I have to use REF Cursor queries.
Is this an oracle bug , and how can I overcome ?
Thanks
Edited by: Mostafa Abolaynain on May 6, 2012 9:58 AMThank you Inol for your answer, However
Ref Cursor give me felxibility to control the query, for example see the following query :
function QR_1RefCurDS return DEF_CURSORS.JOURHEAD_REFCUR is
temp_JOURHEAD DEF_CURSORS.JOURHEAD_refcur;
v_from_date DATE;
v_to_date DATE;
V_SERIAL_TYPE number;
begin
SELECT SERIAL_TYPE INTO V_SERIAL_TYPE
FROM ACC_VOUCHER_TYPES
where voucher_type='J'
and IDENT_NO=:IDENT
AND COMP_NO=TO_NUMBER(:COMPANY_NO);
IF :no_date=1 then
IF V_SERIAL_TYPE =1 THEN
open temp_JOURHEAD for select VOCH_NO, VOCH_DATE
FROM JOURHEAD
WHERE COMP_NO=TO_NUMBER(:COMPANY_NO)
AND IDENT=:IDENT
AND ((TO_NUMBER(VOCH_NO)=:FROM_NO and :FROM_NO IS NOT NULL AND :TO_NO IS NULL)
OR (TO_NUMBER(VOCH_NO) BETWEEN :FROM_NO AND :TO_NO and :FROM_NO IS NOT NULL AND :TO_NO IS NOT NULL )
OR (TO_NUMBER(VOCH_NO)<=:TO_NO and :FROM_NO IS NULL AND :TO_NO IS NOT NULL )
OR (:FROM_NO IS NULL AND :TO_NO IS NULL ))
ORDER BY TO_NUMBER(VOCH_NO);
ELSE
open temp_JOURHEAD for select VOCH_NO, VOCH_DATE
FROM JOURHEAD
WHERE COMP_NO=TO_NUMBER(:COMPANY_NO)
AND IDENT=:IDENT
AND ((VOCH_NO=:FROM_NO and :FROM_NO IS NOT NULL AND :TO_NO IS NULL)
OR (VOCH_NO BETWEEN :FROM_NO AND :TO_NO and :FROM_NO IS NOT NULL AND :TO_NO IS NOT NULL )
OR (VOCH_NO<=:TO_NO and :FROM_NO IS NULL AND :TO_NO IS NOT NULL )
OR (:FROM_NO IS NULL AND :TO_NO IS NULL ))
ORDER BY VOCH_NO;
END IF;
ELSE
v_from_date:=to_DATE(:from_date);
v_to_date:=to_DATE(:to_date);
IF V_SERIAL_TYPE =1 THEN
open temp_JOURHEAD for select VOCH_NO, VOCH_DATE
FROM JOURHEAD
WHERE COMP_NO=TO_NUMBER(:COMPANY_NO)
AND IDENT=:IDENT
AND ((voch_date between v_from_date and v_to_date and :from_date is not null and :to_date is not null)
OR (voch_date <= v_to_date and :from_date is null and :to_date is not null)
OR (voch_date = v_from_date and :from_date is not null and :to_date is null)
OR (:from_date is null and :to_date is null ))
ORDER BY VOCH_DATE,TO_NUMBER(VOCH_NO);
ELSE
open temp_JOURHEAD for select VOCH_NO, VOCH_DATE
FROM JOURHEAD
WHERE COMP_NO=TO_NUMBER(:COMPANY_NO)
AND IDENT=:IDENT
AND ((voch_date between v_from_date and v_to_date and :from_date is not null and :to_date is not null)
OR (voch_date <= v_to_date and :from_date is null and :to_date is not null)
OR (voch_date = v_from_date and :from_date is not null and :to_date is null)
OR (:from_date is null and :to_date is null ))
ORDER BY VOCH_DATE,VOCH_NO;
END IF;
END IF;
return temp_JOURHEAD;
end; -
When cursor is not closed what error will occur.
when many cursors are in open and no cursor is closed means what error will occur..
ORA-01000
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1041031921901
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:685336504294
etc... -
I am using Veristand 2014, Scan Engine and EtherCat Custom Device. I have not had this error before, but I was trying to deploy my System Definition File (run) to the Target (cRio 9024 with 6 modules) and it failed. It wouldn't even try to communicate with the target. I get the 'connection refused' error.
I created a new Veristand project
I added the Scan Engine and EtherCat custom device.
I changed the IP address and auto-detected my modules
i noticed tat Veristand didn't find one of my modules that was there earlier. (this week)
So, i went to NiMax to make sure software was installed and even reinstalled Scan Engine and Veristand just to make sure.
Now, it finds the module, but when i go to deploy it getsto the last step of deploying the code to the target, and then it fails.
Any thoughts?
Start Date: 4/10/2015 11:48 AM
• Loading System Definition file: C:\Users\Public\Documents\National Instruments\NI VeriStand 2014\Projects\testChassis\testChassis.nivssdf
• Initializing TCP subsystem...
• Starting TCP Loops...
• Connection established with target Controller.
• Preparing to synchronize with targets...
• Querying the active System Definition file from the targets...
• Stopping TCP loops.
Waiting for TCP loops to shut down...
• TCP loops shut down successfully.
• Unloading System Definition file...
• Connection with target Controller has been lost.
• Start Date: 4/10/2015 11:48 AM
• Loading System Definition file: C:\Users\Public\Documents\National Instruments\NI VeriStand 2014\Projects\testChassis\testChassis.nivssdf
• Preparing to deploy the System Definition to the targets...
• Compiling the System Definition file...
• Initializing TCP subsystem...
• Starting TCP Loops...
• Connection established with target Controller.
• Sending reset command to all targets...
• Preparing to deploy files to the targets...
• Starting download for target Controller...
• Opening FTP session to IP 10.12.0.48...
• Processing Action on Deploy VIs...
• Setting target scan rate to 10000 (uSec)... Done.
• Gathering target dependency files...
• Downloading testChassis.nivssdf [92 kB] (file 1 of 4)
• Downloading testChassis_Controller.nivsdat [204 kB] (file 2 of 4)
• Downloading CalibrationData.nivscal [0 kB] (file 3 of 4)
• Downloading testChassis_Controller.nivsparam [0 kB] (file 4 of 4)
• Closing FTP session...
• Files successfully deployed to the targets.
• Starting deployment group 1...
The VeriStand Gateway encountered an error while deploying the System Definition file.
Details:
Error -66212 occurred at Project Window.lvlibroject Window.vi >> Project Window.lvlib:Command Loop.vi >> NI_VS Workspace ExecutionAPI.lvlib:NI VeriStand - Connect to System.vi
Possible reason(s):
LabVIEW: The data type of the reference does not match the data type of the variable.
=========================
NI VeriStand: NI VeriStand Engine.lvlib:VeriStand Engine Wrapper (RT).vi >> NI VeriStand Engine.lvlib:VeriStand Engine.vi >> NI VeriStand Engine.lvlib:VeriStand Engine State Machine.vi >> NI VeriStand Engine.lvlib:Initialize Inline Custom Devices.vi >> Custom Devices Storage.lvlib:Initialize Device (HW Interface).vi
• Sending reset command to all targets...
• Stopping TCP loops.
Waiting for TCP loops to shut down...
• TCP loops shut down successfully.
• Unloading System Definition file...
• Connection with target Controller has been lost.Can you deploy if you only have the two 9401 modules in the chassis (no other modules) and in the sysdef? I meant to ask if you could attach your system definition file to the forum post so we can see it as well (sorry for the confusion).
Are you using any of the specialty configurations for the 9401 modules? (ex: counter, PWM, quadrature, etc)
You will probably want to post this on the support page for the Scan Engine/EtherCAT Custom Device: https://decibel.ni.com/content/thread/8671
Custom devices aren't officially supported by NI, so technical questions and issues are handled on the above page.
Kevin W.
Applications Engineer
National Instruments -
Using Reference Cursor Performance Issue in Report
Hi,
Are reference cursor supposed to be faster than a normal query? The reason why I am asking is because I am using a reference cusor query in the data model and it has a performance issue on the report, it's taking quite a while to run than If I just run the same reference cursor query in sql*plus. The difference is significantly big. Any input is very much appreciated!
Thanks,
MarilynFrom the metalink bug 4372868 on 9.0.4.x. It was fixed on 10.1.2.0.2 and does not have a backport for any 9.0.4 version.
Also the 9.0.4 version is already desupported. Please see the note:
Note 307042.1
Topic: Desupport Notices - Oracle Products
Title: Oracle Reports 10g 9.0.4 & 9.0.4.x
Action plan:
If you are still on 9.0.4 and later version of oracle reports and have no plan yet to migrate to 10.1.2.0.2 version use the same query you are using in your reference cursor and use it as a plain SQL query in your reports data model. -
SQLException: Cursor is closed while calling a java stored procedure
Hi,
I got the following error when trying to read from a cursor of a java stored procedure:
java.sql.SQLException: Cursor is closed
The java procedure is stored in the database and wrapped by a sql call. Then another java class executes the sql call.
The stored procedure looks like this:
import java.io.Reader; import java.security.MessageDigest; import java.sql.*; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; import oracle.jdbc.OracleCallableStatement; import oracle.jdbc.OracleConnection; public class test { static Connection conn = null; static String username = null; static String password = null; static Integer userid = null; public static void main(String args[]) throws Exception { username = "keller"; password = "945435"; login(username, password); } public static String login(String in_username, String in_password) { String access = null; String password = null; try { DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); // Non OracleVM System.out.print("Verbindung wird initialisiert... "); conn = //DriverManager.getConnection("jdbc:default:connection:"); //conn.setAutoCommit(false); DriverManager.getConnection("jdbc:oracle:thin:@[...]:1521:[...]","[...]","[...]"); System.out.println("OK"); System.out.print("Logindaten werden ueberprueft... "); String sql = "SELECT matrikelnr, password FROM student WHERE name = ?"; PreparedStatement pstmt = conn.prepareStatement(sql); pstmt.setString(1, in_username); ResultSet rset = pstmt.executeQuery(); while (rset.next()) { userid = rset.getInt(1); password = rset.getString(2); } access = "student"; pstmt = conn.prepareStatement(sql); if (password == null) { sql = "SELECT dozentnr, password FROM dozent WHERE name = ?"; pstmt = conn.prepareStatement(sql); pstmt.setString(1, in_username); rset = pstmt.executeQuery(); while (rset.next()) { userid = rset.getInt(1); password = rset.getString(2); } pstmt = conn.prepareStatement(sql); if (password == null) { throw new SQLException("User nicht gefunden!"); } access = "dozent"; } //rset.close(); // Resultset schließen //pstmt.close(); // Statement schließen // MD5 Hash vergleichen MessageDigest md5 = MessageDigest.getInstance("MD5"); md5.reset(); md5.update(in_password.getBytes()); byte[] result = md5.digest(); StringBuffer hexString = new StringBuffer(); for (int i=0; i<result.length; i++) { if(result[i] <= 15 && result[i] >= 0){ hexString.append("0"); } hexString.append(Integer.toHexString(0xFF & result));
if (password != null) {
if (password.equals(hexString.toString())) {
System.out.println("OK");
} else {
throw new Exception("Falsches Passwort!");
catch(SQLException e) {
System.err.println("SQL Fehler!");
System.err.println(e.getMessage());
catch(Exception e) {
System.err.println("Fehler!");
System.err.println(e.getMessage());
return access;
public static void getLeistungsschein(int matrikelnr, ResultSet[] rout)
ResultSet rs = null;
try
System.out.print("Berechtigung ueberpruefen... ");
if (userid != matrikelnr)
throw new Exception("Zugriff verweigert, keine Berechtigung!");
int mnr = matrikelnr;
((OracleConnection)conn).setCreateStatementAsRefCursor(true);
PreparedStatement ps = conn.prepareStatement("select bezeichnung, note from klausur inner join leistungsschein on klausur.KLAUSURNR=leistungsschein.KLAUSURNR where matrikelnr= ?");
ps.setInt(1, mnr);
rs = (ResultSet)ps.executeQuery();
rout[0]= rs;
catch(SQLException e) {
System.err.println("Fehler!");
System.err.println(e.getMessage());
catch(Exception e) {
System.err.println("Fehler!");
System.err.println(e.getMessage());
The sql call:
create or replace
procedure pgetleistungsschein(matrikelnr in number, cur OUT refcurpkg.refcur_t) is
language java name 'Klausurverwaltung.getLeistungsschein(int, java.sql.ResultSet[])';
And finally the wrapper is called by another java programm, see this:
import java.sql.*;
import java.util.ArrayList;
import java.util.List;
import oracle.jdbc.OracleCallableStatement;
import oracle.jdbc.OracleResultSet;
import oracle.jdbc.OracleTypes;
public class cursortest {
public static void main(String[] args) {
try{
//-- Oracle Treiber laden
Class.forName( "oracle.jdbc.driver.OracleDriver" );
Connection c = DriverManager.getConnection( "jdbc:oracle:thin:@sligo.fh-trier.de:1521:ubuntu", "dbsem_java","javajava");
CallableStatement stmt = null;
ResultSet rs1 = null;
int matrnr = 945098;
// Call PLSQL Stored Procedure
stmt = (CallableStatement)c.prepareCall("{ call ? := getklausuren(?) }");
stmt.setInt(2, matrnr);
// 2nd parameter is OUT paremeter
stmt.registerOutParameter(1, OracleTypes.CURSOR);
// Execute the callable statement
stmt.execute();
//Cursor in ResultSet einlesen
rs1 = ((OracleCallableStatement)stmt).getCursor(1);
ResultSetMetaData rsmd = rs1.getMetaData();
int anzSpalten = rsmd.getColumnCount();
List<String[]> zeilen = new ArrayList<String[]>();
while(rs1.next())
String[] zeile = new String[anzSpalten];
for (int i=1; i<=anzSpalten; i++)
zeile[i-1]=rs1.getString(i);
zeilen.add(zeile);
String[][] array_angeb_klaus = (String[][])zeilen.toArray(new String[zeilen.size()][anzSpalten]);
//**** ENDE
rs1.close();
stmt.close();
//c.close();
catch (SQLException e){
System.out.println(e);
catch (ClassNotFoundException f){
System.out.println(f);On top of what jschell says, this just looks wrong in terms of how Oracle's internal Java works as well.
[Have a look here |http://www.oracle.com/technology/sample_code/tech/java/codesnippet/jdbc/refcur/index.html] (unless things have changed significantly over the past few years for Oracle Java).
Is the db you are querying a different one to the one this Java is stored in? -
2nd Document window not closing
I have 2 Document windows,
- win1 is parent window.
- win2 is a small window with 3 display fields
and 2 buttons OK & Cancel.
- other setting for 'win2' is
Modal = 'YES'
Close Allowed = 'YES'
i have problem with Cancel button code, i am giving
if :SYSTEM.EVENT_WINDOW = 'WIN2' then
GO_ITEM('CTRL.FLD5');
HIDE_Window('WIN2');
end if;
The WIN2 is not closing,
i am calling this 'WIN2' from a WVI trigger of a field on parent window 'win1'
by issuing SHow_WINDOW('win2') command.
but it flashes error FRM-40737: illegal restricted Procedure SET_WINDOW_PROPERTY in WVI trigger.
Any one please suggest. TY.hi Sarah,
i dont to know to which item's WVI should i atttach this code.
Since the window Closed_Allowed property is set "yes".
the same code given at Form-level When-Widow-Closed, works well, closes the window in 1 click.
but i dont know the same code given for Cancel button, does not close 'win2',
One more point, first time when win2 is shown, that time, out of the [x] button on the status bar &
Cancel button on win2, if i use [x] button first, then 'win2' closes and cursor is back in CTRL.FLD5 on 'win1', fair enough.
then afterwards from CTRL.FLD5 when 'win2' is called again then the Cancel button code works fine just like the [x] button.
but the question is why not first time, if i choose Cancel button first. why it is required [x] button to be used first.
So the problems are;
- FRM-40737 is thrown whenever win2 in invoked from CTRL.FLD5
- 'WIN2' does not close by pressing Cancel button, when displayed first time. -
First time i am using reference cursors. My question is shall i use cursor For loop for reference cursor inorder to fetch the records. I have defined like this?
lsql varchar2(1000);
TYPE L_CurType IS REF CURSOR;
mm_cursor L_CurType;
begin
open mm_cursor for lsql;
For v_record in mm_cursor loop
end loop;
what's wrong in this code? I am getting error at For loop statement after open statement.Reference cursors are used for passing a result set to a client, they are not much use in PL/SQL.
Re: Testing a procedure that returns 2 REF CURSORs
In databases that are designed for set based processing, loops should be avoded unless you enjoy solving performance problems.
The performance problems caused by using loops in database code can usually be solved by rewriting the code to use set based processing, such as SQL updates, inserts and deletes, instead of a loop. -
Recursion with reference cursors
Hi,
I need to do a recursive SQL select in a report. Using reference
cursors I can do dynamic SQL selects. What do I need to do if I
must do this recursively. I run into cursor already open error
trying to close the cursor does not help as well.
Any ideas?
TIA
SrinivasOk, so you know how the if- test works, and you even seem to almost understand the code you have posted (presuming your professor has written the code, right?). Good start! I like the way you post the code and ask the question can it be done? It is far better than just writing please do my homework for me, because I am too lazy to do it myself...
Have a look in your programming book and reed the chapter about loops. It should give you an idea of how to solve your assignment.
And try posting to the right forum. This question belongs to the New To Java Technology forum. Later on you may advance to the Java Programming forum.
Good luck! -
Can we pass Reference cursor using dblink
Can we pass reference cursor from one DB to another DB using DBlink?
I feel like it is not possible because the memory structure of same will be available in other DB.
Could you please let me know whether we can give a work around which will solve the issue.
Regards,
BaluBalu, cursor is a memory area which contains parsed SQL statement and everything needed for
the execution of the SQL command. That, of course, is instance specific and carrying it over to another DB using db-link would make no sense whatsoever. -
Weak and Strongly Typed Reference Cursors in Reports
Our custom reports has been using a reference cursor. I have inherited the code and not sure why there is a need to use a reference cursor when it can be done by a simple select statements. I see no dynamic select statements passed or any special parameters to reason out for use of reference cursor in our custom reports. Prior developers had reason out the benefits of using reference cursor for performance. I tested this by running a report with reference cursor versus plain select statement and still the report that is using the plain select statement performed better (faster) than the report that has the reference cursor, there is a big difference.
I have seen some disadvantage of using reference cursor on the reports that when there is a database object change even if the package that sourced the reference cursor has not been updated or modified the reports needs to be recompiled each time we get this error message coming from the report server queue:
Terminated with error: <br>REP-8: Run time error in the PL/SQL development
environment (DE). PDE-PSD001 Could not resolve reference to <Unknown Program Unit>
while loading <Unknown> <Unknown>. REP-0008: Unexpected memory error while
initializing preferences.In 9iAS reports prior version the error is occurring rarely. When we moved to 10.1.2.2.0 reports it appears the error occurs most often. We have made an effort to research about the issue and appears to be a bug. One suggestion is to use a strongly typed reference cursor. I have tried to researched about the difference between a weak and strongly typed reference cursor but failed to understand them. I appreciate any help about examples differentiating a weak versus a strongly typed reference cursors.
Thanks,
WarrenI guess my point, for what it's worth, is that whether you use only a strongly typed REF CURSOR, or whether you also use a weakly typed REF CURSOR, you may still end up getting the REP-0008 error (at least if your report is in .REP format). You can avoid this by using a pipelined function instead (or by putting the SQL directly in the report, or possibly by using .RDF or .JSP format).
To test this, you might:
1. Create a database package with an SQL*Plus script that that looks something like this:
CREATE OR REPLACE PACKAGE TEST AS
TYPE RECORD_TYPE IS RECORD
USERNAME ALL_USERS.USERNAME%TYPE
TYPE TABLE_TYPE IS TABLE OF RECORD_TYPE;
TYPE WEAKLY_TYPED_REF_CURSOR_TYPE IS REF CURSOR;
TYPE STRONGLY_TYPED_REF_CURSOR_TYPE IS REF CURSOR RETURN RECORD_TYPE;
FUNCTION GET_WEAKLY_TYPED_REF_CURSOR RETURN WEAKLY_TYPED_REF_CURSOR_TYPE;
FUNCTION GET_STRONGLY_TYPED_REF_CURSOR RETURN STRONGLY_TYPED_REF_CURSOR_TYPE;
FUNCTION GET_PIPELINED_TABLE RETURN TABLE_TYPE PIPELINED;
END TEST;
CREATE OR REPLACE PACKAGE BODY TEST AS
FUNCTION GET_WEAKLY_TYPED_REF_CURSOR RETURN WEAKLY_TYPED_REF_CURSOR_TYPE
IS
cWeaklyTypedRefCursor WEAKLY_TYPED_REF_CURSOR_TYPE;
BEGIN
OPEN cWeaklyTypedRefCursor FOR
SELECT USERNAME FROM ALL_USERS;
RETURN cWeaklyTypedRefCursor;
END GET_WEAKLY_TYPED_REF_CURSOR;
FUNCTION GET_STRONGLY_TYPED_REF_CURSOR RETURN STRONGLY_TYPED_REF_CURSOR_TYPE
IS
cStronglyyTypedRefCursor WEAKLY_TYPED_REF_CURSOR_TYPE;
BEGIN
OPEN cStronglyyTypedRefCursor FOR
SELECT USERNAME FROM ALL_USERS;
RETURN cStronglyyTypedRefCursor;
END GET_STRONGLY_TYPED_REF_CURSOR;
FUNCTION GET_PIPELINED_TABLE
RETURN TABLE_TYPE PIPELINED
IS
BEGIN
FOR rec IN
SELECT USERNAME FROM ALL_USERS
LOOP
PIPE ROW(rec);
END LOOP;
END GET_PIPELINED_TABLE;
END TEST;
/2. Create a report based on REF CURSOR query using only a strongly typed REF CURSOR. The PL/SQL statement that you use in the report as the data source for the query might look something like this:
function QR_1RefCurDS return test.strongly_typed_ref_cursor_type is
begin
return test.get_strongly_typed_ref_cursor;
end;3. Compile the report to a .REP file and run it to make sure it works as expected.
4. Drop and re-create the TEST package in the database.
5. Try running the .REP file again. I expect you will get the REP-0008 error.
6. Modify the REF CURSOR query to use an underlying weakly typed REF CURSOR by changing the PL/SQL statement (from Step 2) to something like this:
function QR_1RefCurDS return test.strongly_typed_ref_cursor_type is
begin
return test.get_weakly_typed_ref_cursor;
end;7. Repeat Steps 3 through 5. I expect you will get the REP-0008 error again.
8. Replace the REF CURSOR query in report with an SQL query that looks something like this:
SELECT * FROM TABLE(TEST.GET_PIPELINED_TABLE)9. Repeat Steps 3 through 5. I expect you will not get the REP-0008 error.
Hope this helps. -
PLS-00357: Table,View Or Sequence reference 'A' not allowed in this context
Hello
I am accepting input values from users through java web page. To accept the values I am using the following code:
import java.sql.*;
import javax.sql.DataSource;
import javax.naming.*;
public class spsrch
public void spsrch()
public String espsrch(String p, String d, String a)
String s1= "";
String strColor="#C0C0C0";
try
InitialContext ctx = new InitialContext();
DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/Oracle9i");
Connection Con = ds.getConnection();
Statement stmt = Con.createStatement();
CallableStatement proc1stmt1=Con.prepareCall ("{call Allsch("+p+","+d+")}");
// ResultSet rs = proc1stmt1.execute();
proc1stmt1.executeUpdate();
Con.close();
catch(Exception e)
System.out.println("Flag Raised"+e);
return s1;
I am calling the procedure 'Allsch' to apply some logic before inserting data into a SQL table.
The 'Allsch' procedure is :
create or replace procedure tmpsch(pno varchar2,pdes varchar2) as
mpartnum varchar2(30);
mpn varchar2(30);
mdes varchar2(150);
cursor c1 is select partnum,description,aircraft_type from master_catalog where description like ltrim(rtrim(mdes))||'%' AND partnum like mpn||'%';
cursor c2 is select partnum from ipc_master where partnum=mpartnum;
cursor c3 is select partnum from fedlog_data where partnum=mpartnum;
cursor c4 is select partnum from superparts where partnum=mpartnum;
cursor c5 is select part_no from supplier_catalog where part_no=mpartnum;
mpno1 varchar2(30);
mpno2 varchar2(30);
mpno3 varchar2(30);
mpno4 varchar2(30);
mpno5 varchar2(30);
mdescription varchar2(150);
maircraft_type varchar2(15);
mstat varchar2(1);
mstat1 varchar2(30);
mstat2 varchar2(30);
mstat3 varchar2(30);
mstat4 varchar2(30);
begin
mstat:='N';
mpn:=pno;
mdes:=pdes;
for i in c1 loop
mstat:='N';
mstat1:='N';
mstat2:='N';
mstat3:='N';
mstat4:='N';
mpno1:=i.partnum;
mpartnum:=i.partnum;
mdescription:=i.description;
maircraft_type:=i.aircraft_type;
for j in c2 loop
mpno2:=j.partnum;
end loop;
for k in c3 loop
mpno3:=k.partnum;
end loop;
for l in c4 loop
mpno4:=l.partnum;
end loop;
for m in c5 loop
mpno5:=m.part_no;
end loop;
if mpno2=mpartnum then
mstat1:=mpno2;
end if;
if mpno3=mpartnum then
mstat2:=mpno3;
end if;
if mpno4=mpartnum then
mstat3:=mpno4;
end if;
if mpno5=mpartnum then
mstat4:=mpno5;
end if;
if mpno1=mpartnum then
mstat:='Y';
insert into tmpcat values(mpno1,mdescription,maircraft_type,mstat1,mstat2,mstat3,mstat4);
end if;
end loop;
end;
Java program compiling time, it not showing any error. But after executing, it is not inserting any data into 'tmpcat' table and throwing the following error :
Flag Raisedjava.sql.SQLException: ORA-06550: line 1, column 14:
PLS-00357: Table,View Or Sequence reference 'A' not allowed in this context
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
[07/22/03 11:47:38][executor-0][W]: Handling error; throwable is "null", status
code is "404" and message is "Not Found: /User/Ecatalog/Validations.js".
[07/22/03 11:47:38][executor-0][W]: Handling error; throwable is "null", status
code is "404" and message is "Not Found: /User/Ecatalog/Validations.js".
Any one please help me to solve the issue.
With thanks
Pramod kumar.
My Email-id is : [email protected]What are p and d in
"{call Allsch("+p+","+d+")}"
Something tells me you might need some quotes in this statement since they are varchar2. Maybe
"{call Allsch('"+p+"','"+d+"')}"
If this doesn't work try to cut off parts of the procedure until it works.
Mike -
Sync Issue: A string literal was not closed
Hi, my sharepoint has stopped syncing to skydrive. The issue I see is
Error Details:
Unable to parse SOAP response. XML Error: 0x-1072896672 'A string literal was not closed.
Can someone please help.
Thanks a lot.Hi BlingSingh,
According to your error message, it says that a XML file misses a closing tag and the skydrive client cannot parse SOAP response.
For the issue, please make sure your User profile service is running correctly and the My Site configure process is correct.
Also try to stop syncing the library and then re-syncing the library. Reference: Stop
syncing a library with SkyDrive Pro.
Best Regards,
Eric
Eric Tao
TechNet Community Support -
SAP Production Order not closing
Hi there,
I am running the COHV with Complete parameter in the background, and it does pick up several TECO orders from the past, like say from 2009 which are not closed but it does not process them to CLSD status.
I am seeing some entries in COHV, CO1P, COFC transactions - I picked a few randomly to check.
The order qty is not always equal to the delivered qty - Again a random test
The consumption qty on the components is not always equal to the required qty, which leaves reservation open - random check
Is all the above causing my order not to close ? where do I see the error log, when I try to close the order. I wrote the above issues based on my random check.
Thank youHi SAP Process,
When you run COHV to close the orders, you can see the log with the list of orders that have not been closed.
To see in detail what has happened you will need to check order by order.
Other option will we to evaluate each situation separatelly. You can check COGI, CO1P, see open reservations, check if you have TR or TO if you use WM, etc.. Once each situation is cleaned, you will be able to closed most of your production orders. It is quite common to create a custom report to make all these checks (COGI, TR/TOs, etc) and closed the orders.
Kind Regards,
Mariano -
Hi,
I try to generate a report using a template. In my template I use some cross-reference to refer to one bookmark. For exemple in the first page I created a bookmark for my name and in the header I created a cross-reference refer to my name. The problems is when I run my VI the bookmark actualise perfectly but the cross-reference refer to the bookmark can't actualise with the same value and generates an error : "Error! Reference source not found".
Can somebody help me please!
Nki
Solved!
Go to Solution.
Attachments:
01.jpg 72 KBHi,
When i create the word template, the bookmaks and the cross-reference referred to the bookmark update correctely. The problem is when I try to change the bookmark using "report generation from template vi" the bookmark change but not the cross-reference and the error generated is "Error! Reference source not found".
I make coople reasherch and i think they have no solution for this because : "if the text in a heading referred to in a cross-reference is revised, the cross-reference to the heading may no longer work" (http://office.microsoft.com/en-us/word-help/troubleshoot-cross-references-HP005189368.aspx).
To "resolved" this problem I create an other bookmark in the template who have the same value white the principle bookmark.
I use Labview 2011 and Micosoft office 2010.
Maybe you are looking for
-
Line item not relevant for payment release
Dear Expert, When I select payment block : 'Payment Request' in FB60. Error Message appear "Line item not relevant for payment release". I also have set payment block in master vendor and OBB8. Can you tell me why the error message still appear? Kin
-
I am on my third LCD screen and I am presently waiting for another LCD screen which of course is back ordered. I have been told that this is NOT a common problem. I have approx 100 colored lines on my screen at this time. Has anyone had any success w
-
Using APD process - What Transformation : BI to CRM
Hi All, I am New to APD Process, i want to send data from BI ( DSO - Standard ) to CRM( Data Traget) system What Tranformation process should i use? Thanks, Nithi.
-
Hi, Can some one explain me this issue SELECT COUNT(*) FROM "ECCDATA"."CUST1" O/P = 800 SELECT COUNT(*) FROM "ECCDATA"."CUST1" WHERE MANDT = '800' O/P = 800 SELECT COUNT(*) FROM "ECCDATA"."CUST2" O/P = 13779 SELECT COUNT(*) FROM "ECCDATA"."CUST2"
-
Performance of Export Layers to Files
Hi! I know of an Export Layers to Files script that comes with Adobe Photoshop CS4 that exports the layers of a Photoshop document as image files. It exports layer by layer with the aid of a loop. It first sets all layers as invisible, except the fir