FM 'FITP_CREATE_TRIP_FROM_REQUEST' returns exception
Hello dear colleagues!
I create trip requests for several personal numbers using fm 'FITP_CREATE_TRIP_FROM_REQUEST' in the loop.
It works fine for the first person, but returns an exception creation_failed for the second. It looks like some internal buffers is filled during the first run and it leads to some inconsistency for the next runs.
I changed the order of processing and it is always succesful for the first person and raises an exception for the second one.
Has anybody faced this problem yet?
Thanks!
Done.
I should call fm 'PTRA_SCREEN_MEM_CLEAR_ALL' before the next trip creation to clear buffers.
Similar Messages
-
CRM_ORDER_MAINTAIN returns exception 3 NO_CHANGE_ALLOWED
Hello ABAP-friends,
We've created a report that creates service orders from a flat-file. We've used CRM_ORDER_MAINTAIN for this and it has worked fine for a while. However, now this function returns exception 3, NO_CHANGE_ALLOWED very often. The only thing that has changed, is that we've added a status to our status profile, but even if we recreate our profile, we have the same problem.
Any ideas?
Kind regards,
JorgHi Jorg,
First of all since this function is a CRM realted function, I would imagine that you would receive better feedback in case you post it in the CRM related forum.
This being said, when checking the function in our CRM system, this is what I found by drilling down into the code:
Function: CRM_ORDER_CHECK_CHANGE_ALLOWED triggers the message NO_CHANGE_ALLOWED
Comments in this function:
This function module checks wether the CRM document is changeable
For example, if the document is in transfer to the execution
system already, and no feedback is yet received from the execution
system, changes will not be allowed.
This function module does not evaluate the display mode of the
interaction layer!
Further down in the code
If the document is originally in R/3, no changes are allowed in CRM
In case of a contract call-off changes are allowed. CONF_UPDATE on
header level is set in CRM_CONTRACT_CHECK_RELEASE_EC
etc.
So maybe explore/debug this function to determine exactly what the condition(s) is(are) when this message is triggered.
Kind regards,
Robert -
SLDCHECH: Function call returned exception code 3
Hi all.
I am trying to set up ESS and MSS on EP 6.0 SP15.
I have configured the RFC destination, and when i do a test in RZ70 and SM59 everything is ok, but when i try running transaction SLDCHECK i get the following error:
Use transaction SLDAPICUST if you wish to maintain the SLD server access data
Launching the SLD GUI in a separate browser window...
=> Verify in the browser GUI that the SLD is in a healthy running state!
Calling function LCR_LIST_BUSINESS_SYSTEMS
Retrieving data from the SLD server...
Function call returned exception code 3
=> Check whether the SLD is running!
Summary: Connection to SLD does not work
=> Check SLD function and configurations
Can anybody shead some light on this problem?
Regards LiselotteDear Liselotte,
This will help you,
http://help.sap.com/saphelp_nw04/helpdata/en/78/20244134a56532e10000000a1550b0/frameset.htm
Might be Java version to the proxy settings. Try to go thru listed down various troubleshooting steps in following this weblog.
Unable to open IR/ESR/ID ? (XI/PI/PI 7.1) [Updated for PI 7.1 support]
Regards
Agasthuri Doss -
I just updated my iPad2 to ios7 and everything returned except my movies. Why??? I was trying to ADD a movie for my 5 year old and it said I needed a later iOS. Now he has ZERO movies!!!! Just great!! Can anyone help??
For what it's worth, you posted this in 2011, and here in 2014 I am still having this same issue. Over the last two days, I have had to unlock my apple account 8 times. I didn't get any new devices. I haven't initiated a password reset. I didn't forget my password. I set up two factor authentication and have been able to do the unlocking with the key and using a code sent to one of my devices.
That all works.
It's this having to unlock my account every time I go to use any of my devices. And I have many: iMac, iPad, iPad2, iPad mini, iPhone 5s, iPod touch (daughter), and my old iPhone 4 being used as an ipod touch now. They are all synced, and all was working just fine.
I have initiated an incident with Apple (again) but I know they are just going to suggest I change my Apple ID. It's a simple one, and one that I am sure others think is theirs. I don't want to change it. I shouldn't have to. Apple should be able to tell me who is trying to use it, or at least from where.
Thanks for listening,
Melissa -
Hi,
I want to retrun exception message like this
EXCEPTION
WHEN OTHERS THEN
v_code := SQLCODE;
v_errm := SUBSTR(SQLERRM, 1, 64);
RETURN(v_code||':'||v_errm);And I am getting error like this:
Error(21,3): PLS-00372: In a procedure, RETURN statement cannot contain an expression
If it is not possible like above, How can I return error message?ThanksWhy don't you test it?
Here is the way ->
satyaki>
satyaki>select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
PL/SQL Release 10.2.0.3.0 - Production
CORE 10.2.0.3.0 Production
TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production
Elapsed: 00:00:00.23
satyaki>
satyaki>
satyaki>select * from emp;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
9999 SATYAKI SLS 7698 02-NOV-08 55000 3455 10
7777 SOURAV SLS 14-SEP-08 45000 3400 10
7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
7566 JONES MANAGER 7839 02-APR-81 2975 20
7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30
7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
7782 CLARK MANAGER 7839 09-JUN-81 4450 10
7788 SCOTT ANALYST 7566 19-APR-87 3000 20
7839 KING PRESIDENT 17-NOV-81 7000 10
7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30
7876 ADAMS CLERK 7788 23-MAY-87 1100 20
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7900 JAMES CLERK 7698 03-DEC-81 950 30
7902 FORD ANALYST 7566 03-DEC-81 3000 20
Elapsed: 00:00:00.09
satyaki>
satyaki>
satyaki>create or replace procedure test_ff(a in number,b out varchar2)
2 is
3 v_name varchar2(30);
4 v_code varchar2(10);
5 v_errm varchar2(64);
6 begin
7 select ename
8 into v_name
9 from emp
10 where empno = a;
11 exception
12 when others then
13 v_code := SQLCODE;
14 v_errm := SUBSTR(SQLERRM, 1, 64);
15 b := v_code||':'||v_errm;
16 RAISE;
17 end;
18 /
Elapsed: 00:00:03.08
satyaki>
satyaki>
satyaki>declare
2 v_out varchar2(200);
3 begin
4 test_ff(6666,v_out);
5 dbms_output.put_line(v_out);
6 end;
7 /
declare
ERROR at line 1:
ORA-01403: no data found
ORA-06512: at "SCOTT.TEST_FF", line 16
ORA-06512: at line 4
Elapsed: 00:00:00.33
satyaki>
satyaki>ed
Wrote file afiedt.buf
1 declare
2 v_out varchar2(200);
3 begin
4 test_ff(6666,v_out);
5 dbms_output.put_line(v_out);
6 exception
7 when no_data_found then
8 dbms_output.put_line('Outer Handler - No Data Found Exception');
9* end;
satyaki>/
Outer Handler - No Data Found Exception
Elapsed: 00:00:00.22
satyaki>
satyaki>Regards.
Satyaki De. -
HELP! executing "use database" query returns exception!
I have several databases running on my PC through port 1319 (MSSQL port) and I need to determinate which concrete I should use.
when I put:
SQLStatement.executeQuery("use ester");
he returns to me:
Error:
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]No ResultSet set was produced.
so how to determinate it?hi Kirillica
SQLStatement.executeQuery("use ester");
return only resultset
u have to do something like
Resultset rs = SQLStatement.executeQuery("use ester");
then find info from rs
hope this help
Regards
Satinderjit -
Is there any exception class which has method returning Exception id?
Portal Runtime Error
An exception occurred while processing a request for :
iView : TestTableViewer.default
Component Name : TestTableViewer.default
The exception was logged. Inform your system administrator..
Exception id: 05:26_15/03/06_0058_3045950
See the details for the exception ID in the log file
====================================================
Hi,
I tried PortalException methods,PageException methods,PortalRuntimeException methods to get Exception id: generated at runtime.But I have not succeeded.If anybody knows it please reply.I need to find that Exception id in my project.
Thanks in advance
======================================================Portal Runtime Error
An exception occurred while processing a request for :
iView : TestTableViewer.default
Component Name : TestTableViewer.default
The exception was logged. Inform your system administrator..
Exception id: 05:26_15/03/06_0058_3045950
See the details for the exception ID in the log file
====================================================
Hi,
I tried PortalException methods,PageException methods,PortalRuntimeException methods to get Exception id: generated at runtime.But I have not succeeded.If anybody knows it please reply.I need to find that Exception id in my project.
Thanks in advance
====================================================== -
Connection pool not re-establishing connections, throwing exception instead
Hello,
I've just set up a connection pool on the sun java system application server 8 for a MySQL database using the official mysql-connector/j 5.0. Everything is working great, except when the connections timeout (or i kill them all manually from the database server) and then request a page that needs to use the DataSource object, the following exception is thrown:
Exception thrown: com.mysql.jdbc.CommunicationsException -- Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.io.EOFException
STACKTRACE:
java.io.EOFException
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1913)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2304)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2803)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3118)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3047)
at com.mysql.jdbc.Statement.executeQuery(Statement.java:1166)
at com.mysql.jdbc.jdbc2.optional.StatementWrapper.executeQuery(StatementWrapper.java:705)
at beans.MySessionBean.businessMethod(MySessionBean.java:73)
at org.apache.jsp.index_jsp._jspService(index_jsp.java:70)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:105)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:336)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:251)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
at sun.reflect.GeneratedMethodAccessor98.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257)
at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:225)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:132)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:185)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:653)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:534)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.doTask(ProcessorTask.java:403)
at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:55)
** END NESTED EXCEPTION **
Last packet sent to the server was 16 ms ago.What could be wrong?
Thank you.The code is here:
public String businessMethod() {
//TODO implement businessMethod
try
InitialContext ic = new InitialContext();
Object obj = ic.lookup("jdbc/MyDS");
System.out.println("Object is: " + obj + " | Class is: " + obj.getClass().getName());
DataSource ds = (DataSource)obj;
Connection conn = ds.getConnection();
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT a,b FROM test");
String ret = "";
while(rs.next())
ret += rs.getString(1) + " - " + rs.getString(2) + "<br/>";
conn.close();
return ret;
catch(Exception e)
return "Exception thrown: " + e.getClass().getName() + " -- " + e.getMessage();
}On the server, it is set up as XADataSource. I don't really have a big need for distributed transactions, but does it hurt badly to use it anyways? Could it be causing this problem? -
RFC/BAPI Exception in PI 7.0
Hi there,
currently we have a scenario where the message come from middleware and pass through PI to POSDM system via RFC.
my target structue is an BAPI .
for some reason if the BAPI execution gets failed on POSDM system then the BAPI should return some exception back to PI system,
can this be achived only by just adding the fault message type (ExchangeFaultData) in Inbound MI, whill this setting sufficient to get any error info from BAPI to PI via rfc, or do we need to do some exception mapping? if so can some one explain/Monika,
RFM that pretends to be a BAPI has to follow a few strict rules. Some of them are :
- BAPI is called always synchronously and are always successful i.e. errors are returned in EXPORT parameter (so no matter if BAPI created some document/posting or not is successful!)
- it does not return exceptions!
so you should not advise to make use exceptions ... otherwise it will not be a BAPI
The one of possible solution is to wrap BAPI either using proxy or RFM and then you can propagate exceptions to SAP PI.
/Jakub -
How to store a class-based exception as container element?
Hello,
In a BO type method, there are situations where unexpected class-based exceptions can occur, I handle them with TRY ... CATCH ... ENDTRY.
If such an error occurs, my BO type method also returns a BO type method exception using a return code (as usually).
1) Now, my question is how can I store the exception instance in the task container ? (so that to get more information about what happened... it is an unexpected error as I said)
Note that my question may apply to any class instance.
2) To achieve this, I have an idea but not sure if it's realistic (maybe the question is not realistic too ). I'll create a new BO type ZOOINSTANC with string attribute containing the serialized instance, with a method to display it.
Example how it could work, in my BO type method (it returns EXCEPTION parameter of type ZOOINSTANC):
TRY.
CATCH cx_root INTO lo_exc.
DATA l_exc TYPE string.
CALL TRANSFORMATION id
SOURCE oo = lo_exc
RESULT XML l_exc.
DATA l_bor_zooinstanc TYPE swc_object.
swc_create_object l_bor_zooinstanc 'ZOOINSTANC' ''. "no key
swc_set_property l_bor_zooinstanc l_exc.
swc_set_element container 'EXCEPTION' l_exc.
exit_return 1001 '' '' '' ''.
ENDTRY.
One important issue is that I don't know any API to display the instance :-p
Do you have any ideas, advices, ... ?
Thx
sandraHi Mike, thank you for your answer, and sorry for the delay.
> I'd rather go with the idea of returning the error details in a structured format that you can view in the container
Yes, but that's the issue as I don't know which exceptions can be triggered, as I'd like to handle all exceptions.
> I'd also ask why it's necessary to use BOR for this?
When a BOR method fails, I want technical support to have all the details of the error, not only a generic error message. It's why I want to store the exception in the workitem container, and be able to display it later.
> It's obviously your own development, so why not use classes. Subclasses of CX_BO_ERROR are recognised by workflow and you can even bring a proper message back to the WF log. There's also some info on this in the second edition of the WF book.
I did a test using demo workflow WS56400159 ("absence"), where I forced CX_BO_ERROR right after SWX_FORMABS_CREATE call in CL_SWF_FORMABSENC / CREATE method, but it seems that only the short text of the exception is kept.
So, I'm a little disappointed to see that we have a great exception "tool" with class-based exceptions, but only the last text is kept in the system! That would have been great to be able to store the whole information (the attributes, and the whole bunch of cascading exceptions (PREVIOUS attribute), instead of only a simple text).
sandra -
Exception handling in MI service call
Hi,
I have consumed MI service in web dynpro java.
I created model from local wsdl file etc and its working perfect
But one problem is that even though its succesful execution, it returns exception.
So I am not able to catch genuine failure cases.
I have tried all below three exceptions:
try{
wdContext.createRequest_MI_UI_BSCS_GL1_OUT_518Element(request_MI_UI_BSCS_GL1_OUT_518).modelObject().execute();
catch(Exception ex)
//wdComponentAPI.getMessageManager().reportException(ex.getMessage().toString(),true);
try {
wdContext.createRequest_MI_UI_BSCS_GL1_OUT_518Element(request_MI_UI_BSCS_GL1_OUT_518).modelObject().execute();
} catch (WDWSModelExecuteException e)
// TODO Auto-generated catch block
try {
wdContext.createRequest_MI_UI_BSCS_GL1_OUT_518Element(request_MI_UI_BSCS_GL1_OUT_518).modelObject().execute();
} catch (RuntimeException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();i used runtime exception along with the wdwsmodel exception
-
Is there a way to handle custom java exception in OSB?
For example, i created a exception that extends RuntimeException.
My exception has a new field called "code".
I want to handle this exception in Oracle Service Bus process and retrieve this code to throws another exception with a XML structure that includes the code.
Is there a way to do that ?
<con:fault xmlns:con="http://www.bea.com/wli/sb/context">
<con:errorCode>BEA-382515</con:errorCode>
<con:reason>Callout to java method "public static org.apache.xmlbeans.XmlObject ...</con:reason>
<con:java-exception xmlns:con="http://www.bea.com/wli/sb/context">
<con:java-content ref="jcid:33a6c126:14006f3df18:-7fd9"/>
</con:java-exception>
<con:location xmlns:con="http://www.bea.com/wli/sb/context">
<con:node>optmusPipeline</con:node>
<con:pipeline>optmusPipeline_request</con:pipeline>
<con:stage>processStage</con:stage>
<con:path>request-pipeline</con:path>
</con:location>
</con:fault>
it is not enough to recover the information i needed.Hi Sandro,
I've got the same situation. I agree that returning xml from function is not a best choice as you have to manually check if return status is an error or not. Processing exception in error handler is better and this is how I do it:
I am doing a java callout to a function that can throw exception. Then I add ErrorHandler to stage containing this callout (all the exception are caught here).
In the error handler I check if $fault/ctx:java-exception is not null. If not then I pass thrown exception to my utility function that converts it to xml similar to yours:
import org.apache.xmlbeans.XmlException;
import org.apache.xmlbeans.XmlObject;
public static XmlObject exceptionToXML(Throwable exception)
throws XmlException {
String xmlString = exceptionToString(exception);
return XmlObject.Factory.parse(xmlString);
public static String exceptionToString(Throwable exception) {
String cause = "";
if (exception.getCause() != null) {
cause = exceptionToString(exception.getCause());
return String
.format("<exception><name>%s</name><description>%s</description>%s</exception>",
exception.getClass().getName(), exception.getMessage(),
cause);
Calling exceptionToXML with $fault/ctx:java-exception/ctx:java-content returns:
<exception>
<name>pl.app.MyException</name>
<description>Exception message</description>
</exception>
Then you can check the exception class (IF action: $exception/name/text() = "pl.app.MyException") and handle it accordingly.
Good luck,
Krzysiek -
When I enter my ID and password and press Go, the loging box
returns Exception Error. How can I fix this?Hello, please check the Unable to Log In thread. There is a
possible workaround and I have a post about log-ins -- check the
more recent posts.
http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=72&catid=622&threadid =1215638&enterthread=y
Sami -
Oracle 11g Table function returns no records on first call
Hello,
On a Oracle 11g R2 I've a table function ( PIPELINED ) returning rows selected from a table.
The first time the function is selected, in a session ( I've tried to disconnect and log in again ), it returns no rows.
I've tried to log the call using DBMS_OUTPUT and from what I see the select on the table function returns no rows and no output is printed. So I presume Oracle is not calling the function.
The same function on a similar environment ( same db versions, patches and database structure ) works fine. The second environment is a production environment so it has more memory and some other settings enabled.
Does anyone know of settings that can relate to this behaviour ?
Thanks in advance for the help.
Regards,
Stefano MuretThank you for answering so fast.
Here's the function code:
FUNCTION template_parameters (iTemplate IN TEMPLATE_RAW_DATA.TMPL_ID%TYPE := NULL)
RETURN table_type_tmpl_parameters PIPELINED
IS
li_exception INTEGER DEFAULT -20025;
POUT_PARM TABLE_TYPE_TMPL_PARAMETERS;
lt_parms table_type_tmpl_parms_raw;
sParmCheck VARCHAR2(4000);
iOccurrence INTEGER;
BEGIN
pOut_Parm := table_type_tmpl_parameters();
pOut_Parm.EXTEND;
select
tmpl_id
*,tmpl_name*
*,replace(upper(trim(sql_out)),'[SCHEMA].')*
*,UPPER(TRIM(out_tmpl_parms))*
bulk collect into lt_parms
from ref_templates
where tmpl_id = NVL(iTemplate,tmpl_id)
order by tmpl_id;
FOR k IN 1..lt_parms.COUNT
LOOP
pOut_Parm(1).tmpl_id := lt_parms(k).tmpl_id;
pOut_Parm(1).tmpl_name := lt_parms(k).tmpl_name;
FOR i IN 1..2
LOOP
IF i = 1 THEN
sParmCheck := lt_parms(k).sql_out;
ELSE
sParmCheck := lt_parms(k).sql_parms;
END IF;
iOccurrence := 1;
*pOut_Parm(1).parameter_name := regexp_substr(sParmCheck,'\[[^\[]+\]',1,iOccurrence);*
WHILE pOut_Parm(1).parameter_name IS NOT NULL
LOOP
PIPE ROW (pOut_Parm(1));
iOccurrence := iOccurrence + 1;
*pOut_Parm(1).parameter_name := regexp_substr(sParmCheck,'\[[^\[]+\]',1,iOccurrence);*
END LOOP;
END LOOP;
END LOOP;
RETURN;
EXCEPTION
WHEN OTHERS THEN
RAISE_APPLICATION_ERROR(li_exception,SUBSTR(SQLERRM,1,1000));
RETURN;
END template_parameters;
This function is part of a package.
The data on both environments is the same. -
PLS-00630: pipelined functions must have a supported collection return type
Hello, I created an TYPE of OBJECT and a PLSQL Function as shown below, but the function compilation errors with following. Not sure where is the issue?
PLS-00630: pipelined functions must have a supported collection return typeThis is on Oracle 10g r2
CREATE OR REPLACE TYPE cxs_plsql_profiler_object_type AS OBJECT (
cxs_object_name VARCHAR2 (128),
cxs_object_type VARCHAR2 (19),
cxs_object_status VARCHAR2 (7),
cxs_read_execution NUMBER,
cxs_buffer_gets NUMBER,
cxs_disk_reads NUMBER,
cxs_executions NUMBER,
cxs_sorts NUMBER,
cxs_sharable_mem NUMBER,
cxs_address NUMBER,
cxs_hashvalue NUMBER,
cxs_osuser VARCHAR2 (30),
cxs_username VARCHAR2 (30),
cxs_module VARCHAR2 (48),
cxs_machine VARCHAR2 (64),
cxs_status VARCHAR2 (8),
cxs_terminal VARCHAR2 (16),
cxs_percentconsume NUMBER,
cxs_percentrepeat NUMBER,
cxs_plan VARCHAR2 (120),
target_name VARCHAR2 (200),
referenced_name VARCHAR2 (200),
referenced_type VARCHAR2 (200),
targetowner VARCHAR2 (200),
refowner VARCHAR2 (200)
)and here is the API
FUNCTION CXS_GENERATE_PLSQL_PROFILER
RETURN cxs_plsql_profiler_object_type
PIPELINED IS
out_rec cxs_plsql_profiler_object_type ;
plsbatch plsql_batch;
skount integer;
dpendrec depend_tab;
dkount integer;
CURSOR objects
IS
SELECT object_name, object_type
FROM dba_objects
WHERE status = 'VALID'
AND owner NOT IN ('SYS', 'SYSTEM')
AND object_type IN ('PACKAGE', 'PROCEDURE', 'FUNCTION');
CURSOR apis (p_object dba_objects.object_name%TYPE)
IS
SELECT DISTINCT *
FROM (SELECT SUBSTR (a.sql_text, 1, 50) sql_text,
TRUNC
( a.disk_reads
/ DECODE (a.executions,
0, 1,
a.executions
) reads_per_execution,
a.buffer_gets, a.disk_reads, a.executions,
a.sorts, a.sharable_mem, a.address,
a.hash_value, b.osuser, b.username,
b.module, b.machine, b.status, b.terminal,
ROUND
(cxs_db_info.kompute_percentofsql
(a.sharable_mem),
5
) percentkonsume,
cxs_db_info.kount_repeat
(b.osuser,
b.terminal
) percentr,
c.operation explainplan
FROM v$sqlarea a, v$session b, v$sql_plan c
WHERE b.sql_hash_value = a.hash_value
AND b.sql_address = a.address
AND a.hash_value = c.hash_value
AND a.address = c.address
AND b.status = 'ACTIVE'
AND UPPER (a.sql_text) LIKE
'%' || p_object || '%'
AND c.ID = 0
ORDER BY 2 DESC)
WHERE ROWNUM <= 50; --profile option
BEGIN
skount := 0;
dkount := 0;
FOR i IN objects
LOOP
FOR j IN apis (i.object_name)
LOOP
skount := skount + 1;
plsbatch(skount).cxs_object_name := i.object_name;
plsbatch(skount).cxs_object_type := i.object_type;
plsbatch(skount).cxs_object_status := i.object_status;
plsbatch(skount).cxs_read_execution := j.reads_per_execution;
plsbatch(skount).cxs_buffer_gets := j.buffer_gets;
plsbatch(skount).cxs_disk_reads := j.disk_reads;
plsbatch(skount).cxs_executions := j.executions;
plsbatch(skount).cxs_sorts := j.sorts;
plsbatch(skount).cxs_sharable_mem := j.sharable_mem;
plsbatch(skount).cxs_address := j.address;
plsbatch(skount).cxs_hashvalue := j.hashvalue;
plsbatch(skount).cxs_osuser := j.osuser;
plsbatch(skount).cxs_username := j.username;
plsbatch(skount).cxs_module := j.module;
plsbatch(skount).cxs_machine := j.machine;
plsbatch(skount).cxs_status := j.status;
plsbatch(skount).cxs_terminal := j.terminal;
plsbatch(skount).cxs_percentconsume := j.percentconsume;
plsbatch(skount).cxs_percentrepeat := j.percentrepeat;
plsbatch(skount).cxs_plan := j.explainplan;
END LOOP;
FOR dd IN dpend (i.object_name)
LOOP
dkount := dkount + 1;
dependrec (dkount).target_name := dd.NAME;
dependrec (dkount).refname := dd.referenced_name;
dependrec (dkount).reftype := dd.referenced_type;
dependrec (dkount).target_owner := dd.owner;
dependrec (dkount).refowner := dd.referenced_owner;
END LOOP;
END LOOP;
for a in 1..skount loop
out_rec.cxs_object_type := plsbatch(a).object_type;
out_rec.cxs_object_status := plsbatch(a).object_status;
out_rec.cxs_read_execution := plsbatch(a).reads_per_execution;
out_rec.cxs_buffer_gets := plsbatch(a).buffer_gets;
out_rec.cxs_disk_reads := plsbatch(a).disk_reads;
out_rec.cxs_executions := plsbatch(a).executions;
out_rec.cxs_sorts := plsbatch(a).sorts;
out_rec.cxs_sharable_mem := plsbatch(a).sharable_mem;
out_rec.cxs_address := plsbatch(a).address;
out_rec.cxs_hashvalue := plsbatch(a).hashvalue;
out_rec.cxs_osuser := plsbatch(a).osuser;
out_rec.cxs_username := plsbatch(a).username;
out_rec.cxs_module := plsbatch(a).module;
out_rec.cxs_machine := plsbatch(a).machine;
out_rec.cxs_status := plsbatch(a).status;
out_rec.cxs_terminal := plsbatch(a).terminal;
out_rec.cxs_percentconsume := plsbatch(a).percentconsume;
out_rec.cxs_percentrepeat := plsbatch(a).percentrepeat;
out_rec.cxs_plan := plsbatch(a).explainplan;
PIPE ROW(out_rec);
end loop;
for b in 1..dkount loop
out_rec.target_name := dd.NAME;
out_rec.refname := dependrec (b).referenced_name;
out_rec.reftype := dependrec (b).referenced_type;
out_rec.target_owner := dependrec (b).owner;
out_rec.refowner := dependrec (b).referenced_owner;
PIPE ROW(out_rec);
end loop;
RETURN;
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE(DBMS_UTILITY.format_error_backtrace);
DBMS_OUTPUT.PUT_LINE(SQLCODE);
DBMS_OUTPUT.PUT_LINE(SQLERRM);
END; and below are tradtional table types that are used in code above.
TYPE type_plsql_rec IS RECORD (
cxs_object_name VARCHAR2 (128),
cxs_object_type VARCHAR2 (19),
cxs_object_status VARCHAR2 (7),
cxs_read_execution NUMBER,
cxs_buffer_gets NUMBER,
cxs_disk_reads NUMBER,
cxs_executions NUMBER,
cxs_sorts NUMBER,
cxs_sharable_mem NUMBER,
cxs_address NUMBER,
cxs_hashvalue NUMBER,
cxs_osuser VARCHAR2 (30),
cxs_username VARCHAR2 (30),
cxs_module VARCHAR2 (48),
cxs_machine VARCHAR2 (64),
cxs_status VARCHAR2 (8),
cxs_terminal VARCHAR2 (16),
cxs_percentconsume NUMBER,
cxs_percentrepeat NUMBER,
cxs_plan VARCHAR2 (120)
TYPE plsql_batch IS TABLE OF type_plsql_rec
INDEX BY BINARY_INTEGER;
TYPE type_depend_tab IS RECORD (
target_name dba_dependencies.NAME%TYPE,
refname dba_dependencies.referenced_name%TYPE,
reftype dba_dependencies.referenced_type%TYPE,
target_owner dba_dependencies.owner%TYPE,
refowner dba_dependencies.referenced_owner%TYPE
TYPE depend_tab IS TABLE OF type_depend_tab
INDEX BY BINARY_INTEGER;
Thank you for your time in reading this post
RThank you Billy and Saubhik,
I have followed your guidelines and was able to resolve this error. Now, after successfully compiling the code, I attempted to execute it in a following way.
SELECT * FROM TABLE (cxs_generate_plsql_profiler);It gives following error: ORA-00904: "CXS_GENERATE_PLSQL_PROFILER": invalid identifier
I also tried putting in quotes like below
SELECT * FROM TABLE ('cxs_generate_plsql_profiler');Then, it gives following error:
ORA-22905: cannot access rows from a non-nested table item
Any Idea where I am doing wrong?
Thanks,
R
Maybe you are looking for
-
How best to send images by email, esp. to Windoze machines?
I'm having trouble getting mails to people with just a couple of jpegs, total about 1MB. I use Panther, and Mail 1.3.11. I do check "send Windows-friendly attachments". One recipient is an AOL user, dial-up. Another complains that my mails were zippe
-
How to start a AT PSU whitut mobo
How do i start a AT PSU by not using a mobo? I know how do to it with a ATX, buy i dont got any free ATX for my project... It is by using a wire and the 20 pin, right?
-
AIR 3.9 for android, how to load file in primordial worker
when i use AIR 3.9 for android version of my game, i can not load file in primordial worker swf. I use the code below: var loader : URLLoader = new URLLoader(); loader.dataFormat = URLLoaderDataFormat.BINARY; loader.addEventListener(IOErrorEvent.IO_E
-
Return to OAF page after invoking configurator
Hi, I'm having a problem to return my OAF page – after invoking configuration pages. I know that this topic was discussed here before, but without any summering conclusions. Can anyone please assist? I'd appreciate any help. Thanks in advance, Rona
-
Hi, I am using jaxb 1.0.4 and my shemas are as follows.,. document.xsd <xs:schema> <xs:element name="document" type="documentType"/> <xs:complexType name="documentType"> <xs:sequence> <xs:element name="instance" typ