SQL & PL/SQL :: How To Find Parent / Host Procedure Name Within Procedure

Sep 6, 2013

I have the following requirement.Say I have the following procedure created.create or replace procedure myproc (p1 varchar2, p2 varchar2) is begin

find_the_proc_name();
end;

In the above myproc, using find_the_proc_name() i should print the parent procedure name (or function) calling along with the parameters passed.

View 5 Replies


ADVERTISEMENT

SQL & PL/SQL :: Unable To Override Parent Procedure

Jun 4, 2013

--Create a parent object
CREATE OR REPLACE TYPE PARENTOBJ AS OBJECT
(
FIRST_NAME VARCHAR2(50),
static function GETNAME return varchar2,
MEMBER PROCEDURE getoutput
)
NOT FINAL;
/

----Create the body for parent object type
CREATE OR REPLACE TYPE BODY PARENTOBJ AS
static function GETNAME return VARCHAR2 IS
BEGIN
RETURN 'PARENTOBJ';
END ;
MEMBER PROCEDURE getoutput iS
BEGIN
DBMS_OUTPUT.PUT_LINE( 'Hello world from '||PARENTOBJ.getname );
END ;
END;
/

--Create a child object
CREATE OR REPLACE TYPE CHILDOBJ UNDER PARENTOBJ
(
static function GETNAME return VARCHAR2,
--override the parent method
OVERRIDING MEMBER PROCEDURE getoutput
)
FINAL;
/

----Create the body for child object type
CREATE OR REPLACE TYPE BODY CHILDOBJ AS
static function GETNAME return VARCHAR2 IS
BEGIN
RETURN 'childobj';
END ;
--override the parent method
OVERRIDING MEMBER PROCEDURE getoutput IS
BEGIN
DBMS_OUTPUT.PUT_LINE( 'Hello world from '||CHILDOBJ.getname );

END;
END;
/

The above types are created with no issues. However, when I am trying to inherit the child method and override its parent, I am getting the follwoing error:-

--NOW INHERIT THE PARENT INTO CHILD, AND OVERRIDE THE PARENT METHOD BY CALLING THE CHILD METHOD
DECLARE
OBJ PARENTOBJ;
BEGIN
OBJ := NEW CHILDOBJ(NULL);
DBMS_OUTPUT.PUT_LINE('obj method getoutput() = ' || GETOUTPUT());
END;
/

ORA-06550: line 6, column 56:
PLS-00201: identifier 'GETOUTPUT' must be declared
ORA-06550: line 6, column 3:
PL/SQL: Statement ignored

View 7 Replies View Related

Forms :: Host Procedure On 6i?

Dec 28, 2009

I've got a problem when I use the HOST procedure to work with DOS Prompt. When I access the DOS Prompt via Oracle Forms HOST Procedure, the name of files and folders got limited by 8 chars plus extension. Lets suppose I want to copy a file and the file name is my_image.jpg. What I have to do is:

HOST('copy MY_IMA~1 C:TEMPIMAGE01');

I guess it sucks cause the function GET_FILE_NAME give me the filename as my_image.jpg. Do I have to convert the filename every time?

View 15 Replies View Related

SQL & PL/SQL :: Procedure To Get Path From Parent-child Relationship?

Apr 23, 2010

I have a table which uses parent-child relationship to store the options available. I need a procedure to give me the full path given the id of a particular option.

I have two different functions. One of them uses the Oracle built in function and the other uses simple queries with a loop.The code of the functions are given below.

Now, the problem is with their "performance". The difference in their performance is significant. The function using the Oracle function takes more than 2 hours to run a query whereas the other function takes less than 2 minutes.

I am having trouble trusting the other function. No matter how many tests I perform on the output of both the functions, it always comes out to be the same.

Function 1
=====================
FUNCTION Gettree (opt_id IN NUMBER,i_app_id IN NUMBER)
RETURN VARCHAR2
IS
path VARCHAR2(32767);
application_no NUMBER;
BEGIN

[code]...

View 2 Replies View Related

SQL & PL/SQL :: How To Find Out Stored Procedure In Database

Jun 20, 2011

There is one DBMSJOB i created schedule to run every day at 22:00 hrs. The jobname is IT_TO_DUM_LOADING and the job type is Stored procedure.

I queried all_source and found stored procedure does not exist in database.

SQL> select text from all_source
2 where type = 'PROCEDURE'
3 and name ='IT_TO_DUM_LOADING';

no rows selected

But i could see the job details in dba_scheduler_jobs view. I cannot use WHERE clause in dba_scheduler_jobs to restrict and find only the job row as i receive time zone error. How it is possible to view the job in dba_scheduler job view whereas i could not find the stored procedure of its in all_source?

View 7 Replies View Related

SQL & PL/SQL :: Find And Trace Custom View / Procedure?

May 24, 2013

I know that this query had been executed again the db, but the person is no longer here. Last run was about 3~4 months ago.

SELECT Subject_ID,
TO_CHAR (completed_date, 'mm/dd/yyyy'), status
FROM ADMINDBG_USER.adbt_master
...

[ADMINDBG_USER.adbt_master] is not a part of [dba_tables]. [ADMINDBG_USER.adbt_master] must be a view/procedure/a sort.
I have no luck to find what view/procedure/syntax is populating the data onto [ADMINDBG_USER.adbt_master].

View 7 Replies View Related

PL/SQL :: How To Write Procedure To Load Data Into Table Using XML File As Input To Procedure

Sep 20, 2013

how to write procedure to load the data into a table using xml as input parameter to a procedure and xml file is as shown below which is input to me. 

xml version="1.0"?><DiseaseCodes><Entity><dcode>0</dcode><ddesc>(I87)Other disorders of veins - postphlebitic syndrome</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity><Entity><dcode>0</dcode><ddesc>(J04)Acute laryngitis and tracheitis</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity><Entity><dcode>0</dcode><ddesc>(J17*)Pneumonia in other diseases - whooping cough</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity></DiseaseCodes>.

View 3 Replies View Related

SQL & PL/SQL :: Exception In Procedure / Created One Procedure Based On One Table Item Master

Mar 6, 2010

I have created one procedure based on one table item master which has a field called item stock or non stock based on this i will fetch data from one of two tables .If its a stock item data will be retrieved from wip_main_acnt table and if its non stock it will pick from ns_main_acnt.my procedure is working fine but all i need is i just want to put an exception that if data is not found in one of the table based on the item selected.I am confused which one to be used whether no_data_found or notfound%.

CREATE OR REPLACE PROCEDURE dflt_pr_acnt (
l_item_code IN VARCHAR2,
l_main_acnt_code OUT VARCHAR2
)
[code]....

View 8 Replies View Related

Find Missing Data From Parent Table?

Aug 8, 2013

SELECT c.table_name CHILD_TABLE, p.table_name PARENT_TABLE
FROM user_constraints p, user_constraints c
WHERE (p.constraint_type = 'P' OR p.constraint_type = 'U')
AND c.constraint_type = 'R'
AND p.constraint_name = c.r_constraint_name
AND c.table_name = UPPER('ODS_TSAF_MES_PC');

and output is

child table parent table
ODS_TSAF_MES_PC ODS_TSAF_MES_PCTYP
ODS_TSAF_MES_PC ODS_TSAF_MES_PC
ODS_TSAF_MES_PC ODS_TSAF_MES_PCSTAT

i tried

SELECT A.piecestatus from ods_TSAF_MES_PCSTAT A WHERE NOT EXISTS
(SELECT * FROM ODS_TSAF_MES_PC B WHERE B.piecestatus = A.piecestatus);

and i found one piecestatus values is 'I' but i am not getting where it is related to the table and in which row it is getting affected?

View 6 Replies View Related

PL/SQL :: Create A Procedure Inside A Procedure

Jun 25, 2012

DB version:11g

can we create a procedure inside a procedure...if not is there any alternative??

in db2 it is allowed so do oracle support this????

View 5 Replies View Related

Ora-06502 - Create Generate Procedure That Create Dynamic Procedure Through DBMS_SQL

Mar 31, 2004

ORA-06502...I have database on oracle 9i on Solaris 9. I create a generate procedure that create dynamic procedure through DBMS_SQL. On this database I got the ORA-06502 error. When I tried to run the same procedure on the same database on oracle 8i on NT this work fine.

View 3 Replies View Related

SQL & PL/SQL :: Compile A Procedure Within Another Procedure?

Mar 19, 2012

I wanted to Compile a Procedure within another procedure.

Step 1:

CREATE OR replace PROCEDURE Compile_test
IS
var1 NUMBER(20);
BEGIN
SELECT user_id
INTO var1
FROM dummy;
dbms_output.Put_line('the output is '
||var1);
END;

Step 2:

CREATE OR replace PROCEDURE Compile_test_in (proc_name VARCHAR2)
IS
var2 VARCHAR2(20);
BEGIN
var2 := 'proc_name';
EXECUTE IMMEDIATE ('alter procedure ||var2|| compile');
END;

Step 3:
exec compile_test_in ('compile_test')

When trying the step 3, i am getting the below error message.

Error at line 1
ORA-04050: invalid or missing procedure, function, or package name
ORA-06512: at "MUTHU.COMPILE_TEST_IN", line 6
ORA-06512: at line 1

View 5 Replies View Related

SQL & PL/SQL :: Calling Procedure Within A Procedure?

Oct 19, 2010

can we call a procedure within a procedure in a package or does it have to be declared before it can be called in the body,where can i find an example

View 9 Replies View Related

SQL & PL/SQL :: Call A Procedure Within A Procedure

Dec 15, 2011

how can I call a procedure from another procedure? whats the syntax?

View 19 Replies View Related

PL/SQL :: Procedure That Drops Another Procedure

May 29, 2013

I need to create a procedure that drops another procedure as follows:

create or replace procedure drop_any_proc (proc_name varchar2) is
drop procedure proc_name;
end;

View 5 Replies View Related

SQL & PL/SQL :: Procedure Within Procedure In Package

Mar 16, 2012

i need to clarify that, we can call a procedure inside a procedure, when i am using inside a package,whether i have specify the called procedure in the Package specification?

View 5 Replies View Related

PL/SQL :: How To Update Parent And Child Tables While Updating Parent Table

Jun 13, 2012

I have a parent table EMPLOYEE which includes columns (sysid, serviceno,employeename...) sysid is Primary key, serviceno is Unique key and I have child table DEPENDENT includes columns (sysid,employee_sysid,name,dob...) here again SYSID is primary key for DEPENDENTS table, employee_sysid is Foreign key of EMPLOYEE table.

Now I want to change SYSID (using sequence) in EMPLOYEE table which need to be update in DEPENDENTS table as well

Note: I have 10000 records in EMPLOYEE table as well as I have 5 more child tables which need to update new SYSID.

View 5 Replies View Related

PL/SQL :: Call More Than One Stored Procedure In New Stored Procedure

Dec 24, 2012

Execute sp1 param1...param6
Execute sp2 param1...param8
Execute sp3 param1...param4

All these stored procedures deals with insert/updated transactions . i need to create a new stored procedure to execute all this in a single stored procedure which will be something like

create procedure sp4(param1...param8)
as
begin
Execute sp1 param1...param6
rollback if any error
Execute sp2 param1...param8
rollback if any error
Execute sp3 param1...param4
rollback if any error
end;

View 6 Replies View Related

PL/SQL :: How To Get Procedure Name

Jul 9, 2013

With our application we are updating one table (P_Balance) in this account status and date through some procedures. in some situation only account status column get proper value, but date column having NULL value.

Now we decided to track this, through which procedure this date column get updated null value. For this I decided to write one trigger for the table "P_BALANCE" through which procedure this update is happening.  How do I get the procedure name.

View 7 Replies View Related

How To Exit A Procedure

Apr 8, 2005

Suppose have the following condition in my procedure :

IF var_count = 0 then
'stop processing' --EXIT PROCEDURE
ELSE
'continue processing'
END IF;

How do I stop futher processing if var_count= 0 . I think about raising an exception...but is there another way out..like a command 'exit' to stop further processing ?

View 3 Replies View Related

SQL & PL/SQL :: How To Get The Name Of Current Procedure

Jul 13, 2011

I have a procedure like below:

create or replace procedure sp_test
is
vs_proc_name varchar2(40);
begin
--get the name of current procedure ,here is "sp_test"
--[color=red]but ,i do not want the hard code here[/color]
insert into test_Page(proc) values(vs_proc_name);
---
--
commit;
end;

I don't want to coding like this:

vs_proc_name:='sp_test';

so ,is there any building function to get that ?

View 5 Replies View Related

SQL & PL/SQL :: Procedure Insert Into?

Mar 12, 2010

, I'm trying to make a stored procedure in Oracle insertcion of records, but before you insert has to get the most code and generate a new one generated more than everyone else, I'm using Max, but as I assign to a variable as in SQL is:

Declare @ IDMax numeric
Select @ IDMax = Max (Code) From Members

Then I would make a:Insert into Users (Code, Name) values (@ IDMax, 'Victor');As serious for Oracle to perform com from declaring a parameter as the Code for me to store the value (Code Maximo)

View 2 Replies View Related

SQL & PL/SQL :: Using More Than Four DB Links In A Procedure

Jul 17, 2013

i want to use more than four db links in my stored procedure to retrieve data from different databases. but it says ORA-02020: too many database links are opened. i also wrote execute immediate to close some links but its not working.

View 16 Replies View Related

SQL & PL/SQL :: Two Different Package Can Contain Same Procedure?

Mar 31, 2011

is it possible that two different package can contain same procedure?

View 1 Replies View Related

SQL & PL/SQL :: Procedure For Getting Old And New Column Value

Sep 19, 2011

I want a procedure which gives me old and new column values which will be maintained in other table ..

for e.g. :=>
ihave a table " product" having columns as " p_id number(pk) ,
p_name varchar2(20),
p_qty number"
every updation in the "product" table will insert the old and new values in "Audit_product_table"
[code]......

View 24 Replies View Related

SQL & PL/SQL :: Procedure In Put Parameter

Sep 5, 2012

I am writing a procedure in which I have a input string parameter in the following way..('NYC,ATL,OKC,KAC,LA'). I need to use that string to search values in the table.

Example

create or replace procedure search_city(p_string varchar2)
/*
paramater will be like ('NYC,ATL,OKC,KAC,LA')
*/
is
v_city varchar2(40)
begin
for i in (select city_name from cities
where city_code in (p_string )
) loop

v_city := i.city_name;
end loop;
end ;

View 2 Replies View Related

SQL & PL/SQL :: How To Run Procedure In Parallel

Dec 28, 2012

we have many tables in Cursor For Loop :

CREATE OR REPLACE PROCEDURE EBILL_BULK_UPDATE_SERVICE(in_cycle VARCHAR2)
AS
v_cnt NUMBER; -----Variable used for checking table is partitioned or not partitioned
CURSOR cur_update -----Cursor defined for Updating EBILL tables for service_id
is
SELECT table_name
, cycle_name
FROM NNP_EBILL_UPDATE

[code]....

As our requirement that Execute Immediate should work for 5 or more tables updation parallely at a time.If one table get completed then it should take next table from loop and then start the code till completion of all tables.

View 11 Replies View Related

SQL & PL/SQL :: Enable To Run Procedure Through Job?

Mar 30, 2011

I am trying to execute procedure using dbms scheduler.but i am getting below errors

ORA-06550: line ORA-06550: line 1, column 407:
PLS-00103: Encountered the symbol "AMANORATEST" when expecting one of the following:
:= . ( @ % ; immediate
The symbol ":=" was substituted for "AMANORATEST" to continue.
, column :

but procedure is executing fine with sql commmand line.

View 1 Replies View Related

SQL & PL/SQL :: Package And Procedure?

Jul 17, 2012

In package specification, there 3 procedures But in package body, there are 2 procedures...will this execute?

View 14 Replies View Related

SQL & PL/SQL :: Procedure Gets Halted Only For One Value?

May 20, 2010

I have written a pl/sql procedure which takes a number X as an input then searches for the policy numbers which have a total rating record not greater than that number X ...

The procedure works well for every single value as an input but 500! It gets halted for the X equals to 500.

I have used 2 cursors. To dig the problem i run the program with a single print line in the body and still it acts the same.

View 7 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved