Capture error messages from stored procedure calls
Hi there,
How do I capture a stored procedure calls error messages provided the stored procedures does not have output parameters? This questions applies to Oracle 7.3.4 stored procedures calls.
TQ
Neo
There are two parts.
The stored proc must 'throw' an exception.
And java must catch it.
You probably already have the java part. That is the catch(SQLException).
As for the stored proc you can use the following search string in the jdbc forum
raise oracle
You need to use 'raise' in the stored proc but I am not sure of the exact form, but one of the threads using the above search string is likely to have it.
Similar Messages
-
Display error messages from Stored Procedures through ODBC
I am working on a C++ application that uses an Oracle ODBC connection. In the exception part of a stored procedure I am using dbms_output.put_line ('error message'). Is there any way to display this message in the C++ application?
Thanks.There are two parts.
The stored proc must 'throw' an exception.
And java must catch it.
You probably already have the java part. That is the catch(SQLException).
As for the stored proc you can use the following search string in the jdbc forum
raise oracle
You need to use 'raise' in the stored proc but I am not sure of the exact form, but one of the threads using the above search string is likely to have it. -
Response message from stored procedure
I have created the stored procedure(oracle)
CREATE OR REPLACE PROCEDURE UPDATE_INSERT(sHID IN VARCHAR2,sZNAME IN VARCHAR2,sZDATE IN DATE)IS
I NUMBER;
BEGIN
SELECT COUNT(HID) INTO I FROM ZSO_H WHERE HID = sHID;
IF I > 0
THEN
begin
DELETE FROM ZSO_H WHERE HID = sHID;
end;
END IF;
INSERT INTO zso_h VALUES(sHID,sZNAME,sZDATE);
commit;
END UPDATE_INSERT;
It's proxy to jdbc synchronous scenario.
I can see data saved in the table, and sucessfull in communication channel monitoring.
but sxmn_moni, get error,(SAP system)
<SAP:AdditionalText>com.sap.aii.af.ra.ms.api.DeliveryException</SAP:AdditionalText>
<SAP:ApplicationFaultMessage namespace="" />
<SAP:Stack />
<SAP:Retry>M</SAP:Retry>
sxmb_moni in XI
<?xml version="1.0" encoding="utf-8" ?>
- <ns0:t002_ora_response xmlns:ns0="http://topfine.com/proxy">
<st3_response />
<st3_response />
<st3_response />
<st3_response />
<st3_response />
</ns0:t002_ora_response>
but structure is
<st3_response>
<insert_count/>
<update_count/>
</st3_response>
and the db request message is
<?xml version="1.0" encoding="UTF-8" ?>
- <ns0:t002_ora xmlns:ns0="http://topfine.com/proxy">
- <st3>
- <spName action="execute">
<table>UPDATE_INSERT</table>
<SHID type="VARCHAR">21</SHID>
<SZNAME type="VARCHAR">21</SZNAME>
<SZDATE type="DATE">2010-11-21</SZDATE>
</spName>
</st3>
- <st3>
- <spName action="execute">
<table>UPDATE_INSERT</table>
<SHID type="VARCHAR">22</SHID>
<SZNAME type="VARCHAR">22</SZNAME>
<SZDATE type="DATE">2010-11-21</SZDATE>
</spName>
</st3>
then how to get update_count in response message?
Edited by: Shen Peng on Nov 21, 2010 8:35 AMCan you jus let know totally how many are getting Updated and inserted for the Proxy u sent....I am guessin the response from ur DB is
<?xml version="1.0" encoding="utf-8" ?>
- <ns0:t002_ora_response xmlns:ns0="http://topfine.com/proxy">
<st3_response />
<st3_response />
<st3_response />
<st3_response />
<st3_response />
</ns0:t002_ora_response>
So probably four records are getting updated or inserted...
Check this blog may be helpful
/people/siva.maranani/blog/2005/09/16/xi-how-to-on-jdbc-receiver-response -
How to capture error message from standard function module
Dear friends
when i execute standard function module in finance , i am getting error message , pls check the below screen shot,
how to capture the below error message so that i have display in my webdynpro component
Thanks
VijayaHello Vijaya,
Incase of BAPI's they have a return table parameter T_RETURN. Just read that return table to get the error message.
Incase of normal function modules, there will be exceptions raised for the message used inside the function module. Just read the sy-subrc after the FM and based on the sy-subrc value find the respective exception raised.
May be you can try like this, whenever the message is raised it will be stored in the system variable.
CALL FM.
check for the system variables.
sy-msgid = Message ID of the latest message raised.
sy-msgno = message number of the latest message raised.
sy-msgty = message type of the latest message raised.
sy-msgv1 = variable1 of the latest message raised.
sy-msgv2 = variable2 of the latest message raised.
sy-msgv3 = variable3 of the latest message raised.
sy-msgv4 = variable4 of the latest message raised.
Regards,
TP -
NullPointerException from stored procedure call - Re-edited
Hi All,
I'm Re-editing this as my first attempt was pretty weak.
I'm attempting to create a Java application that communicates with a Oracle XE edition database using:
Class.forName("oracle.jdbc.driver.OracleDriver");
JOptionPane.showMessageDialog(null, "Driver Loaded");
Connection con = DriverManager.getConnection("jdbc:oracle:thin:@//localhost:1521/xe", "SYSTEM", "root");
JOptionPane.showMessageDialog(null, "Database connected");
This all works fine and I can perform queries and transactional statements from within the java instance.
However, I cannot call stored procedures as i receive a null pointer exception. The stored procedure I am trying to call returns no values however I know it works as I can execute it within SQL Developer. The code below is the java statement that calls the stored procedure, alll the sources I have looked at say this is correct, I have also tried, cs.executeUpdate and Resultset rs when attempting to call the statement.
public void thread_actionsperformed(ActionEvent c)//generates threads
try
CallableStatement cs = con.prepareCall("{call PROCEDURE2}"); //Calls stored procedure that would generate threaded emails
cs.execute();
JOptionPane.showMessageDialog(null,"Threading algorithm Executed successfully");
catch(SQLException ex)
ex.printStackTrace();
JOptionPane.showMessageDialog(null,"Threading algorithm Executed unsuccessfully");//Error response
catch(NullPointerException ex)
ex.printStackTrace();
JOptionPane.showMessageDialog(null,"Threading algorithm Executed unsuccessfully");//Error response
Could it be that the Java application cannot 'see' the sp? Or is it something to do with the privileges? I've been stumped by this for quite a while now, any help would be greatly appreciated.
java.lang.NullPointerException
at ETA_Final.thread_actionPerformed(ETA_Final.java:332)
at ETA_Final$5.actionPerformed(ETA_Final.java:141)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1223)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1264)
at java.awt.Component.processMouseEvent(Component.java:6263)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3255)
at java.awt.Component.processEvent(Component.java:6028)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4630)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2475)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Thanks and regards,
K
Edited by: Outbound86 on 28-Apr-2010 13:58Ivaylo,
Thanks for the reply,
The code that I originally pasted is the code from 332 onwards, however the specific line(s) are below;
CallableStatement cs = con.prepareCall("{call PROCEDURE2}"); //Calls stored procedure that would generate threaded emails
cs.execute();
The actionlistener i use to call the statement also returns a null pointer exception, however it works for all the other sql statements that I send across to the oracle db, i'm using a stored procedure as it would be a pain to construct the pl/sql script in Java.
menuItemB.addActionListener( new java.awt.event.ActionListener()
public void actionPerformed(ActionEvent bb)
menuItemB_actionPerformed(bb);//Calls menu specific method
Hope this helps you help me!
Thanks,
K -
How to capture return value from stored procedure?
Hi All,
I want to capture the retun values from this procedure to a table - CALL SYS.GET_OBJECT_DEFINITION('SCHEMA_NAME', 'TABLE_NAME').
The below approach is not working -
Insert into STG.STG_DDL
Call SYS.GET_OBJECT_DEFINITION('DWG', 'DWG_SITE')
Could you please have a look on the same?
Thank you,
VijeeshThanks a lot Everyone.
Considering the discussed options, and an approach explained in this thread - -http://scn.sap.com/thread/3291461 , I have written an SQL to build the Alter statements to add the columns & Constrains to table.
The below Query will provide the scripts to build a table in another environment.
select * from (
select TABLE_name,'tbl_Create' column_name, 1 as position, 'CREATE TABLE '|| schema_name ||'.'|| table_name ||' ( DUMMY_CLMN INTEGER);' as SQLCMD
from tableS
where schema_name ='DWG'
and TABLE_name ='DWG_PRODUCTION_VOLUME_TRX'
UNION ALL
-- MASS change of NOT NULL COLUMNS
-- set to NOT NULL - character data type, double, decimal fixed - need the length but not the scale
select TABLE_name,column_name, position + 100, 'ALTER TABLE '|| schema_name ||'.'|| table_name ||' ADD ('||column_name ||' '||data_type_name ||' (' || length ||') NOT NULL) ;' as SQLCMD
from table_columns
where is_nullable = 'FALSE'
and schema_name ='DWG'
and TABLE_name ='DWG_PRODUCTION_VOLUME_TRX'
and data_type_name in ('VARCHAR', 'NVARCHAR', 'DOUBLE')
and scale is NULL
UNION ALL
-- MASS change of NOT NULL COLUMNS
-- set to NOT NULL - character data type, double, decimal fixed - need the length but not the scale
select TABLE_name,column_name, position + 100,'ALTER TABLE '|| schema_name ||'.'|| table_name ||' ADD ('||column_name ||' '||data_type_name ||' (' || length ||') );' as SQLCMD
from table_columns
where is_nullable = 'TRUE'
and schema_name ='DWG'
and TABLE_name ='DWG_PRODUCTION_VOLUME_TRX'
and data_type_name in ('VARCHAR', 'NVARCHAR', 'DOUBLE')
and scale is NULL
UNION ALL
-- set to NOT NULL - DECIMAL (FLOATING POINT)- needs length and scale
select TABLE_name,column_name, position + 100, 'ALTER TABLE '|| schema_name ||'.'|| table_name ||' ADD ('||column_name ||' '||data_type_name ||' (' || length ||','|| scale ||') NOT NULL) ;' as SQLCMD
from table_columns
where is_nullable = 'FALSE'
and schema_name ='DWG'
and TABLE_name ='DWG_PRODUCTION_VOLUME_TRX'
and data_type_name in ('DECIMAL' )
and scale is not null
UNION ALL
-- set to NOT NULL - DECIMAL (FLOATING POINT)- needs length and scale
select TABLE_name,column_name, position + 100, 'ALTER TABLE '|| schema_name ||'.'|| table_name ||' ADD ('||column_name ||' '||data_type_name ||' (' || length ||','|| scale ||') ) ;' as SQLCMD
from table_columns
where is_nullable = 'TRUE'
and schema_name ='DWG'
and TABLE_name ='DWG_PRODUCTION_VOLUME_TRX'
and data_type_name in ('DECIMAL' )
and scale is not null
UNION ALL
-- set to NOT NULL - DECIMAL (FLOATING POINT)- needs length and null scale
select TABLE_name,column_name, position + 100, 'ALTER TABLE '|| schema_name ||'.'|| table_name ||' ADD ('||column_name ||' '||data_type_name ||' (' || length ||') NOT NULL) ;' as SQLCMD
from table_columns
where is_nullable = 'FALSE'
and schema_name ='DWG'
and TABLE_name ='DWG_PRODUCTION_VOLUME_TRX'
and data_type_name in ('DECIMAL' )
and scale is null
UNION ALL
-- set to NOT NULL - DECIMAL (FLOATING POINT)- needs length and null scale
select TABLE_name,column_name, position + 100, 'ALTER TABLE '|| schema_name ||'.'|| table_name ||' ADD ('||column_name ||' '||data_type_name ||' (' || length ||') NOT NULL) ;' as SQLCMD
from table_columns
where is_nullable = 'TRUE'
and schema_name ='DWG'
and TABLE_name ='DWG_PRODUCTION_VOLUME_TRX'
and data_type_name in ('DECIMAL' )
and scale is null
UNION ALL
-- set to NOT NULL - DATE | TIME | SECONDDATE | TIMESTAMP | TINYINT | SMALLINT | INTEGER - don't need length or scale
select TABLE_name,column_name, position + 100, 'ALTER TABLE '|| schema_name ||'.'|| table_name ||' ADD ('||column_name ||' '||data_type_name ||' NOT NULL) ;' as SQLCMD
from table_columns
where is_nullable = 'FALSE'
and schema_name ='DWG'
and TABLE_name ='DWG_PRODUCTION_VOLUME_TRX'
and data_type_name in ('DATE', 'LONGDATE', 'TIME', 'SECONDDATE', 'TIMESTAMP', 'TINYINT', 'SMALLINT', 'INTEGER' )
-- and scale is not null
UNION ALL
-- set to NOT NULL - DATE | TIME | SECONDDATE | TIMESTAMP | TINYINT | SMALLINT | INTEGER - don't need length or scale
select TABLE_name,column_name, position + 100, 'ALTER TABLE '|| schema_name ||'.'|| table_name ||' ADD ('||column_name ||' '||data_type_name ||' ) ;' as SQLCMD
from table_columns
where is_nullable = 'TRUE'
and schema_name ='DWG'
and TABLE_name ='DWG_PRODUCTION_VOLUME_TRX'
and data_type_name in ('DATE', 'LONGDATE', 'TIME', 'SECONDDATE', 'TIMESTAMP', 'TINYINT', 'SMALLINT', 'INTEGER' )
-- and scale is not null
UNION ALL
select table_name, 'PK' AS column_name, 9990, 'ALTER TABLE '||table_name||' ADD CONSTRAINT Primary_key PRIMARY KEY ('||PK_COLUMN_NAME1||
case when PK_COLUMN_NAME2 is null then ' ' else ','|| PK_COLUMN_NAME2 end ||
case when PK_COLUMN_NAME3 is null then ' ' else ','|| PK_COLUMN_NAME3 end ||
case when PK_COLUMN_NAME4 is null then ' ' else ','|| PK_COLUMN_NAME4 end ||');'
from
(SELECT DISTINCT C1.table_name , C1.COLUMN_NAME AS PK_COLUMN_NAME1, C2.COLUMN_NAME AS PK_COLUMN_NAME2, C3.COLUMN_NAME AS PK_COLUMN_NAME3, C4.COLUMN_NAME AS PK_COLUMN_NAME4
FROM (SELECT * FROM CONSTRAINTS WHERE POSITION=1 AND IS_PRIMARY_KEY = 'TRUE') C1
LEFT JOIN (SELECT * FROM CONSTRAINTS WHERE POSITION=2 AND IS_PRIMARY_KEY = 'TRUE') C2
ON C1.table_name = C2.table_name
LEFT JOIN (SELECT * FROM CONSTRAINTS WHERE POSITION=3 AND IS_PRIMARY_KEY = 'TRUE') C3
ON C2.table_name = C3.table_name
LEFT JOIN (SELECT * FROM CONSTRAINTS WHERE POSITION=4 AND IS_PRIMARY_KEY = 'TRUE') C4
ON C3.table_name = C4.table_name
LEFT JOIN (SELECT * FROM CONSTRAINTS WHERE POSITION=5 AND IS_PRIMARY_KEY = 'TRUE') C5
ON C4.table_name = C5.table_name
) PK
where table_name = 'DWG_PRODUCTION_VOLUME_TRX'
UNION ALL
select table_name, 'UK' AS column_name, 9991, 'ALTER TABLE '||table_name||' ADD CONSTRAINT UNIQUE ('||UK_COLUMN_NAME1||
case when UK_COLUMN_NAME2 is null then ' ' else ','|| UK_COLUMN_NAME2 end ||
case when UK_COLUMN_NAME3 is null then ' ' else ','|| UK_COLUMN_NAME3 end ||
case when UK_COLUMN_NAME4 is null then ' ' else ','|| UK_COLUMN_NAME4 end ||');'
FROM
(SELECT DISTINCT C1.table_name , C1.COLUMN_NAME AS UK_COLUMN_NAME1, C2.COLUMN_NAME AS UK_COLUMN_NAME2, C3.COLUMN_NAME AS UK_COLUMN_NAME3, C4.COLUMN_NAME AS UK_COLUMN_NAME4
FROM (SELECT * FROM CONSTRAINTS WHERE POSITION=1 AND IS_PRIMARY_KEY = 'FALSE') C1
LEFT JOIN (SELECT * FROM CONSTRAINTS WHERE POSITION=2 AND IS_PRIMARY_KEY = 'FALSE') C2
ON C1.table_name = C2.table_name
LEFT JOIN (SELECT * FROM CONSTRAINTS WHERE POSITION=3 AND IS_PRIMARY_KEY = 'FALSE') C3
ON C2.table_name = C3.table_name
LEFT JOIN (SELECT * FROM CONSTRAINTS WHERE POSITION=4 AND IS_PRIMARY_KEY = 'FALSE') C4
ON C3.table_name = C4.table_name
LEFT JOIN (SELECT * FROM CONSTRAINTS WHERE POSITION=5 AND IS_PRIMARY_KEY = 'FALSE') C5
ON C4.table_name = C5.table_name
) UK
where table_name = 'DWG_PRODUCTION_VOLUME_TRX'
UNION ALL
SELECT REFERENCED_TABLE_NAME AS table_name,'FK' AS column_name, 9992,
'ALTER TABLE DWG.'||TABLE_NAME||' ADD FOREIGN KEY ( '||COLUMN_NAME||' ) REFERENCES '|| REFERENCED_TABLE_NAME||'('||COLUMN_NAME||' ) ON UPDATE CASCADE ON DELETE RESTRICT;'
FROM REFERENTIAL_CONSTRAINTS
WHERE REFERENCED_TABLE_NAME = 'DWG_SITE'
UNION ALL
select TABLE_name,'tbl_ClmnDrop' column_name, 9995 as position, 'ALTER TABLE '|| schema_name ||'.'|| table_name ||' DROP ( DUMMY_CLMN );' as SQLCMD
from tableS
where schema_name ='DWG'
and TABLE_name ='DWG_PRODUCTION_VOLUME_TRX'
order by position; -
Web Service receives no data from Stored Procedure call.
Issue: When calling a Stored Procedure from a Web Service no data is returned.
Lead up: I can call the SP 100 times a day for 3-4 days then for some reason the Web Service no longer get the data from SQL. I have ran a trace and I can see the SP running though all of its steps and returning the data, but the Web Service
is not getting it.
Fix: None yet.
Work around: Before the Web Service calls the SP, I am sending an SP_Recompile to the SP in question. For now this seems to have resolved the issue.
Detail:
1. SP is querying data from another DB on the same server.
2. SP is storing query data in Temp Tables.Hello,
Does your Stored Procedure have parameters? If so, the issue may be cause by parameter sniffing. Please refer to the following blog about Paraemeter Sniffing:
http://www.sommarskog.se/query-plan-mysteries.html
The recommended fix for most situations is to not use parameters directly in queries, but rather store them into local variables and then use those variables in the queries.
Regards,
Fanny Liu
If you have any feedback on our support, please click here.
Fanny Liu
TechNet Community Support -
How to capture error message in a FM call during exception
Hi,
The FM i'm trying to call is giving an exception and don't have the built in mechanism to pass on the error message that occured during processing.
However, if i see the job log in SM37, I'm able to see the corresponding error message.
Please let me know on how to capture this error message with in my program.
Thanks,
Vijay.Hi,
add the exceptions...ERROR_MESSAGE to capture the error message..raised in the function module.
EXCEPTIONS
ERROR_MESSAGE = 1.
Thanks
Naren -
Who know how to handle pl/sql table return from stored procedure calling from jsp
I have some stored procedure which return pl/sql table (index by table), It is look like an array. how jdbc handle this?
CallableStatement cs = con.prepareCall("EXECUTE bill.getcountry(?,?)");
cs.setInt(1, cid);
cs.registerOutParameter(2, java.sql.Types.VARCHAR);// ARRAY?
ResultSet rs = cs.executeQuery();
Array array = (Array) rs.getObject (1);
ResultSet array_rset = array.getResultSet ();Not that familiar with the OCI (Oracle Call Interface), but I think this call will be problematic - the OCI deals with SQL data types and not with PL/SQL structures.
The OCI has since Oracle 8i sported an object call interface (see OCI Runtime Environment for Objects for details).
This allows you to use the CREATE TYPE command to create advance user data types - and these are supported by the SQL engine, PL/SQL engine and external languages via the OCI.
So you need to have a look at the Perl-DBI documentation to see how it supports Oracle object types and consider using these. As for internal PL/SQL data structures. These are not supported by the SQL engine and I would expect limited or no support in the OCI for these. Anyway, using SQL data types makes a lot more sense ito flexibility and transparency across languages and environments. -
Capturing error messages from Oracle EBS APIs when using Oracle Apps Adapter
We are using Oracle applications adapter to call Oracle EBS (both R11.5 and R12) APIs. I want to understand the best practice around error handling when using Oracle Apps Adapter to call Oracle EBS.
Here are some observations:
1. Most of the APIs return X_RETURN_STATUS and X_MSG_DATA containing the status and messages if any.
2. If the MSG COUNT is 1 then X_MSG_DATA contains the message, if MSG COUNT is > 1. X_MSG_DATA is empty.
We know that when calling the API directly from PL/SQL, we need to loop through FND_MSG_PUB to fetch all messages when there are more than 1. How do we achieve the same using Apps Adapter as Apps Adapter generates the PL/SQL block to call the API dynamically at runtime.
In some APIs, which have table/rec types as input or output parameters, Apps Adapter generates a wrapper package to do conversion from SQL--> PL/SQL and viceversa. In this case the adapter calls the custom package generated which internally calls the API. For these APIs we were able to put the logic to loop through FND_MSG_PUB and return a concatenated string as value of X_MSG_DATA.
But what should we do for the APIs which do NOT have a rec/table type as input or output, in which case the Apps Adapter directly calls the API and there is no intermediate custom package?
How are others handling this?Please see the section "Handling Functional Errors" in the below link
Oracle Fusion Middleware Adapter for Oracle Applications User's Guide -
Capture error messages from CLASS cx_document_bcs
Hi ,
I am using the class CL_BSC for sending mail with attachment,i need to disply the messge captured in the cx_document_bcs in spool log.
TRY.
lo_document->add_attachment(
EXPORTING
i_attachment_type = 'PDF'
i_attachment_subject = 'Test*
i_attachment_subject = i_attachment_subject1
i_att_content_hex = lt_att_content_hex ).
CATCH cx_document_bcs INTO lx_document_bcs.
ENDTRY.
How to disply the messges in Spool,which are captured in the cx_document_bcs.
Please advise.
Thanks
KiranHi Kiran,
Catch exceptions like this.
TRY.
CATCH cx_document_bcs INTO lx_document_bcs.
MESSAGE Ennn(ZXX).
CLEANUP.
ENDTRY.
There you can check diffrent exceptions like this.. from class CX_DOCUMENT_BCS..
ERROR_TYPE parameter of lx_document_bcs contains the below values.. or you can use message parameters. Check constructore parameters in that class.
OBJECT_NOT_EXISTS
KPRO_ERROR
MIME_NOT_AVAILABLE
Based on the code you can give meaning ful message. -
Paging a message from stored procedure
How can we write a code in pl/sql to send a pager message to a specified pager ?
AtulIf you can send an email to pager then you may use utl_smtp package
otherwise you have to clarify how technically you can send a message to pager
Maybe you need some hardware costing 1M $ ;) -
Executing SQLPLUS command from Stored Procedure
Hi,
I am trying to execute the SQLPLUS command (CONNECT) from the stored procedure.
It is throwing below error message.
Stored Procedure:
SQL> select user from dual
2 ;
USER
SYS
SQL> create or replace
2 PROCEDURE PROCEDURE1 AS
3 BEGIN
4 sqlplus sys/sys@D as sysdba;
5 --execute immediate 'create user 'kkk' identified by 'kkk';
6 END PROCEDURE1;
7 /
Warning: Procedure created with compilation errors.
SQL> show err
Errors for PROCEDURE PROCEDURE1:
LINE/COL ERROR
3/9 PLS-00103: Encountered the symbol "SYS" when expecting one of the
following:
:= . ( @ % ;
The symbol ":=" was substituted for "SYS" to continue.
3/22 PLS-00103: Encountered the symbol "AS" when expecting one of the
following:
. ( * @ & = - + ; < / > at in is mod remainder not rem
<an exponent (**)> <> or != or ~= >= <= <> and or like LIKE2_
LIKE4_ LIKEC_ between || member SUBMULTISET_
The symbol ". was inserted before "AS" to continue.
Please let me know whether it is possible to do or not.
If there is possiblility how can does this be done?
Edited by: NGK246 on Aug 28, 2012 2:21 AMNGK246 wrote:
Hi,
I am trying to execute the SQLPLUS command (CONNECT) from the stored procedure.
It is throwing below error message.
It would not. It will always throw an error. SQLPLUS is a Utility and not a Command/Construct, that it would be available for a Stored Procedure
>
SQL> select user from dual
2 ;
USER
SYSWhich Database are you onto? Is it DMIP?
SQL> create or replace
2 PROCEDURE PROCEDURE1 AS
3 BEGIN
4 sqlplus sys/sys@DMIP as sysdba;
5 --execute immediate 'create user 'kkk' identified by 'kkk';
6 END PROCEDURE1;
7 /
Warning: Procedure created with compilation errors.
SQL> show err
Errors for PROCEDURE PROCEDURE1:
LINE/COL ERROR
3/9 PLS-00103: Encountered the symbol "SYS" when expecting one of the
following:
:= . ( @ % ;
The symbol ":=" was substituted for "SYS" to continue.
3/22 PLS-00103: Encountered the symbol "AS" when expecting one of the
following:
. ( * @ & = - + ; < / > at in is mod remainder not rem
<an exponent (**)> <> or != or ~= >= <= <> and or like LIKE2_
LIKE4_ LIKEC_ between || member SUBMULTISET_
The symbol ". was inserted before "AS" to continue.
Please let me know whether it is possible to do or not.
If there is possiblility how can does this be done?If you are at DMIP, you need not Login again. You can Login Manually to the Database and Execute the Procedure (in which you intend to create a User 'kkk').
However, if you are trying to Create a User in a Different Database, You will first require a DB Link to exist to connect to the Remote Database. You will also require Explicit privileges to create any user (Although I am not sure if you can create User onto a different Database.)
I would like to ask you, why are you creating a User on a Remote database? Can you not execute the same procedure on the Remote database and create User? Also, you are using SYS login to perform the activity. Ideally it should not be allowed. You must create a user and grant DBA rights to perform such activities. -
Error message from database stored procedures
I would like to have some error message show at client side from stored procedures.
I use MS SQL Server and use RAISEERROR, but ColdFusion does not bring the error message just ignore the error continue to run the other part of code.
I just want to know are there any way to bring stroed procedure error message to client, or I have to trap the error at Web Server or JavaScript level.
Your help and information is great appreciated,
Regards,
Iccsi,Just wrap your cfstoredproc in a cftry/cfcatch. See this for an example:
http://stackoverflow.com/questions/1879754/accessing-raiseerror-message-from-cfstoredproc
There's no way your javascript can trap this server-side error though, unless you were calling your CFM page that calls the stored proc via an AJAX request. -
Error while fetching Stored procedure from JDev DB Adapter
Hello
I am facing a problem while configuring stored procedures from Jdeveloper using DB Adapter. I am using Sql Server 2005 as my database,Jdeveloper version is 10.1.3.1.Bpel Version is 10.1.3.3. Connection to the Sqlserver 2005 database is fine, but it shows only views and tables. I get the following error message when I try to add the sql stored procedure call
"An error occured while obtaining the database schemas.Verify that the database connection is valid , and is supported"
Can someone help me please.
Thanks,
Phani
Edited by: Phani on Oct 28, 2008 11:30 AMI think you have two problems here. First, JDeveloper 10.1.3.1 doesn't support SQL Server stored procedures. There is a command-line utility that you can use to generate the required BPEL artifacts (WSDL and XSD). Second, you're using a 10.1.3.1 design-time with a 10.1.3.3 runtime. These are not compatible so you will likely run into namespace issues when you try to run your BPEL processes. You should upgrade your JDeveloper to 10.1.3.3. JDeveloper will support third-party databases in 11.1.1 including SQL Server 2005 (but not 2000), IBM DB2 v8.x and v9.x, DB2 AS/400, and MySQL. JDeveloper will support MySQL v5.2.6 and above because the INFORMATION_SCHEMA.PARAMETERS table was added at that time. The PARAMETERS table does not exist in MySQL versions prior to v5.2.6 so you will have to use the command-line utility.
Maybe you are looking for
-
I have had to put my ipod touch in Recovery Mode and tried to sync it with itunes but it wont restore itself. What can I do?
-
Splitting Audio and Video Signal
HI, I would like to be able to split the video and audio signal from my ipad via apple tv to enable the video to be viewed on the ipad and audio out of the amp speakers. I can do this via bluetooth (for instance in my car) but not via airplay in the
-
Setting Chapter Markers at Specific Times/Scenes
Is it possible to set chapter markers at different time intervals for specific scenes? I have 4 scenes, all different time intervals, that I'd like to mark.
-
Random NullPointerException on resultset.getstring
I have been getting random NullPointerException ever since I have moved my code to a new dev server. I was using tomcat 3 and oracle 9i but moved to tomcat 6 and oracle10g express edition. The errors happen mostly when the server is under load. here
-
I have the following array which is a set of 4 multipliers (Direction) private int dirMult[][] = new int[][]{{0,1},{0,-1},{1,0},{-1,0}};I am accessing it as follows, where it runs succesfully 2 times, before givin an array out of bounds error. //Appl