Stored function not returning result set unless recompiled

Hi,
I have a strange situation going on with a basic Java (1.6.0.17) application talking to an Oracle 11g (11.2.0.1.0) database. Basically what is happening is that sometimes a stored function's return value (a result set) is not making it as far as JDBC/Java, unless I recompile the stored function (with absolutely no changes to the application or function's code). I am always able to successfully see the result set if I call the function directly from within SQL Developer, just not on the Java app/JDBC side.
I've tried running with 3 different physical Oracle 11g servers and tried running the app on a couple of machines. I'm wondering if this is either some kind of caching issue or perhaps a JDBC bug/misconfiguration.
Any help would be greatly appreciated. Attached to this message:
1. stored function code
2. snippet of Java app code
3. ODBC trace output when returned a empty result set (ie failure scenario)
4. ODBC trace out when returned the correct result set (ie success scenario)
* it's helpful if you compare the texts of 3 & 4 with Vim diff or WinMerge etc.
** as they're large I've just extracted the sections that had differences. Leave a message here and I can send you the full ones if necessary.
1. stored function code
===============
FUNCTION getRecordSet (
ActionId Number
RETURN CallingList.ref_cursor
IS
myDataCursor CallingList.ref_cursor;
ActionId_ Number;
BEGIN
ActionId_ := ActionId;
IF isActionExpired(ActionId) <= 0 THEN
ActionId_ := 0;
END IF;
OPEN myDataCursor FOR
SELECT
C.ID,
C.CUSTOMER_ID,
C.CAMPAIGN_ID,
c.phone,
C.TRANSFERDN,
(SELECT
TTS_MESSAGE
FROM CAMPAIGN CMP
WHERE CMP.CAMPAIGN_ID = C.CAMPAIGN_ID) "TTS"
FROM
CALLING_LIST C
WHERE
C.ACTION_ID = ActionId_
AND
C.CALL_STATUS = 1
AND
C.CALLCOUNT > 0
And rownum <=5;
RETURN myDataCursor;
EXCEPTION
WHEN CURSOR_ALREADY_OPEN THEN
RETURN NULL;
WHEN INVALID_CURSOR THEN
RETURN NULL;
WHEN NO_DATA_FOUND THEN
RETURN NULL;
END getRecordSet;
....and the isActionExpired function that is called from within getResultSet is (but for all my testing it's been returning 1 with no problems)
FUNCTION isActionExpired (
ActionId number
) RETURN number
AS
Today varchar2(12);
myCount number(6);
BEGIN
myCount := 0;
today := to_char(sysdate, 'dd.mm.yyyy');
SELECT
count(*)
INTO
myCount
FROM
ACTION A
where
ACTION_ID = ActionId
AND
SYSDATE BETWEEN ACTION_STARTDATETIME
AND
ACTION_STOPDATETIME
and
SYSDATE BETWEEN to_date(today || ' ' || A.STARTTIME, 'dd.mm.yyyy HH24:MI:SS') and to_date(today || ' ' || A.ENDTIME, 'dd.mm.yyyy HH24:MI:SS')
AND
ACTION_STATUS = 1;
return myCount;
END isActionExpired;
2. snippet of Java app code
=================
... db connect logic...
javax.management.MBeanServer mbs = null;
javax.management.ObjectName name = null;
try {
String loader = Thread.currentThread().getContextClassLoader().toString().replaceAll("[,=:\"]+", "");
name = new javax.management.ObjectName("com.oracle.jdbc:type=diagnosability,name="+loader);
mbs = java.lang.management.ManagementFactory.getPlatformMBeanServer();
mbs.setAttribute(name, new javax.management.Attribute("LoggingEnabled", true));
} catch (Exception e) {
System.out.println("ORACLE TRACE ERROR: " + e.getStackTrace());
try {
String query = "begin ? := CALLINGLIST.getRecordSet(?); end;";
CallableStatement stmt = conn.prepareCall(query);
stmt.registerOutParameter(1, OracleTypes.CURSOR);
stmt.setInt(2, actionId);
stmt.execute();
ResultSet rs = (ResultSet) stmt.getObject(1); // So, here it works.
// print the results
int count=0;
while (rs.next()) {
count++;
stmt.close();
System.out.println("rs count was: " + count);
} catch (SQLException e) {
System.out.println("Exception occurred: " + e.getMessage());
3. ODBC trace output when returned a empty result set (ie failure scenario)
===============================================
Jul 1, 2010 3:30:47 PM oracle.net.ns.Packet receive
TRACE_16: Enter:
Jul 1, 2010 3:30:47 PM oracle.net.ns.Packet receive
TRACE_20: Debug: type=6, length=121, flags=0
00 79 00 00 06 00 00 00 |.y......|
00 00 06 22 01 06 00 01 |..."....|
0A 00 00 00 07 03 C2 04 |........|
0E 04 C3 5E 22 03 02 C1 |...^"...|
2A 04 33 30 30 32 03 37 |*.3002.7|
37 37 05 48 65 6C 6C 6F |77.Hello|
08 01 06 00 00 01 02 00 |........|
00 00 00 00 00 04 01 05 |........|
01 01 02 05 7B 00 00 01 |....{...|
02 00 03 00 00 00 00 00 |........|
00 00 00 00 00 00 00 00 |........|
00 01 01 00 00 00 00 19 |........|
4F 52 41 2D 30 31 34 30 |ORA-0140|
33 3A 20 6E 6F 20 64 61 |3:.no.da|
74 61 20 66 6F 75 6E 64 |ta.found|
0A |. |
Jul 1, 2010 3:30:47 PM oracle.net.ns.Packet receive
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion CHARBytesToJavaChars
TRACE_16: Enter: [B@1fa1bb6, 0, [C@1b000e7, 1, [I@1315d34, 20
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion _CHARBytesToJavaChars
TRACE_16: Enter: [B@1fa1bb6, 0, [C@1b000e7, 1, 871, [I@1315d34, 20, oracle-character-set-830, oracle-character-set-2000, oracle-character-set-871, false
Jul 1, 2010 3:30:47 PM oracle.sql.CharacterSet convertUTFBytesToJavaChars
TRACE_16: Enter: [B@1fa1bb6, 0, [C@1b000e7, 1, [I@1315d34, true, 20
Jul 1, 2010 3:30:47 PM oracle.sql.CharacterSet convertUTFBytesToJavaChars
TRACE_16: return: 4
Jul 1, 2010 3:30:47 PM oracle.sql.CharacterSet convertUTFBytesToJavaChars
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion _CHARBytesToJavaChars
TRACE_16: return: 4
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion _CHARBytesToJavaChars
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion CHARBytesToJavaChars
TRACE_16: return: 4
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion CHARBytesToJavaChars
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion CHARBytesToJavaChars
TRACE_16: Enter: [B@1fa1bb6, 0, [C@1b000e7, 211, [I@1de256f, 10
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion _CHARBytesToJavaChars
TRACE_16: Enter: [B@1fa1bb6, 0, [C@1b000e7, 211, 871, [I@1de256f, 10, oracle-character-set-830, oracle-character-set-2000, oracle-character-set-871, false
Jul 1, 2010 3:30:47 PM oracle.sql.CharacterSet convertUTFBytesToJavaChars
TRACE_16: Enter: [B@1fa1bb6, 0, [C@1b000e7, 211, [I@1de256f, true, 10
Jul 1, 2010 3:30:47 PM oracle.sql.CharacterSet convertUTFBytesToJavaChars
TRACE_16: return: 3
Jul 1, 2010 3:30:47 PM oracle.sql.CharacterSet convertUTFBytesToJavaChars
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion _CHARBytesToJavaChars
TRACE_16: return: 3
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion _CHARBytesToJavaChars
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion CHARBytesToJavaChars
TRACE_16: return: 3
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion CHARBytesToJavaChars
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion CHARBytesToJavaChars
TRACE_16: Enter: [B@1fa1bb6, 0, [C@1b000e7, 321, [I@16bd8ea, 2000
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion _CHARBytesToJavaChars
TRACE_16: Enter: [B@1fa1bb6, 0, [C@1b000e7, 321, 871, [I@16bd8ea, 2000, oracle-character-set-830, oracle-character-set-2000, oracle-character-set-871, false
Jul 1, 2010 3:30:47 PM oracle.sql.CharacterSet convertUTFBytesToJavaChars
TRACE_16: Enter: [B@1fa1bb6, 0, [C@1b000e7, 321, [I@16bd8ea, true, 2000
Jul 1, 2010 3:30:47 PM oracle.sql.CharacterSet convertUTFBytesToJavaChars
TRACE_16: return: 5
Jul 1, 2010 3:30:47 PM oracle.sql.CharacterSet convertUTFBytesToJavaChars
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion _CHARBytesToJavaChars
TRACE_16: return: 5
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion _CHARBytesToJavaChars
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion CHARBytesToJavaChars
TRACE_16: return: 5
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion CHARBytesToJavaChars
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CConnection updateSessionProperties
TRACE_16: Enter: [Loracle.jdbc.internal.KeywordValue;@16e1fb1
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CConnection updateSessionProperties
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CStatement fetch
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement checkValidRowsStatus
TRACE_16: Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement checkValidRowsStatus
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl <init>
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CResultSetAccessor getCursor
TRACE_16: return: oracle.jdbc.driver.OracleResultSetImpl@e2cb55
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CResultSetAccessor getCursor
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.ResultSetAccessor getObject
TRACE_16: return: oracle.jdbc.driver.OracleResultSetImpl@e2cb55
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.ResultSetAccessor getObject
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleCallableStatement getObject
TRACE_1: return: oracle.jdbc.driver.OracleResultSetImpl@e2cb55
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleCallableStatement getObject
TRACE_1: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleCallableStatementWrapper getObject
TRACE_30: return: oracle.jdbc.driver.OracleResultSetImpl@e2cb55
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleCallableStatementWrapper getObject
TRACE_30: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl next
TRACE_1: Public Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl next
TRACE_20: Debug: closed=false, statement.currentRow=-1, statement.totalRowsVisited=0, statement.maxRows=0, statement.validRows=1, statement.gotLastBatch=true
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl next
TRACE_1: return: true
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl next
TRACE_1: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl next
TRACE_1: Public Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl next
TRACE_20: Debug: closed=false, statement.currentRow=0, statement.totalRowsVisited=1, statement.maxRows=0, statement.validRows=1, statement.gotLastBatch=true
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl internal_close
TRACE_16: Enter: false
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.BaseResultSet close
TRACE_16: Public Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.BaseResultSet close
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection registerHeartbeat
TRACE_16: Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection registerHeartbeat
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection needLine
TRACE_16: Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection needLineUnchecked
TRACE_16: Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection needLineUnchecked
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection needLine
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CStatement closeQuery
TRACE_16: Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CConnection assertLoggedOn
TRACE_16: Enter: "oracle.jdbc.driver.T4CStatement.closeQuery"
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CConnection assertLoggedOn
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CStatement closeQuery
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement endOfResultSet
TRACE_16: Enter: false
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement prepareForNewResults
TRACE_16: Enter: false, false
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement clearWarnings
TRACE_16: Public Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement clearWarnings
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl internal_close
TRACE_16: Enter: true
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl internal_close
TRACE_16: return:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl internal_close
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement prepareForNewResults
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CStatement clearDefines
TRACE_16: Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement clearDefines
TRACE_16: Public Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement freeLine
TRACE_16: Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement freeLine
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement cleanupDefines
TRACE_16: Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection cacheBuffer
TRACE_16: Enter: [B@8e32e7
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.BufferCache put
TRACE_16: Enter: [B@8e32e7
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.BufferCache put
TRACE_30: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection cacheBuffer
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection cacheBuffer
TRACE_16: Enter: [C@1b000e7
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.BufferCache put
TRACE_16: Enter: [C@1b000e7
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.BufferCache put
TRACE_30: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection cacheBuffer
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement cleanupDefines
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement clearDefines
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CStatement clearDefines
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement endOfResultSet
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl internal_close
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl next
TRACE_1: return: false
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl next
TRACE_1: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleCallableStatementWrapper close
TRACE_16: Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OraclePreparedStatementWrapper close
TRACE_16: Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatementWrapper close
TRACE_16: Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement close
TRACE_1: Public Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement closeOrCache
TRACE_16: Enter: null
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection isStatementCacheInitialized
TRACE_16: Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection isStatementCacheInitialized
4. ODBC trace out when returned the correct result set (ie success scenario)
===============================================
TRACE_16: Enter:
Jul 1, 2010 3:30:07 PM oracle.net.ns.Packet receive
TRACE_20: Debug: type=6, length=82, flags=0
00 52 00 00 06 00 00 00    |.R......|
00 00 08 01 06 00 00 01    |........|
02 00 00 00 00 00 00 04    |........|
01 05 00 02 05 7B 00 00    |.....{..|
01 02 00 03 00 00 00 00    |........|
00 00 00 00 00 00 00 00    |........|
00 00 01 01 00 00 00 00    |........|
19 4F 52 41 2D 30 31 34    |.ORA-014|
30 33 3A 20 6E 6F 20 64    |03:.no.d|
61 74 61 20 66 6F 75 6E    |ata.foun|
64 0A                      |d.      |
Jul 1, 2010 3:30:07 PM oracle.net.ns.Packet receive
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CConnection updateSessionProperties
TRACE_16: Enter: [Loracle.jdbc.internal.KeywordValue;@1fa1bb6
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CConnection updateSessionProperties
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CStatement fetch
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleResultSetImpl internal_close
TRACE_16: Enter: false
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.BaseResultSet close
TRACE_16: Public Enter:
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.BaseResultSet close
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.PhysicalConnection registerHeartbeat
TRACE_16: Enter:
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.PhysicalConnection registerHeartbeat
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.PhysicalConnection needLine
TRACE_16: Enter:
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.PhysicalConnection needLineUnchecked
TRACE_16: Enter:
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.PhysicalConnection needLineUnchecked
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.PhysicalConnection needLine
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CStatement closeQuery
TRACE_16: Enter:
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CConnection assertLoggedOn
TRACE_16: Enter: "oracle.jdbc.driver.T4CStatement.closeQuery"
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CConnection assertLoggedOn
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CStatement closeQuery
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement endOfResultSet
TRACE_16: Enter: false
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement prepareForNewResults
TRACE_16: Enter: false, false
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement clearWarnings
TRACE_16: Public Enter:
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement clearWarnings
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement prepareForNewResults
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CStatement clearDefines
TRACE_16: Enter:
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement clearDefines
TRACE_16: Public Enter:
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement freeLine
TRACE_16: Enter:
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement freeLine
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement cleanupDefines
TRACE_16: Enter:
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.PhysicalConnection cacheBuffer
TRACE_16: Enter: [B@8e32e7
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.BufferCache put
TRACE_16: Enter: [B@8e32e7
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.BufferCache put
TRACE_30: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.PhysicalConnection cacheBuffer
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.PhysicalConnection cacheBuffer
TRACE_16: Enter: [C@1b000e7
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.BufferCache put
TRACE_16: Enter: [C@1b000e7
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.BufferCache put
TRACE_30: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.PhysicalConnection cacheBuffer
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement cleanupDefines
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement clearDefines
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CStatement clearDefines
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement endOfResultSet
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleResultSetImpl internal_close
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleResultSetImpl <init>
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CResultSetAccessor getCursor
TRACE_16: return: oracle.jdbc.driver.OracleResultSetImpl@1315d34
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CResultSetAccessor getCursor
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.ResultSetAccessor getObject
TRACE_16: return: oracle.jdbc.driver.OracleResultSetImpl@1315d34
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.ResultSetAccessor getObject
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleCallableStatement getObject
TRACE_1: return: oracle.jdbc.driver.OracleResultSetImpl@1315d34
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleCallableStatement getObject
TRACE_1: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleCallableStatementWrapper getObject
TRACE_30: return: oracle.jdbc.driver.OracleResultSetImpl@1315d34
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleCallableStatementWrapper getObject
TRACE_30: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleResultSetImpl next
TRACE_1: Public Enter:
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleResultSetImpl next
TRACE_20: Debug: closed=true, statement.currentRow=-1, statement.totalRowsVisited=0, statement.maxRows=0, statement.validRows=0, statement.gotLastBatch=false
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleResultSetImpl next
Edited by: user9376621 on Jul 1, 2010 1:07 AM
Edited by: user9376621 on Jul 1, 2010 1:13 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         

Please ignore this, it was a non-issue in the end.

Similar Messages

  • How to use stored procedure which returns result set in OBIEE

    Hi,
    I hav one stored procedure (one parameter) which returns a result set. Can we use this stored procedure in OBIEE? If so, how we hav to use.
    I know we hav the Evaluate function but not sure whether I can use for my SP which returns result set. Is there any other way where I can use my SP?
    Pls help me in solving this.
    Thanks

    Hi Radha,
    If you want to cache the results in the Oracle BI Server, you should check that option. When you run a query the Oracle BI Server will get its results from the cache, based on the persistence time you define. If the cache is expired, the Oracle BI Server will go to the database to get the results.
    If you want to use caching, you should enable caching in the nqsconfig.ini file.
    Cheers,
    Daan Bakboord

  • CQWP does not return result for a specific query when filtering on a managed metadata field.

    Hi,
    We are facing a serious production issue. We've search the web extensively but to no avail.
    Problem:
    CQWP does not return result for a specific query when filtering on a managed metadata field.
    ULS log:
    The Uls logs provides 3 different messages that I could relate to every time the query is executed. The last item(level Medium) is displayed 14 times. For readability I've moved the ULS logs to the bottom of this question.
    Query:
    The query is as follows:
    (I've translated this from dutch so pardon any typo's)
    Query: (top selection) Display items from all sites in the site collection
    ListType: Documentlibrary
    Contenttype:
    Items from this group:Custom Document Contenttypes
    Items from this content type: Verklaring
    Filter: Soort is equal to X
    extra info: the field soort (Type) is a managed metadata field that was assigned the value X
    Managed Metadata Structure:
    -managed metadata service
      -Contoso
        -Enterprise Taxonomy (term set)
          -Document (term)
            -Verklaring (term)
              -Soort (term)
                -x (term)
    EXTRA INFO:
    When I modify the filter to filter on Title the CQWP DOES return the correct document!
    When I modify the query settings to search a specific library the CWQP also does return the correct document! (In this case I am filtering on a managed metadata field).
    QUESTION:
    Why doesn't the CQWP return the document when filtering on a managed metadata field over the entire site collection.
    Why does the CQWP return the document when filtering on a managed metadata field over a single library.
    (The type of information the CQWP should return (Soort:x) is stored in a dozen document libraries!)
    Here are the ULS logs.
    Product: Web Content Management
    Category Publishing
    Level: Monitorable:
    CrossListQueryCache::GetSiteData() caught exception (Microsoft.SharePoint.SPException: Kan deze actie niet voltooien.  Probeer het opnieuw. ---> System.Runtime.InteropServices.COMException (0x80004005): Kan deze actie niet voltooien.  Probeer
    het opnieuw.     bij Microsoft.SharePoint.Library.SPRequestInternalClass.CrossListQuery(String bstrUrl, String bstrXmlWebs, String bstrXmlLists, String bstrXmlQuery, ISP2DSafeArrayWriter pCallback, Object& pvarColumns)    
    bij Microsoft.SharePoint.Library.SPRequest.CrossListQuery(String bstrUrl, String bstrXmlWebs, String bstrXmlLists, String bstrXmlQuery, ISP2DSafeArrayWriter pCallback, Object& pvarColumns)     --- Einde van intern uitzonderingsstackpad
    ---     bij Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx)     bij Microsoft.SharePoint.Library.SPRequest.CrossListQuery(String bstrUrl, String bstrXmlWebs, String bstrXmlLists, String bstrXmlQuery,
    ISP2DSafeArrayWriter pCallback, Object& pvarColumns)     bij Microsoft.SharePoint.SPWeb.GetSiteData(SPSiteDataQuery query)     bij Microsoft.SharePoint.Publishing.CachedArea.GetSiteData(SPWeb web, SPSiteDataQuery
    siteDataQuery, Boolean useSpQueryOnList)     bij Microsoft.SharePoint.Publishing.CachedArea.GetCrossListQueryResults(SPSiteDataQuery query, SPWeb currentContext, Boolean onlyPopulateCache, Boolean useSpQueryOnList, Int32 lcid)    
    bij Microsoft.SharePoint.Publishing.CrossListQueryCache.GetSiteDataResults(CachedArea cachedArea, SPWeb web, SPSiteDataQuery query, Boolean useSpQueryOnList)) for query:  '<ViewFields><FieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}"
    Nullable="True" Type="Text"/><FieldRef ID="{94f89715-e097-4e8b-ba79-ea02aa8b7adb}" Nullable="True" Type="Lookup"/><FieldRef ID="{1d22ea11-1e32-424e-89ab-9fedbadb6ce1}" Nullable="True"
    Type="Counter"/><FieldRef ID="{28cf69c5-fa48-462a-b5cd-27b6f9d2bd5f}" Nullable="True" Type="DateTime"/><FieldRef ID="{1df5e554-ec7e-46a6-901d-d85a3881cb18}" Nullable="True" Type="User"/><FieldRef
    ID="{d31655d1-1d5b-4511-95a1-7a09e9b75bf2}" Nullable="True" Type="User"/><FieldRef ID="{8c06beca-0777-48f7-91c7-6da68bc07b69}" Nullable="True" Type="DateTime"/><FieldRef ID="{30bb605f-5bae-48fe-b4e3-1f81d9772af9}"
    Nullable="True" Type="Lookup"/><FieldRef ID="{ba3c27ee-4791-4867-8821-ff99000bac98}" Nullable="True" Type="Text"/><FieldRef ID="{c5c4b81c-f1d9-4b43-a6a2-090df32ebb68}" Nullable="True"
    Type="Lookup"/><FieldRef ID="{8fca95c0-9b7d-456f-8dae-b41ee2728b85}" Nullable="True" Type="Lookup"/><FieldRef ID="{39360f11-34cf-4356-9945-25c44e68dade}" Nullable="True" Type="Text"/><FieldRef
    ID="{543bc2cf-1f30-488e-8f25-6fe3b689d9ac}" Nullable="True" Type="Image"/><FieldRef ID="{43bdd51b-3c5b-4e78-90a8-fb2087f71e70}" Nullable="True" Type="Number"/><FieldRef ID="{9da97a8a-1da5-4a77-98d3-4bc10456e700}"
    Nullable="True" Type="Note"/><FieldRef ID="{aea3cd20-8da0-4cb7-803b-5a33079a0e4d}" Nullable="True" Type="Lookup"/><FieldRef Name="ScopeId" /><FieldRef Name="_Level" /><FieldRef
    Name="UniqueId" /><ListProperty Name="DraftVersionVisibility" /></ViewFields><Lists ServerTemplate="101"></Lists><Webs Scope="Recursive" /><RowLimit>45</RowLimit><Query><Where><And><BeginsWith><FieldRef
    Name="ContentTypeId" Nullable="True" Type="ContentTypeId"/><Value Type="ContentTypeId">0x010100C5FEE83B67FA6445B0C14AE8B7761BB8011E</Value></BeginsWith><In><FieldRef ID="{aea3cd20-8da0-4cb7-803b-5a33079a0e4d}"
    LookupId="TRUE"/><Values><Value Type="Counter">783</Value></Values></In></And></Where><OrderBy><FieldRef ID="{8c06beca-0777-48f7-91c7-6da68bc07b69}" Nullable="True"
    Type="DateTime" Ascending="FALSE"/></OrderBy></Query>' at url: /. Titel webonderdeel: Inhoudsquery
    Product: Web Content Management
    Category Publishing
    Level: Warning
    Error occured while processing a Content Query Web Part. Performing the following query '<ViewFields><FieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Nullable="True" Type="Text"/><FieldRef ID="{94f89715-e097-4e8b-ba79-ea02aa8b7adb}"
    Nullable="True" Type="Lookup"/><FieldRef ID="{1d22ea11-1e32-424e-89ab-9fedbadb6ce1}" Nullable="True" Type="Counter"/><FieldRef ID="{28cf69c5-fa48-462a-b5cd-27b6f9d2bd5f}" Nullable="True"
    Type="DateTime"/><FieldRef ID="{1df5e554-ec7e-46a6-901d-d85a3881cb18}" Nullable="True" Type="User"/><FieldRef ID="{d31655d1-1d5b-4511-95a1-7a09e9b75bf2}" Nullable="True" Type="User"/><FieldRef
    ID="{8c06beca-0777-48f7-91c7-6da68bc07b69}" Nullable="True" Type="DateTime"/><FieldRef ID="{30bb605f-5bae-48fe-b4e3-1f81d9772af9}" Nullable="True" Type="Lookup"/><FieldRef ID="{ba3c27ee-4791-4867-8821-ff99000bac98}"
    Nullable="True" Type="Text"/><FieldRef ID="{c5c4b81c-f1d9-4b43-a6a2-090df32ebb68}" Nullable="True" Type="Lookup"/><FieldRef ID="{8fca95c0-9b7d-456f-8dae-b41ee2728b85}" Nullable="True"
    Type="Lookup"/><FieldRef ID="{39360f11-34cf-4356-9945-25c44e68dade}" Nullable="True" Type="Text"/><FieldRef ID="{543bc2cf-1f30-488e-8f25-6fe3b689d9ac}" Nullable="True" Type="Image"/><FieldRef
    ID="{43bdd51b-3c5b-4e78-90a8-fb2087f71e70}" Nullable="True" Type="Number"/><FieldRef ID="{9da97a8a-1da5-4a77-98d3-4bc10456e700}" Nullable="True" Type="Note"/><FieldRef ID="{aea3cd20-8da0-4cb7-803b-5a33079a0e4d}"
    Nullable="True" Type="Lookup"/><FieldRef Name="ScopeId" /><FieldRef Name="_Level" /><FieldRef Name="UniqueId" /><ListProperty Name="DraftVersionVisibility" /></ViewFields><Lists
    ServerTemplate="101"></Lists><Webs Scope="Recursive" /><RowLimit>45</RowLimit><Query><Where><And><BeginsWith><FieldRef Name="ContentTypeId" Nullable="True" Type="ContentTypeId"/><Value
    Type="ContentTypeId">0x010100C5FEE83B67FA6445B0C14AE8B7761BB8011E</Value></BeginsWith><In><FieldRef ID="{aea3cd20-8da0-4cb7-803b-5a33079a0e4d}" LookupId="TRUE"/><Values><Value Type="Counter">783</Value></Values></In></And></Where><OrderBy><FieldRef
    ID="{8c06beca-0777-48f7-91c7-6da68bc07b69}" Nullable="True" Type="DateTime" Ascending="FALSE"/></OrderBy></Query>' generated the following error: Kan deze actie niet voltooien.  Probeer het opnieuw.
    at the following url: /. Titel webonderdeel: Inhoudsquery
    Kan deze actie niet voltooien. Probeer het opnieuw. This is Dutch. It means something like: Cannot complete this action. Please try again.
    Product: Web Content Management
    Category Publishing
    Level: Medium (this message is displayed 14 times)
    ConsoleUtilies.GetContextualControlMode had no currentPage so the current SPWebPartManager mode cannot be retrieved.

    Hi,
    while digging through the logging (again) I found some extra logging regarding the same correlation id (see details below).
    We have a fairly large term store (4000+ lines).
    If somebody has a clue or tip that would greatly appreciated!
    03-19-2014 13:49:51.87 w3wp.exe (0x2098) 0x23BC SharePoint Foundation Database fa42 Monitorable A large block of literal text was sent to sql.  This can result in blocking in sql and excessive memory use on the front
    end.  Verify that no binary parameters are being passed as literals, and consider breaking up batches into smaller components.  If this request is for a SharePoint list or list item, you may be able to resolve this by reducing the number of fields. 1971313a-6baa-49e9-bace-d024ce67f25c
    03-19-2014 13:49:51.87 w3wp.exe (0x2098) 0x23BC SharePoint Foundation Database fa43 High Slow Query Duration: 127.1515 1971313a-6baa-49e9-bace-d024ce67f25c
    03-19-2014 13:49:51.87 w3wp.exe (0x2098) 0x23BC SharePoint Foundation Database fa44 High Slow Query StackTrace-Managed:    bij Microsoft.SharePoint.Utilities.SqlSession.OnPostExecuteCommand(SqlCommand command,
    SqlQueryData monitoringData)     bij Microsoft.SharePoint.Utilities.SqlSession.ExecuteReader(SqlCommand command, CommandBehavior behavior, SqlQueryData monitoringData, Boolean retryForDeadLock)     bij Microsoft.SharePoint.SPSqlClient.ExecuteQueryInternal(Boolean
    retryfordeadlock)     bij Microsoft.SharePoint.SPSqlClient.ExecuteQuery(Boolean retryfordeadlock)     bij Microsoft.SharePoint.Library.SPRequestInternalClass.CrossListQuery(String bstrUrl, String bstrXmlWebs, String
    bstrXmlLists, String bstrXmlQuery, ISP2DSafeArrayWriter pCallback, Object& pvarColumns)     bij Microsoft.SharePoint.Library.SPRequest.CrossListQuery(String bstrUrl, String bstrXmlWebs, String bstrXmlLists, String bstrXmlQuery, ISP2DSafeArrayWriter
    pCallback, Object& pvarColumns)     bij Microsoft.SharePoint.SPWeb.GetSiteData(SPSiteDataQuery query)     bij Microsoft.SharePoint.Publishing.CachedArea.GetSiteData(SPWeb web, SPSiteDataQuery siteDataQuery, Boolean
    useSpQueryOnList)     bij Microsoft.SharePoint.Publishing.CachedArea.GetCrossListQueryResults(SPSiteDataQuery query, SPWeb currentContext, Boolean onlyPopulateCache, Boolean useSpQueryOnList, Int32 lcid)     bij Microsoft.SharePoint.Publishing.CrossListQueryCache.GetSiteDataResults(CachedArea
    cachedArea, SPWeb web, SPSiteDataQuery query, Boolean useSpQueryOnList)     bij Microsoft.SharePoint.Publishing.CrossListQueryCache.GetSiteDataResults(CachedArea ca, Boolean useSpQueryOnList)     bij Microsoft.SharePoint.Publishing.CrossListQueryCache.GetSiteDataResults(SPSite
    site, String webUrl, Boolean useSpQueryOnList)     bij Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart.IssueQuery()     bij Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart.GetXPathNavigator(String
    viewPath)     bij Microsoft.SharePoint.WebPartPages.DataFormWebPart.PrepareAndPerformTransform(Boolean bDeferExecuteTransform)     bij Microsoft.SharePoint.WebPartPages.DataFormWebPart.PerformSelect()    
    bij Microsoft.SharePoint.WebPartPages.DataFormWebPart.DataBind()     bij Microsoft.SharePoint.WebPartPages.DataFormWebPart.EnsureDataBound()     bij Microsoft.SharePoint.WebPartPages.DataFormWebPart.CreateChildControls()    
    bij System.Web.UI.Control.EnsureChildControls()     bij System.Web.UI.Control.PreRenderRecursiveInternal()     bij System.Web.UI.Control.PreRenderRecursiveInternal()     bij System.Web.UI.Control.PreRenderRecursiveInternal()    
    bij System.Web.UI.Control.PreRenderRecursiveInternal()     bij System.Web.UI.Control.PreRenderRecursiveInternal()     bij System.Web.UI.Control.PreRenderRecursiveInternal()     bij System.Web.UI.Page.ProcessRequestMain(Boolean
    includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)     bij System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)     bij System.Web.UI.Page.ProcessRequest()    
    bij System.Web.UI.Page.ProcessRequest(HttpContext context)     bij ASP.BLANKWEBPARTPAGE_ASPX_1653093133.ProcessRequest(HttpContext context)     bij Microsoft.SharePoint.Publishing.TemplateRedirectionPage.ProcessRequest(HttpContext
    context)     bij System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()     bij System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)    
    bij System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)     bij System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb)     bij System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest
    wr, HttpContext context)     bij System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)     bij System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr
    managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)     bij System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32
    flags)     bij System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags) 1971313a-6baa-49e9-bace-d024ce67f25c

  • XMLTABLE function not returning any values if xml has attribute "xmlns"

    Hi,
    XMLTABLE function not returning any values if xml has attribute "xmlns". Is there way to get the values if xml has attribute as "xmlns".
    create table xmltest (id number(2), xml xmltype);
    insert into xmltest values(1,
    '<?xml version="1.0"?>
    <emps>
    <emp empno="1" deptno="10" ename="John" salary="21000"/>
    <emp empno="2" deptno="10" ename="Jack" salary="310000"/>
    <emp empno="3" deptno="20" ename="Jill" salary="100001"/>
    </emps>');
    insert into xmltest values(2,
    '<?xml version="1.0"?>
    <emps xmlns="http://emp.com">
    <emp empno="1" deptno="10" ename="John" salary="21000"/>
    <emp empno="2" deptno="10" ename="Jack" salary="310000"/>
    <emp empno="3" deptno="20" ename="Jill" salary="100001"/>
    </emps>');
    commit;
    SELECT a.*
    FROM xmltest,
    XMLTABLE (
    'for $i in /emps/emp
    return $i'
    PASSING xml
    COLUMNS empno NUMBER (2) PATH '@empno',
    deptno NUMBER (3) PATH '@deptno',
    ename VARCHAR2 (10) PATH '@ename',
    salary NUMBER (10) PATH '@salary') a
    WHERE id = 1;
    The above query returning results but below query is not returning any results because of xmlns attribute.
    SELECT a.*
    FROM xmltest,
    XMLTABLE (
    'for $i in /emps/emp
    return $i'
    PASSING xml
    COLUMNS empno NUMBER (2) PATH '@empno',
    deptno NUMBER (3) PATH '@deptno',
    ename VARCHAR2 (10) PATH '@ename',
    salary NUMBER (10) PATH '@salary') a
    WHERE id = 1;
    how to get rid out of this problem.
    Thanks,
    -Mani

    Added below one in xmltable, its working now.
    XmlNamespaces(DEFAULT 'http://emp.com')

  • Content scope document library does not return result for non farm administrator

    Hi
    I have a situation where I had to go with a unique permission applied subsite to store 1000 documents in the document library. This site has a set of 50 users. I was able to create content scope and library path for search. It returns results for me(creator/owner/administrator)
    however if I add other users as contributor or full permission, even after full crawling it does not return result for others.
    I saw some article that security broken site wont be indexed normal way and to include and I did that as well but no result for other users. I always get result.
    Please suggest if there are any specific security permissions that I need to include, so the document library target search will return result for others.
    Thanks
    Shri

    Hi Shri,
    For administrator search results, it looks like the documents could be crawled and searched.
    For other users you grant full control permission on subsite with unique permission where you store 1000 dcouments in document library, please make sure these 50 users have access permission(at least view permission) on documents from the
    library, then test again.
    Also test if users search on search center site without search scope, see if it's scope issue or search web part issue.
    If above doesn't work, please check ULS log for related useful information around the time when users search the documents, there should be more info to verify if issue is related to unique permision.
    Thanks,
    Daniel Yang
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Find an item not returning results in SharePoint calendar list

    Environment: SharePoint 2013 upgraded to SP1. We have 1000s of team sites that have been upgraded from 2010 to 2013. In the lists in these sites, quite often I encounter that
    Find an item does not return results for certain fields other than the title field. For example, we have a calendar list which has a Single Line of Text field. I can not get meaningful results searching on
    this field.  I have tried this, no luck:
    http://www.enjoysharepoint.com/Articles/Details/sharepoint-2013-find-an-item-search-box-does-not-return-20956.aspx
    Search service crawls incremental every hour. I hope this does not need a full crawl.
    Thanks, Soumya | MCITP, SharePoint 2010

    Thanks Ganesh. All these settings are as you recommended it to be. Nonetheless I double checked and here are the results:
    Ensure in the Search Service Application that the Web Application is included in the Content Source under SharePoint Start Addresses.
    Yes. Please remember we are getting search results. To be specific we are not getting Find items in the list to be returning accurate results.
    Make sure that the address in Alternate access mappings default text box is same as the start crawl address in the search service application.
    Yes.
    List Setting - Allow items from this list to appear in search results? yes
    Ensured
    set “Require content approval for submitted item?” to “No”.
    It is set to "No". However, will it not work for approved contents also?
    Thanks, Soumya | MCITP, SharePoint 2010

  • TABLE(CAST()) function not returning the correct results in few scenarios.

    I am using TABLE(CAST()) operation in PL/SQL and it is returning me no data.
    Here is what I have done:
    1.     Created Record type
    CREATE OR REPLACE TYPE target_rec AS OBJECT
    target__id          NUMBER(10),
    target_entity_id NUMBER(10),
    dd           CHAR(3),
    fd           CHAR(3),
    code      NUMBER(10),
    target_pct      NUMBER,
    template_nm VARCHAR2(50),
    p_symbol      VARCHAR2(10),
    pm_init          VARCHAR2(3),
    target_name     VARCHAR2(20),
    targe_type     VARCHAR2(30),
    target_caption     VARCHAR2(30),
    sort_order      NUMBER (4)
    2.     Created Table type
    CREATE OR REPLACE TYPE target_arr AS TABLE OF target_rec
    3.     Created Stored procedure which accepts parameter of type target_arr and runs the Table(Cast()) function on it.
         Following is the simplified form of my procedure.
         PROCEDURE get_target_weights
         p_in_template_target IN target_arr,
         p_out_count          OUT NUMBER,
         IS
         BEGIN
              SELECT count(*) into p_out_count
         FROM TABLE(CAST(p_in_template_target AS                     target_arr)) arr;
         END;
    I am calling get_target_weights from my java code and passing p_in_template_target with 10140 records.
    Scenario 1: If target_pct in the last record is 0, p_out_count returned from the procedure is 0.
    Scenario 2: If target_pct in the last record is any other value(say 0.01), p_out_count returned from the procedure is 10140.
    Please help me understand why the Table(Cast()) is not returning the correct results in Scenario 1. Also adding or deleting any record from the test data returns the correct results (i.e. if keep target_pct in the last record as 0 but add or delete any record).
    Let me know how can I attach the test data I am using to help you debugging as I don’t see any Attach file button on Post Message screen on the forum.

    I am not able to reproduce this problem with a small data set. I can only reproduce with the data having 10140 records.
    I am not sure if this is the memory issue as adding a new record also solves the problem.
    This should not be the error because of wrong way of filling the records in java as for testing purpose I just saved the records which I am sending from java in a table. I updated the stored procedure as well to read the data from the table and then perform TABLE(CAST()) operation. I am still getting 0 as the output for scenario 1 mentioned in my last mail.
    Here is what I have updated:
    1.     Created the table target_table
    CREATE Table target_table
    target_id          NUMBER(10),
    target_entity_id NUMBER(10),
    dd           CHAR(3),
    fd           CHAR(3),
    code      NUMBER(10),
    target_pct      NUMBER,
    template_nm VARCHAR2(50),
    p_symbol      VARCHAR2(10),
    pm_init          VARCHAR2(3),
    target_name     VARCHAR2(20),
    target_type     VARCHAR2(30),
    target_caption     VARCHAR2(30),
    sort_order      NUMBER (4)
    2.     Inserted data into the table : The script has around 10140 rows. Pls let me know how can I send it to you
    3.     Updated procedure to read data from table and stored into variable of type target_arr. Run Table(cast()) operation on target_arr and get the count
    PROCEDURE test_target_weights
    IS
         v_target_rec target_table%ROWTYPE;
         CURSOR wt_cursor IS
         Select * from target_table;
         v_count NUMBER := 1;
         v_target_arr cws_target_arr:= target_arr ();
         v_target_arr_rec target_rec;
         v_rec_count NUMBER;
         BEGIN
         OPEN wt_cursor;
         loop
              fetch wt_cursor into v_target_rec; -- fetch data from table into local           record.
              exit when wt_cursor%notfound;
              --move data into target_arr
              v_target_arr_rec :=                     cws_curr_pair_entity_wt_rec(v_target_rec target_id,v_target_rec. target_entity_id,
                        v_target_rec.dd,v_target_rec.fd,v_target_rec.code,v_target_rec.target_pct,
         v_target_rec.template_nm,v_target_rec.p_symbol,v_target_rec.pm_init,v_target_rec.template_name,
         v_target_rec.template_type,v_target_rec.template_caption,v_target_rec.sort_order);
              v_target_arr.extend();
              v_target_arr(v_count) := v_target_arr_rec;
              v_count := v_count + 1;
         end loop;
         close wt_cursor;
         -- run table cast on target_arr
         SELECT count(*) into v_rec_count
         FROM TABLE(CAST(v_target_arr AS target_arr)) arr;
         DBMS_OUTPUT.enable;
         DBMS_OUTPUT.PUT_LINE('p_out_count ' || v_rec_count);
         DBMS_OUTPUT.PUT_LINE('v_count ' || v_count);
    END;
    Output is
    p_out_count 0
    v_count 10140
    Expected output
    p_out_count 10140
    v_count 10140

  • JDBC SQL Server Channel Calling Stored Procedure Won't Return Result Set

    Good afternoon, Experts
    We're calling a stored procedure in a sender communcation channel.  I can perform any SQL SELECT statement here, but for some reason when I execute the SP (EXECUTE StoredProcedureName) The Adapter Engine returns the following:
    Database-level error reported by JDBC driver while executing statement 'DECLARE @UpdateRecords bit SET @UpdateRecords = 0 EXECUTE ExportToSAP @UpdateRecords'. The JDBC driver returned the following error message: 'com.microsoft.sqlserver.jdbc.SQLServerException: The statement did not return a result set.'. For details, contact your database server vendor.
    Even stranger yet is is that this works just fine on our PI-DEV system.  I created an identical communication channel connecting to the same database with the same UID and PWD and it won't work in PI-QAS.
    Any help/ideas you could share would be greatly appreciated!!!
    Thanks,
    Chad

    Hi Chad.
    Normally, itu2019s a problem with your procedure. The Store Procedure is wrong and something is different between your DEV environment and QAS environment.
    Try to ask to DB team check it.
    Regards,
    Bruno

  • Calling stored procedure returning result set

    Hi all,
    i know this issue is discussed quite often. I did not find an answer in the forums, not in the manual and even not in the examples for stored procedure.
    So i try it here once more :)
    Description:
    GET_SKS:
    The GET_SKS procedure is used to generate a number of surrogate keys. It has one input parameter NUM_SKS_IN that specifies the number of keys to generate. The generated keys are returned as a result set.
    So i tried:
    CallableStatemant sproc_stmt = lsession.connection().prepareCall("{ call Get_SKS(?,?)}");
    sproc_stmt.setInt(2,1);
    sproc_stmt.registerOutParameter(1,OracleTypes.CURSOR);
    sproc_stmt.execute();
    ResultSet sproc_result = (ResultSet) sproc_stmt.getObject(1);
    I got the exception:
    java.sql.SQLException: ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'GET_SKS'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    Thanks for help! This is really getting frustrating...
    Regards,
    ak

    Hi there,
    i could speak to our one of our admins. This is what he gave me:
    CREATE OR REPLACE PROCEDURE "TCSDBOWNER"."GET_SKS"
       (num_sks_in IN INTEGER,
        sk_out OUT SYS_INFO.SYS_INFO_SK%TYPE)
    AS
    /*+
    || Procedure - GET_SKS - Oracle
    ||
    || Description:
    ||   This procedure is used to get one or more primary keys for tables with
    ||   surrogate keys as the primary key.  This number is unique across all
    ||   tables and installations for a given client.
    ||
    || Parameters:
    ||   num_sks_in - INTEGER: number of surrogate keys to return
    ||   sk_out - sk_subtype: first key in the sequence of requested keys
    ||
    || History:
    ||   08/30/01,dcs: Created
      CURSOR request_cur IS
        select DBMS_LOCK.REQUEST(170333184) from dual;
      CURSOR release_cur IS
        select DBMS_LOCK.RELEASE(170333184) from dual;
      CURSOR dual_sk_cur IS
         select SEQ_SK.NEXTVAL SK
           from DUAL;
      v_base_offset SYS_INFO.BASE_OFFSET%TYPE;
      v_sk SYS_INFO.SYS_INFO_SK%TYPE;
      v_sqlstring VARCHAR2(1000);
      v_cursor_handle INTEGER;
      v_return INTEGER;
    BEGIN
      IF num_sks_in < 1 THEN
        TCS_EXC.RAISE_ERROR(TCS_EXC.num_sks_in_lt_1);
      END IF;
      OPEN request_cur;
      FETCH request_cur INTO v_return;
      CLOSE request_cur;
      IF v_return <> 0 AND v_return <> 4 THEN
        TCS_EXC.RAISE_ERROR(TCS_EXC.sk_gen_lock_failed);
      END IF;
      v_cursor_handle := DBMS_SQL.OPEN_CURSOR;
      v_sqlstring := 'ALTER SEQUENCE SEQ_SK INCREMENT BY '|| TO_CHAR(num_sks_in);
      DBMS_SQL.PARSE(v_cursor_handle, v_sqlstring, DBMS_SQL.V7);
      v_return := DBMS_SQL.EXECUTE(v_cursor_handle);
      DBMS_SQL.CLOSE_CURSOR(v_cursor_handle);
      GET_BASE_OFFSET(v_base_offset);
      OPEN dual_sk_cur;
      FETCH dual_sk_cur INTO v_sk;
      CLOSE dual_sk_cur;
      sk_out := (v_base_offset * 10000000000) + v_sk - num_sks_in + 1;
      v_cursor_handle := DBMS_SQL.OPEN_CURSOR;
      v_sqlstring := 'ALTER SEQUENCE SEQ_SK INCREMENT BY 1';
      DBMS_SQL.PARSE(v_cursor_handle, v_sqlstring, DBMS_SQL.V7);
      v_return := DBMS_SQL.EXECUTE(v_cursor_handle);
      DBMS_SQL.CLOSE_CURSOR(v_cursor_handle);
      OPEN release_cur;
      FETCH release_cur INTO v_return;
      CLOSE release_cur;
      IF v_return <> 0 THEN
        TCS_EXC.RAISE_ERROR(TCS_EXC.sk_gen_lock_failed);
      END IF;
    END GET_SKS; Ok, i tried with that but even not succeded yet. Can anybody help me to code that into a java call?
    Regards,
    ak

  • Table-Valued Function not returning any results

    ALTER FUNCTION [dbo].[fGetVendorInfo]
    @VendorAddr char(30),
    @RemitAddr char(100),
    @PmntAddr char(100)
    RETURNS
    @VendorInfo TABLE
    vengroup char(25),
    vendnum char(9),
    remit char(10),
    payment char(10)
    AS
    BEGIN
    insert into @VendorInfo (vengroup,vendnum)
    select ks183, ks178
    from hsi.keysetdata115
    where ks184 like ltrim(@VendorAddr) + '%'
    update @VendorInfo
    set remit = r.remit
    from
    @VendorInfo ven
    INNER JOIN
    (Select ksd.ks188 as remit, ksd.ks183 as vengroup, ksd.ks178 as vendnum
    from hsi.keysetdata117 ksd
    inner join @VendorInfo ven
    on ven.vengroup = ksd.ks183 and ven.vendnum = ksd.ks178
    where ksd.ks192 like ltrim(@RemitAddr) + '%'
    and ks189 = 'R') r
    on ven.vengroup = r.vengroup and ven.vendnum = r.vendnum
    update @VendorInfo
    set payment = p.payment
    from
    @VendorInfo ven
    INNER JOIN
    (Select ksd.ks188 as payment, ksd.ks183 as vengroup, ksd.ks178 as vendnum
    from hsi.keysetdata117 ksd
    inner join @VendorInfo ven
    on ven.vengroup = ksd.ks183 and ven.vendnum = ksd.ks178
    where ksd.ks192 like ltrim(@PmntAddr) + '%'
    and ks189 = 'P') p
    on ven.vengroup = p.vengroup and ven.vendnum = p.vendnum
    RETURN
    END
    GO
    Hi all,
    I'm having an issue where my Table-Valued Function is not returning any results.
    When I break it out into a select statement (creating a table, and replacing the passed in parameters with the actual values) it works fine, but with passing in the same exact values (copy and pasted them) it just retuns an empty table.
    The odd thing is I could have SWORN this worked on Friday, but not 100% sure.
    The attached code is my function.
    Here is how I'm calling it:
    SELECT * from dbo.fGetVendorInfo('AUDIO DIGEST', '123 SESAME ST', 'TOP OF OAK MOUNTAIN')
    I tried removing the "+ '%'" and passing it in, but it doesn't work.
    Like I said if I break it out and run it as T-SQL, it works just fine.
    Any assistance would be appreciated.

    Why did you use a proprietary user function instead of a VIEW?  I know the answer is that your mindset does not use sets. You want procedural code. In fact, I see you use an “f-” prefix to mimic the old FORTRAN II convention for in-line functions! 
    Did you know that the old Sybase UPDATE.. FROM.. syntax does not work? It gives the wrong answers! Google it. 
    Your data element names make no sense. What is “KSD.ks188”?? Well, it is a “payment_<something>”, “KSD.ks183” is “vendor_group” and “KSD.ks178” is “vendor_nbr” in your magical world where names mean different things from table to table! 
    An SQL programmer might have a VIEW with the information, something like:
    CREATE VIEW Vendor_Addresses
    AS
    SELECT vendor_group, vendor_nbr, vendor_addr, remit_addr, pmnt_addr
      FROM ..
     WHERE ..;
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Advice Please: Adding Few Static Values to Stored Proc Returned Result Set

    Hello -
    The Stored Proc below returns about 1000 rows of result set when a date is passed to the query. In addition to that, there are about 5 rows of data (which is in my excel file) needs to be added to the result set. What is the best possible way?
    What I have done is I created a new table which has that 5 static rows. It has just the addresses and amount and customer number. There is no invoice date in that table. I tried UNION and the query did not like the fact that I had something like that in
    the first table:
    SELECT
    '0' as 'TYPE'
    ,'TBCCA' as 'Acc ID'
    ,'12882' as 'BEID'
    , '' as ' # OF UNITS'
    , Circuit_Total as 'AMT'
    ,'D' as 'D or C'
    , '' as ' FDOC yyyymmdd'
    , '' as ' LDOC yyyymmdd'
    , Address as 'Brief Comment'
    , city as 'Tax City'
    , State as 'Tax State'
    , Zip_Code as 'Tax Zip Code'
    , INV_DATE as 'Invoice Date'
    FROM [dbo].[TBC_MonthlyCircuitDetail]
    WHERE INV_DATE = '2014-07-01'
    AND [Circuit_Total] >0
    UNION
    SELECT 0
    '0' as 'TYPE' --DID NOT LIKE THIS <<
    ,'TBCCA' as 'Acc ID'
    ,'12882' as 'BEID'
    , '' as ' # OF UNITS'
    , Circuit_Total as 'AMT'
    ,'D' as 'D or C'
    , '' as ' FDOC yyyymmdd'
    , '' as ' LDOC yyyymmdd'
    , Address as 'Brief Comment'
    , city as 'Tax City'
    , State as 'Tax State'
    , Zip_Code as 'Tax Zip Code'
    , '' INV_DATE as 'Invoice Date'
    FROM [dbo].[TBC_MonthlyCircuitDetailStaticValues]
    WHERE INV_DATE = '2014-07-01'
    AND [Circuit_Total] >0
    Stored Proc below:
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE PROCEDURE [dbo].[SP_TBC_ORBIT Process Form]
    -- Add the parameters for the stored procedure here
    @INVOICE_DATE varchar(20)
    AS
    BEGIN
    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.
    SET NOCOUNT ON;
    -- Insert statements for procedure here
    SELECT
    '0' as 'TYPE'
    ,'TBCCA' as 'Acc ID'
    ,'12882' as 'BEID'
    , '' as ' # OF UNITS'
    , Circuit_Total as 'AMT'
    ,'D' as 'D or C'
    , '' as ' FDOC yyyymmdd'
    , '' as ' LDOC yyyymmdd'
    , Address as 'Brief Comment'
    , city as 'Tax City'
    , State as 'Tax State'
    , Zip_Code as 'Tax Zip Code'
    , INV_DATE as 'Invoice Date'
    FROM [dbo].[TBC_MonthlyCircuitDetail]
    WHERE INV_DATE IN (@INVOICE_DATE)
    AND [Circuit_Total] >0
    END
    GO
    So, what do you suggest? As you can tell, I am quite a novice but I am learning by researching, asking questions and doing it. Thanks in advance!
    Sanjeev Jha

    Your second Select statement is as below:
    SELECT 0
      '0' as 'TYPE'
    --DID NOT LIKE THIS <<
    ,'TBCCA' as
    'Acc ID'
    ,'12882' as
    'BEID'
    , '' as
    ' # OF UNITS'
    , Circuit_Total as
    'AMT'
    ,'D' as 'D or C'
    , '' as
    ' FDOC yyyymmdd'
    , '' as
    ' LDOC yyyymmdd'
    , Address as
    'Brief Comment'
    , city as 'Tax City'
    , State as
    'Tax State'
    , Zip_Code as
    'Tax Zip Code'
    , ''INV_DATE
    as 'Invoice Date'  -- CHANGE HERE
    FROM [dbo].[TBC_MonthlyCircuitDetailStaticValues]
    WHERE INV_DATE = '2014-07-01'
    AND [Circuit_Total] >0
    You are receiving Invoice date from INV_DATE column from table or you want to set it as blank?
    Change it to either - ( '' as
    'Invoice Date' ) or  (INV_DATE as
    'Invoice Date'  )
    -Vaibhav Chaudhari

  • RETURN RESULT SET FROM JAVA STORED PROCEDURE

    I'm calling a Oracle 8.1.5 java stored proc from PL/SQL and I
    would like to send a Java result set to the calling function.
    I havent found anyway to do this currently. Anyone else doing
    anything like this and have a work around or know when/if it has
    been fixed?
    Mark
    [email protected]
    null

    This is not possible in Oracle 8i, will have to wait till Oracle 9i

  • Calling a Stored Procedure with a result set and returned parms

    I am calling a stored procedure from a Brio report. The stored procedure returns a result set, but also passes back some parameters. I am getting a message that states that the DBMS cannot find the SP with the same footprint. Besides the result set, the SP returns 3 out parameters: (Integer, char(60), char(40)). Is there something special I need to do in Brio to format the out parameters to be passed back from the SP.
    Thanks,
    Roland

    Did you try just declaring the vars?
    untested
    declare
      myCur SYS_REFCURSOR;
      myRaw RAW(4);
      BEGIN
        test (0, 0, myRaw, sysdate, myCur);
      END;

  • Function not returning table object correctly

    Instead of returning a table, my function is returning this:
    SCHEMA_OWNER.TBL_SUMS([SCHEMA_OWNER.SUMS_OBJ])
    Does anyone see a syntax error in my function or the ddl of my table and object types?
    This is a stripped down, simplified version of my function:
    create or replace FUNCTION "F_TEST" (p_skey number, p_start_date date, p_end_date date)
    RETURN tbl_sums
    IS
    tmp_A NUMBER;
    tmp_B NUMBER;
    l_tbl tbl_sums := tbl_sums();
    BEGIN
    SELECT SUM(FieldA), SUM(FieldB)
    into tmpA, tmpB
    from myTable where SKEY = p_skey
    and DATE_VALUE >= p_start_date
    and DATE_VALUE < p_end_date;
    l_tbl.extend;
    l_tbl(l_tbl.count()) := sums_obj(p_start_date, p_end_date, p_skey, tmpA, tmpB);
    return l_tbl;
    END;
    My types are:
    create or replace type sums_obj is object (start_date DATE, end_date DATE, skey NUMBER, SumA NUMBER, SumB NUMBER);
    create or replace type tbl_sums is table of sums_obj;
    Thanks!

    >
    RETURN tbl_kpi
    >
    What is 'tbl_kpi'? That isn't defined anywhere. Your original post said this:
    >
    RETURN tbl_sums
    >
    We can't help you if you don't post what you are really using. Cut & Paste is ok but you have to paste the correct code.
    Your funtion is returning a TABLE but it is NOT PIPELINED. So if you query the function from DUAL you will get a DATASET as the result.
    If you query the function AS A TABLE you will get the 'contents' of the table.
    If you make your function a PIPELINED function then you use PIPE ROW to return each row but the function is still declared to return a TABLE. Maybe that is what is confusing you.
    Try the following sample code to see what the difference is.
    Here are two SQL types based on the EMP table in the scott schema.
    -- type to match emp record
    create or replace type emp_scalar_type as object
      (EMPNO NUMBER(4) ,
       ENAME VARCHAR2(10),
       JOB VARCHAR2(9),
       MGR NUMBER(4),
       HIREDATE DATE,
       SAL NUMBER(7, 2),
       COMM NUMBER(7, 2),
       DEPTNO NUMBER(2)
    -- table of emp records
    create or replace type emp_table_type as table of emp_scalar_type
    /Now - here is a function (similar to yours) that returns that EMP_TABLE_TYPE. NOTE: the function IS NOT PIPELINED
    CREATE OR REPLACE function SCOTT.get_emp1( p_deptno in number )
      return emp_table_type
      as
    tb emp_table_type;
    BEGIN
      select emp_scalar_type(empno, ename, job, mgr, hiredate, sal, comm, deptno)
        bulk collect into tb from emp where deptno = p_deptno;
      return tb;
    end;
    /If I just select the function itself from DUAL I get this:
    select get_emp1(20) from dual
    GET_EMP1(20)
    (DATASET)I can use TOAD or sql developer to examine that dataset and see the records.
    But I can actually query the records by using the TABLE function:
    select * from table(get_emp1(20))
    EMPNO     ENAME     JOB     MGR     HIREDATE     SAL     COMM     DEPTNO
    7369     SMITH     CLERK     7902     12/17/1980     800          20
    7566     JONES     MANAGER     7839     4/2/1981     2975          20
    7788     SCOTT     ANALYST     7566     4/19/1987     3000          20
    7876     ADAMS     CLERK     7788     5/23/1987     1100          20
    7902     FORD     ANALYST     7566     12/3/1981     3000          20This is a similar function. It returns the same EMP_TABLE_TYPE but it is a PIPELINED function.
    -- pipelined function
    create or replace function get_emp( p_deptno in number )
      return emp_table_type
      PIPELINED
      as
       TYPE EmpCurTyp IS REF CURSOR RETURN emp%ROWTYPE;
        emp_cv EmpCurTyp;
        l_rec  emp%rowtype;
      begin
        open emp_cv for select * from emp where deptno = p_deptno;
        loop
          fetch emp_cv into l_rec;
          exit when (emp_cv%notfound);
          pipe row( emp_scalar_type( l_rec.empno, LOWER(l_rec.ename),
              l_rec.job, l_rec.mgr, l_rec.hiredate, l_rec.sal, l_rec.comm, l_rec.deptno ) );
        end loop;
        return;
      end;
      /The ONLY way I can query this function is by using the TABLE function:
    select * from table(get_emp(20))
    EMPNO     ENAME     JOB     MGR     HIREDATE     SAL     COMM     DEPTNO
    7369     smith     CLERK     7902     12/17/1980     800          20
    7566     jones     MANAGER     7839     4/2/1981     2975          20
    7788     scott     ANALYST     7566     4/19/1987     3000          20
    7876     adams     CLERK     7788     5/23/1987     1100          20
    7902     ford     ANALYST     7566     12/3/1981     3000          20The query of the PIPELINED function is the same and the result set is the same.
    The difference is that the PIPELINED function returns ONE ROW at a time and does NOT need to accumulate a lot of data in a collection before returning it. That collection uses expensive PGA memory and the more data you have the more memory it uses.
    Your function (and my similar one) doesn't return ANY data until it has produced ALL of it. And it uses that expensive PGA memory. What is the point of creating your collection one row at a time and waiting until you have it all before you return it?
    You could easily modify your function and add PIPELINED to the declaration. Then use the PIPE ROW clause to return each row as it is produced. That will eliminate the need for the collection (and memory) within the function.
    You can also then chain the function calls together if you need to.
    See 'Using Pipelined and Parallel Table Functions' in the Data Cartridge Developer's Guide
    http://docs.oracle.com/cd/B28359_01/appdev.111/b28425/pipe_paral_tbl.htm
    There is little use for your function that is not pipelined but returns a table type unless you were storing that table-type in an object column of a table.
    There are many uses for PIPELINED functions.

  • Returning result set from procedure out parameter, display with anon block

    I'm trying to do something pretty simple (I think it should be simple at least). I want to use a pl/sql procedure to return a result set in an OUT parameter. If I run this code by itself (in the given anonymous block at the end, without trying to display any results), toad says that the PL/SQL procedure successfully completed.
    How can I display the results from this procedure? I am assuming that the result set should be stored in the O_RETURN_REDEEM_DTL, but how can I get anything out of it?
    I have this package with the following procedure:
    /* FUNCTION - REDEEM_DTL_READ                          */
         PROCEDURE REDEEM_DTL_READ(
              ZL_DIVN_NBR_IN     IN     REDEEM_DTL.ZL_DIVN_NBR%TYPE,
              GREG_DATE_IN     IN     REDEEM_DTL.GREG_DATE%TYPE,
              ZL_STORE_NBR_IN     IN     REDEEM_DTL.ZL_STORE_NBR%TYPE,
              REGISTER_NBR_IN     IN     REDEEM_DTL.REGISTER_NBR%TYPE,
              TRANS_NBR_IN     IN     REDEEM_DTL.TRANS_NBR%TYPE,
              O_RETURN_REDEEM_DTL OUT REDEEM_DTL_TYPE,
              o_rtrn_cd       OUT NUMBER,
              o_err_cd        OUT NUMBER,
              o_err_msg       OUT VARCHAR2
         IS
         BEGIN
              o_rtrn_cd := 0;
              o_err_msg := ' ';
              o_err_cd := 0;
              --OPEN REDEEM_DTL_READ_CUR(ZL_DIVN_NBR_IN, GREG_DATE_IN, ZL_STORE_NBR_IN, REGISTER_NBR_IN, TRANS_NBR_IN);
              OPEN O_RETURN_REDEEM_DTL FOR SELECT * FROM REDEEM_DTL;
    --           LOOP
    --                FETCH REDEEM_DTL_READ_CUR INTO O_RETURN_REDEEM_DTL;
    --                EXIT WHEN REDEEM_DTL_READ_CUR%NOTFOUND;
    --           END LOOP;
    --           CLOSE REDEEM_DTL_READ_CUR;
         EXCEPTION
          WHEN OTHERS
          THEN
               o_rtrn_cd := 7;
                 o_err_msg := SUBSTR (SQLERRM, 1, 100);
                 o_err_cd  := SQLCODE;
         END REDEEM_DTL_READ;and call it in an anonymous block with:
    DECLARE
      ZL_DIVN_NBR_IN NUMBER;
      GREG_DATE_IN DATE;
      ZL_STORE_NBR_IN NUMBER;
      REGISTER_NBR_IN NUMBER;
      TRANS_NBR_IN NUMBER;
      O_RETURN_REDEEM_DTL PSAPP.CY_SALESPOSTING.REDEEM_DTL_TYPE;
      O_RETURN_REDEEM_DTL_OUT PSAPP.CY_SALESPOSTING.REDEEM_DTL_READ_CUR%rowtype;
      O_RTRN_CD NUMBER;
      O_ERR_CD NUMBER;
      O_ERR_MSG VARCHAR2(200);
    BEGIN
      ZL_DIVN_NBR_IN := 71;
      GREG_DATE_IN := TO_DATE('07/21/2008', 'MM/DD/YYYY');
      ZL_STORE_NBR_IN := 39;
      REGISTER_NBR_IN := 1;
      TRANS_NBR_IN := 129;
      -- O_RETURN_REDEEM_DTL := NULL;  Modify the code to initialize this parameter
      O_RTRN_CD := NULL;
      O_ERR_CD := NULL;
      O_ERR_MSG := NULL;
      PSAPP.CY_SALESPOSTING.REDEEM_DTL_READ ( ZL_DIVN_NBR_IN, GREG_DATE_IN, ZL_STORE_NBR_IN,
    REGISTER_NBR_IN, TRANS_NBR_IN, O_RETURN_REDEEM_DTL, O_RTRN_CD, O_ERR_CD, O_ERR_MSG );
      FOR item IN O_RETURN_REDEEM_DTL
      LOOP
        DBMS_OUTPUT.PUT_LINE('ZL_DIVN_NBR = ' || item.ZL_DIVN_NBR);
      END LOOP;
    END; And end up with an error:
    ORA-06550: line 25, column 15:
    PLS-00221: 'O_RETURN_REDEEM_DTL' is not a procedure or is undefined
    ORA-06550: line 25, column 3:
    PL/SQL: Statement ignoredMessage was edited by:
    user607908

    Aha, I knew I forgot something!
    I actually had it defined as a REF CURSOR in PSAPP.CY_SALESPOSTING package spec:
    TYPE REDEEM_DTL_TYPE IS REF CURSOR;since I wasn't sure what to make it.
    Cursor used in procedure:
    CURSOR REDEEM_DTL_READ_CUR (
      zl_divn_nbr_in IN NUMBER,
      greg_date_in IN DATE,
      zl_store_nbr_in IN NUMBER,
      register_nbr_in IN NUMBER,
      trans_nbr_in IN NUMBER)
    IS
    SELECT ZL_DIVN_NBR, GREG_DATE, ZL_STORE_NBR, REGISTER_NBR, TRANS_NBR, PAYMENT_TYP_NBR
    FROM REDEEM_DTL
    WHERE ZL_DIVN_NBR = zl_divn_nbr_in AND GREG_DATE = greg_date_in AND
       ZL_STORE_NBR = zl_store_nbr_in AND REGISTER_NBR = register_nbr_in AND
       TRANS_NBR = trans_nbr_in;Updated code:
    /* PROCEDURE - REDEEM_DTL_READ                          */
         PROCEDURE REDEEM_DTL_READ(
              ZL_DIVN_NBR_IN     IN     REDEEM_DTL.ZL_DIVN_NBR%TYPE,
              GREG_DATE_IN     IN     REDEEM_DTL.GREG_DATE%TYPE,
              ZL_STORE_NBR_IN     IN     REDEEM_DTL.ZL_STORE_NBR%TYPE,
              REGISTER_NBR_IN     IN     REDEEM_DTL.REGISTER_NBR%TYPE,
              TRANS_NBR_IN     IN     REDEEM_DTL.TRANS_NBR%TYPE,
              O_RETURN_REDEEM_DTL OUT REDEEM_DTL_TYPE,
              o_rtrn_cd       OUT NUMBER,
              o_err_cd        OUT NUMBER,
              o_err_msg       OUT VARCHAR2
         IS
         BEGIN
              o_rtrn_cd := 0;
              o_err_msg := ' ';
              o_err_cd := 0;
              OPEN REDEEM_DTL_READ_CUR(ZL_DIVN_NBR_IN, GREG_DATE_IN, ZL_STORE_NBR_IN,
                   REGISTER_NBR_IN, TRANS_NBR_IN);
              --OPEN O_RETURN_REDEEM_DTL FOR SELECT * FROM REDEEM_DTL;
              LOOP
                  FETCH REDEEM_DTL_READ_CUR INTO O_RETURN_REDEEM_DTL;
                   EXIT WHEN REDEEM_DTL_READ_CUR%NOTFOUND;
                   DBMS_OUTPUT.PUT_LINE('ZL_DIVN_NBR = ' || O_RETURN_REDEEM_DTL.ZL_DIVN_NBR);
                END LOOP;
               CLOSE REDEEM_DTL_READ_CUR;
    --           LOOP
    --                FETCH REDEEM_DTL_READ_CUR INTO O_RETURN_REDEEM_DTL;
    --                EXIT WHEN REDEEM_DTL_READ_CUR%NOTFOUND;
    --           END LOOP;
    --           CLOSE REDEEM_DTL_READ_CUR;
         EXCEPTION
          WHEN OTHERS
          THEN
               o_rtrn_cd := 7;
                 o_err_msg := SUBSTR (SQLERRM, 1, 100);
                 o_err_cd  := SQLCODE;
         END REDEEM_DTL_READ;the updated anon block:
    DECLARE
      ZL_DIVN_NBR_IN NUMBER;
      GREG_DATE_IN DATE;
      ZL_STORE_NBR_IN NUMBER;
      REGISTER_NBR_IN NUMBER;
      TRANS_NBR_IN NUMBER;
      O_RETURN_REDEEM_DTL PSAPP.CY_SALESPOSTING.REDEEM_DTL_TYPE;
      O_RTRN_CD NUMBER;
      O_ERR_CD NUMBER;
      O_ERR_MSG VARCHAR2(200);
    BEGIN
      ZL_DIVN_NBR_IN := 71;
      GREG_DATE_IN := TO_DATE('07/21/2008', 'MM/DD/YYYY');
      ZL_STORE_NBR_IN := 39;
      REGISTER_NBR_IN := 1;
      TRANS_NBR_IN := 129;
      -- O_RETURN_REDEEM_DTL := NULL;  Modify the code to initialize this parameter
      O_RTRN_CD := NULL;
      O_ERR_CD := NULL;
      O_ERR_MSG := NULL;
      PSAPP.CY_SALESPOSTING.REDEEM_DTL_READ ( ZL_DIVN_NBR_IN, GREG_DATE_IN, ZL_STORE_NBR_IN,
         REGISTER_NBR_IN, TRANS_NBR_IN, O_RETURN_REDEEM_DTL, O_RTRN_CD, O_ERR_CD, O_ERR_MSG );
      FOR item IN 1..O_RETURN_REDEEM_DTL.COUNT
      LOOP
        DBMS_OUTPUT.PUT_LINE('ZL_DIVN_NBR = ' || O_RETURN_REDEEM_DTL(item).ZL_DIVN_NBR);
      END LOOP;
    END;and the new error:
    ORA-06550: line 25, column 38:
    PLS-00487: Invalid reference to variable 'O_RETURN_REDEEM_DTL'
    ORA-06550: line 25, column 3:
    PL/SQL: Statement ignoredAlso, it would be nice if the forums would put a box around code so that it would be easy to
    distinguish between what is supposed to be code and what should be regular text...
    Message was edited by:
    user607908

Maybe you are looking for

  • "Pop" - and then it sort of dies

    Hi - I was running my ibook G4 today when it suddenly died. It's about 2.5 years old, and has never presented any problems. On this occasion, I had only been using it for about 2 hours or so. I was running Quicktime and Firefox with an external hard

  • Display of table rows and columns in OAF

    Hi All, I am developing a custom page which has one table. This page table should display the fields and it's corresponding values side by side. for eg: Header1 Header2 Lable1(field prompt) value1 Lable2(field prompt) value2 Lable3(field prompt) valu

  • Upgrade 10.2.0.4 to 11.2.0.2 with proC

    Hello, I want to upgrade 10.2.0.4 to 11.2.0.2 with proC,can you help to find out metalink document. OS=AIX 5.3 Regards, Merri

  • Adobe XI Installation problem

    Hello, Trying to install XI from disk and has been stuck at 15 seconds left for over an hour.  What should I do?

  • Target Application is Down for a while

    Hi All, My Scenario is Idoc to File(FTP), We triggered 1000 Idocs from ECC and all are gone through XI. Received 300 messages only in FTP and after that FTP is down for some period of time unexpectedly. How can we retrieve the remaining 700 messages