How to identified running procedure
Hi all,
I know the procedure name , I want to know who are currently being running that procedure. Can any one give the solution for this?
Thanks and Regards
Check this How Can I find out who called me or what my name is
Similar Messages
-
How do you run procedure with declare on sql plus
Hi i am a newbie in sqlplus so please forgive if my question sounds to0 silly as i was watching a tutorial on sqlplus procedures i know how to run a simple IN procedure like
create or replace procedure inparameter
p_name IN VARCHAR2
)AS
BEGIN
DBMS_OUTPUT.PUT_LINE('Hello' || p_name);
end;
to run
start inparameter;
procedure created
set serveroutput on;
exec inparameter ('newbie');
hello newbie
procedure successfuly completed
but now i have a procedure with a declare
now wich from what i see on the video tutorial as two box to create procedure and on the next the declare i dont know if i am meant to put them together and run it as one this how it looks like
DO I RUN THE FIRST BOX AS MY PREVIOUS PROCEDURE DESCRIBED ABOVE (start procedure, then exec procedure)
then run the second box which is the declare as the same way or do i put the all code in one single box (start declare then exec declare)
BOX 1
Create or replace procedure addition
P_A IN NUMBER
,P_B IN NUMBER
,P_C OUT NUMBER
)AS
BEGIN
P_C := P_A +P_B;
END ADDITION
BOX 2
declare
x number;
addition (5,5,x);
dbms_output.put_line('the result is' || x);
end;
the tutorial can be seen on this youtube link
[http://www.youtube.com/watch?v=Vvn30o_ctpk&feature=related]
fastforward to about 9mins 18 to see the boxes that i mean
sorry in advance if its a stupid questionYou have to create the first procedure (addition), then run the pl/sql block:
SQL> Create or replace procedure addition
2 (
3 P_A IN NUMBER
4 ,P_B IN NUMBER
5 ,P_C OUT NUMBER
6 )AS
7 BEGIN
8 P_C := P_A +P_B;
9 END ADDITION;
10 /
Procedure created.
SQL> declare
2 x number;
3 begin
4 addition (5,5,x);
5 dbms_output.put_line('the result is' || x);
6 end;
7 /
the result is10
PL/SQL procedure successfully completed.The procedure is stored in the database, the pl/sql block is anonymous, it's not stored in the db.
Max -
Hi all,
how do I run procedure as another user?Just connect as that 'another user' and run the procedure?
If that isn't what you're looking for then explain in more details (database version, etc) please.
See:
{message:id=9360002}
edit
In addition to the other mentioned options:
You might want to check out CURRENT_SCHEMA.
"The CURRENT_SCHEMA parameter changes the current schema of the session to the specified schema. Subsequent unqualified references to schema objects during the session will resolve to objects in the specified schema. The setting persists for the duration of the session or until you issue another ALTER SESSION SET CURRENT_SCHEMA statement.
This setting offers a convenient way to perform operations on objects in a schema other than that of the current user without having to qualify the objects with the schema name."
http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_2013.htm#SQLRF53050
Edited by: Hoek on Mar 4, 2013 1:44 PM -
How to run procedure in package?
Hi,
I'd like to know how I can run the following procedure successfully. here is the package and the procedure.
Code:
create or replace PACKAGE TEST_PK AS
/* TODO enter package declarations (types, exceptions, methods etc) here */
type project_type is record(c1 test.visits%TYPE);
type project_type1 is ref cursor return project_type;
procedure myproc_sp(result1 in out project_type1);
END TEST_PK;
The body is bellow:
create or replace PACKAGE BODY TEST_PK AS
procedure myproc_sp(result1 in out project_type1) AS
BEGIN
/* TODO implementation required */
open result1 for
select test.visits from TEST;
END;
END;
On SQL-PLUS I try to do the following:
variable c1 refcursor
execute TEST.MYPROC_SP(:c1)
And as soon as I type that I get the following error message:
Error Msg
BEGIN proc_name(:);
ERROR at line 1:
ORA-06550: LINE 1, COLUMN 7:
PLS-00201: identifier 'proc_name' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statment ignored
Can someone tell me what is wrong with this process and how to fix it?
Thanks for your help.
GeneBy using PL/SQL.
DECLARE
TYPE return_cur IS REF CURSOR RETURN temp_jl%ROWTYPE;
p_retcur return_cur;
rec temp_jl%ROWTYPE;
BEGIN
for c_rec in (SELECT * FROM temp_jl)
LOOP
rec := c_rec;
dbms_output.put_line('Out put is : '||rec.name || ' - ' || rec.name2);
end loop;
END; -
How can I run an external program from a PLSQL procedure?
Is there a package to run an external program from PLSQL? or is there another way to do that?
thanks.here there is an example about how a PL/SQL procedure can
work with an external C program.
http://download-east.oracle.com/docs/cd/A87860_01/doc/appdev.817/a76936/dbms_pi2.htm#1003384
Apart from that you have Java Stored Procedures option
to carry out your task.
Java Stored Procedures Developer's Guide Contents / Search / Index / PDF
http://download-east.oracle.com/docs/cd/B10501_01/java.920/a96659.pdf
Joel P�rez -
How do I run a database procedure that inserts data into a table from withi
How do I run a database procedure that inserts data into a table from within a Crystal report?
I'm using CR 2008 with an Oracle 10i database containing a number of database tables, procedures and packages that provide the data for the reports I'm developing for my department. However, I'd like to know when a particular report is run and by whom. To do this I have created a database table called Report_Log and an associated procedure called prc_Insert_Entry that inserts a new line in the table each time it's called. The procedure has 2 imput parameters (Report_Name & Username), the report name is just text and I'd like the username to be the account name of the person logged onto the PC. How can I call this procedure from within a report when it's run and provide it with the 2 parameters? I know the procedure works, I just can't figure out how to call it from with a report.
I'd be grateful for any help.
ColinHi Colin,
Just so I'm clear about what you want:
You have a Stored procedure in your report. When the report runs, you want that same procedure to write to a table called Report_Log.
If this is what you want the simple answer is cannot be done. Crystal's fundamental prupose is to read only, not write. That being said, there are ways around this.
One way is to have a trigger in your database that updates the Report_Log table when the Stored Procedure is executed. This would be the most efficient.
The other way would be to have an application run the report and manage the entry.
Good luck,
Brian -
How to I run SQL Loader in a procedure
Hi
Can somebody tell me how can i run SQL Loader in a pl/sql procedure ?
i tried this:
host sqlldr73 tiger/scott load.ctl
then this
host sqlldr73 tiger/scott "c:\load.ctl"
but none works.
Please advise.
Thanks.
regards
Estherfriend
sqlldr is an application residing in the OS. procedure runs in the dbms engine.
you cannot run an os command directly from a procedure or a function or a package .
If you want to do so you need to use either a daemon process created by a PRO*C program
or a JAVA stored procedure to do so.
just refer to previous question forums, you can find the solution. Somebody has already given a solution using
java to run an OS command . check it out
prakash
[email protected] -
How run Procedure in SQL Developer?
I need run procedure in SQL Developer with parameter : 2009
create or replace PROCEDURE "update_table" (ff_year in varchar2) AS
CURSOR c_update IS
select DISTINCT P.mafew name, u.frew nameone, t.greddf, .........
I click green button RUN and have new window Run PL/SQL. Where in this script I need to print 2009?
DECLARE
FF_YEAR VARCHAR2(200);
BEGIN
FF_YEAR := NULL;
update_table(
FF_YEAR => FF_YEAR
END;Hi,
user10886774 wrote:
Thanks all!
I can run the procedure like 1 or 2 example? Is it right?
1 like Run Script
EXEC "UPDATE_TABLE" ('2009');
2 click RUN on UPDATE_TABLE procedure
DECLARE
FF_YEAR VARCHAR2(200);
BEGIN
FF_YEAR := '2009';
UPDATE_TABLE(
FF_YEAR => FF_YEAR
END;
What is the name of the procedure?
Is it update_tabe (all small letters)? If so, you must reference it as "update_table" (all small letters, inside double-quotes).
Is it UPDATE_TABLE (all capital letters)? If so, you have the choice of referencing it as "UPDATE_TABLE" (all capital letters, inside double-quotes) or as update_table, or Update_Table, or UPDATE_TABLE, or uPdAtE_taBle, or ... (any kind of letters, without quotes).
How about commit after?How about it?
What is the question?
If you want to commit, say COMMIT or click on the COMMIT icon. -
How to identify the alternative payee in payment run
Hi All
How to identify the alternative payee details in payment run by using transaction code F110 or which table or fields contain the alternative payee details for example REGHU & REGUP.
How to identify the alternative payee details from system level. Any Update.
Regards
K.Gunasekar.Hi,
EMPFG (Payment Recipient ) field in REGUH will give you the alternate Payee name of the Payment run executed in F110.
Regards,
SAPFICO -
How to identify the environment (database) Apex is running on?
Hi
We are going to have 3 environments here: Development, Test and Production (separate databases/servers for each one). As usual, the development process will move applications from Dev -> Test -> Prod.
On my Apex 3 applications, I would like to visually identify, in some way, to which environment I am currently connected. For instance, displaying the name of the environment on the page header.
My problem is how to identify what environment Apex is running on. Is there any Apex instance-level property where I can set a string and display it in my applications? Or something like that?
What is the best way to achieve this? Any suggestions welcome.
Thanks,
LuisLuis,
another option is to check the http environment to get this information.
This is what we use in one of our applications:
FUNCTION get_environment
RETURN VARCHAR2
IS
BEGIN
IF LOWER (OWA_UTIL.get_cgi_env ('SERVER_NAME')) IN
('development.opal-consulting.de')
THEN
RETURN c_development;
ELSIF LOWER (OWA_UTIL.get_cgi_env ('SERVER_NAME')) =
'test.opal-consulting.de'
THEN
RETURN c_test;
ELSE
RETURN c_production;
END IF;
END;Unfortunately, this doesn't work with Oracle XE, thus you might be better off checking the value of: OWA_UTIL.get_cgi_env ('HTTP_HOST')
Anyway, I would also rather suggest using the table based approach, I use it in most applications now. This way you are more flexible. You can simulate all different settings in the same schema. Also, you can install development and test in the same database.
Regards,
~Dietmar. -
How to run procedure in sql navigator?
Hi,
Can anyone tell me how can i run stored procedures in a package from SQL NAVIGATOR?
Thank youIf there are no OUT-Parameters just
exec <package_name>.<procedure_name>
as it´s done in SQL*Plus.
Regards,
Gerd -
How to run procedure/job only on third business day of the month
Hello All,
how can i run the procedure/job only third business day of the month? I am using month table in my procedure and it gets updated only once in month and procedure doesn't need to run everyday.>
how can i run the procedure/job only third business day of the month? I am using month table in my procedure and it gets updated only once in month and procedure doesn't need to run everyday.
>
For such a sparse schedule the easiest way is to DBMS_SCHEDULER and set the 'repeat_interval' using the BYDATE parameter.
See Table 14-7 in chapter 114 DBMS_SCHEDULER of the PL/SQL Packages and Types doc
http://docs.oracle.com/cd/B28359_01/appdev.111/b28419/d_sched.htm#BABEJGCH
>
Table 114-7 Values for repeat_interval
BYDATE
This specifies a list of dates, where each date is of the form [YYYY]MMDD. A list of consecutive dates can be generated by using the SPAN modifier, and a date can be adjusted with the OFFSET modifier. An example of a simple BYDATE clause is the following:
BYDATE=0115,0315,0615,0915,1215,20060115
The following SPAN example is equivalent to BYDATE=0110,0111,0112,0113,0114, which is a span of 5 days starting at 1/10:
BYDATE=0110+SPAN:5D
The plus sign in front of the SPAN keyword indicates a span starting at the supplied date. The minus sign indicates a span ending at the supplied date, and the "^" sign indicates a span of n days or weeks centered around the supplied date. If n is an even number, it is adjusted up to the next odd number.
Offsets adjust the supplied date by adding or subtracting n days or weeks. BYDATE=0205-OFFSET:2W is
>
The chapter has examples. -
How to write a procedure to run the call the custom package from backend
Hi All
Oracle 10g
Oracle Apps R12
I am working with oracle order management here we have a customize Package called (Pick Release).Due to some problem we have running this concurrent program by manually giving Route_id as parameter. The route_id is taken from the route Table. By using this query
select distinct route_id from route@DB_LINK_APPS_TO_ROADSHOW
where trunc(route_date) = trunc (sysdate+2).
so daily we have nearly 42 routes and we are running this concurrent program manually nearly times.
so now how to write a procedure for this
Step 1 Getting the route from route table.( By cursor we can get the route_id Accordingly)
Step 2 How to trigger the custom package from back end and execute accordingly to that output of the cursor(route_id)
If the cursor get 40 routes is it then the concurrent program runs 40 times according to that route_id.
can some could provide the steps to do this
Thanks & Regards
Srikkanth.MThis is about 4 or 5 lines of PL/SQL and the name of the custom package is not provided.
If you request someone in this forum to do your work for free -because obviously you didn't even try to write it, which must be considered abusing this forum- you must at least provide sufficient info so someone can do it.
And no, I won't do it for you.
Sybrand Bakker
Senior Oracle DBA -
Currently Running Applications - How to identify them.
I'm trying to figure out how I can identify running applications.
I know if I -- for example -- minimize iTunes, I can see the iTunes icon on the end of my Dock. No problem there.
However while exploring I discovered the "Force Quit" menu item and when I clicked it, I could see that Photoshop and a number of other applications was running...but there were not showing up on the Dock.
Is there a way of knowing what applications are running, besides going to "Force Quit."Hi Dr. Dave;
You might try depressing the control or apple key and "tab" at the same time. That should bring up a bar on your screen with icons for all of the open applications. If you release and depress the "tab" key you should cycle through all of you open applications. Whichever one is selected when you release the keys will be the application you will be in next.
Allan -
How to identify the locks in oracle db objects? i dont have access to check
How to identify the locks in oracle db objects? i dont have access to check the v$lock or v$ objects. i dont have dba access. what are the symptoms for table, row or objects lock? how v guess it would be lock?
Thanks in advance friends..I believe you will have to call your DBA on the phone in that case.
You can query something with a select ... for update nowait.
If it raises an exception you can handle it within a when section.
-- Running in one session
SQL> create table t1 as select 1 col1 from dual;
Table created
SQL> select * from t1 for update nowait;
COL1
1
SQL>
-- now running in a different session
SQL> select * from t1 for update nowait;
select * from t1 for update nowait
ORA-00054: resource busy and acquire with NOWAIT specified
SQL> set serveroutput on
SQL>
SQL> DECLARE
2 CURSOR cur1 IS
3 SELECT col1 FROM t1 FOR UPDATE NOWAIT;
4 v_col1 NUMBER;
5 locking_error EXCEPTION;
6 PRAGMA EXCEPTION_INIT(locking_error, -00054);
7 BEGIN
8 OPEN cur1;
9 EXCEPTION
10 WHEN locking_error THEN
11 dbms_output.put_line('Busted locking my rows!');
12 END;
13 /
Busted locking my rows!
PL/SQL procedure successfully completed
SQL> Now, surely you won't be able to tell anything else other than there was something locked there.
But none of the details you would find in the views.
Maybe you are looking for
-
I haven't used my iPod in a few months so I charged it up, updated my itunes and everything was going fine. However when I connected the iPod to the computer and went into itunes, a message kept popping up telling me my iPod is in recovery mode and n
-
HT1349 Hi. How do you reset your i pod touch password after you forgot it
Hi. I have forgotten my password for my i pod touch and was wondering how to unlock it.
-
Firefox not showing most images or links
This happens mainly with Facebook, but every website is messed up. The picture links do not appear, but are still there. It's a click-able white space. Kind of like scripts are missing, but I do not have any script blocker. Had a virus, now gone, but
-
ODBC Administrator SQl windows Xp
I use Sql toolxit, LV 7 e windows Xp. I want use SQl server 7. How can install SQl server 7 and which are the settings in ODBC administrator for open database from a Labview program that use Sql toolkit? thank
-
When I try to publish my iweb site on Web.me from my laptop I get an «unknown error» message. I transferred Domain.sites2 from my iMac, on which I created the site, to my laptop but keep getting the same message every time I try to publish from the l