Oracle :: Calling Packaged Stored Procedures - oracle

In my Project i have stored procedure in package i like to call it directly in my project like HRPKG.ADD_JOB_HISTORY it retuen Stored procedure is not defined but if i called it like from UserName like HR.HRPKG.ADD_JOB_HISTORY it called successfully
Note : I Connect wit oracle using ODBC In Message Broker !

You cannot refer your SP directly without any username.You need your username/schema name for reference.If you dont use any User then how will it know where to take the SP from.Its the syntax.
HR.HRPKG.ADD_JOB_HISTORY
HR-uname
HRPKG-package
ADD_JOB_HISTORY-SP
It goes like find the SP ADD_JOB_HISTORY under the package HRPKG in HR schema

Related

Oracle synonym for remote package / procedure

we have a package/procedure in a remote database. Say PACKAGE_1.PROCEDURE_1. We want to create a synonym in the local database, that will allow us to still call the package.procedure without coding a DB link in the call. So, to the caller, it looks as though the package.procedure is local to that database.
Can this be done using a synonym?
Sure, you'd just create the synonym
create [public] synonym package_name
for schema_name.package_name#db_link;
Then you'd just call
package_name.procedure_name
in your code and wouldn't need to reference the database link.

Using HTP.P in ATP oracle database

I've just started checking out the ATP database in oracles cloud.
I have an old pl/sql proc that I want to put on the ATP database.
Happily the procedure with calls to htp.p compiled with no errors...but how do I find the URL to use to get to my procedure?
(And BTW no the proc isn't something that can just be converted into a restful web service through apex.)
The answer I've gone with for this is that the ATP database comes with ORDS configuired and ready to use.
You can expose pl/sql procedures to requests through ORDS. This does require some manual work for each procedure but not a huge amount.
You will need to set up a module in ORDS and a template for each get/put etc call you want to send through to your procedure.
Its documented pretty well here:
https://oracle-base.com/articles/misc/oracle-rest-data-services-ords-remote-procedure-call-rpc-and-output-parameters
This is using the command line for everything - I've found it easier to use the restful data services available through apex to get a GUI interface to use to set this up. I believe there is a GUI available through sql developer too.

Calling Stored Procedure using db link from different schema

We have oracle database and created a db link in one schema "Owner". We also have a stored procedure which is using this db link to connect to remote procedure.
When calling this stored procedure with "Owner" credentials, it is working fine.
However, when we try to execute using "USER" credentials, it is not working. Throwing this error:
ORA-02049: timeout: distributed transaction waiting for lock
Thanks,

Microsoft Enterprise Logging Block with Entity Framework asks for WriteLog procedure

I have a WCF service that uses Microsoft Enterprise Library Logging to log some messages to the Event Log. That works just fine.
The problem is that i want to log some messages to a table in an Oracle database. I am using the Entity Framework to communicate with that Oracle database.
The next step is a right click on the 'web.config' and choose the option 'Edit Enterprise Configuration'. I get the 'Enterprise Library Configuration' editor. In there i am trying to set the Logging Settings so that it also logs to the database, but when i add a database trace listener it´s asking me to fill in a procedure name. Do i have to add a procedure name to fill the table in Oracle? The msdn tells me to run the script that create an MSSQL database 'Logging' and some tables. But i don't have an MSSQL server, i have an Oracle server. And i don't want to use a seperate logging database, but save the logs to a single table.
Can anybody help me with this?
Kind regards
The Enterprise Library Database Trace Listener uses 2 stored procedures to write to the database: Add Category Procedure and Write To Log Procedure.
There is a SQL Server script to create the tables and stored procedures. This would have to be ported to Oracle.
Unfortunately, it looks like this does not work as easily as you would hope. See the blog post, Enterprise Library Logging to Oracle Database (this is based on EntLib 3, I believe) and the work item Cannot log to oracle Database using logging blocks for a description of some of the issues as well as some downloads to help.

How do I profile stored procedures on Oracle?

There is an Oracle DB to which I have access. I can view its packages using Aqua Data Studio and make queries to it. I don't have any access to the filesystem of the server.
There is also a binary that uses that database by calling stored procedures from it.
I want to know which stored procedures and with what parameters are used by this binary. It seems to be impossible to do with "Statement monitor for Oracle" - it only logs direct query calls, not stored procedures.
Can it be done with built-in trace if I don't have access to the filesystem?
Is there some other tool?
You can use the DBMS_PROFILER package: http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96624/12_tune.htm#45936
You can try PLSQL/Developer,it support to debug your procedure step by step.

Resources