Job Seekers   Employers
dbapool: Authors | Submissions | Contact Us
   Forgot password? | Sign up
  Home   Discussion Forum   Articles   Interview Questions   FAQs   Scripts   Rewards   Analyzer   White Papers   Blog   Certification   Downloads   Tools
 

Topic: SQL*Plus and PL/SQL >> Proceudre Query :-Help

Disclaimer: The purpose of all dbapool forums including OCP and Other Oracle Certification forums is to help each other with specific issues but not to share dump and copyrighted exam content, materials or intellectual property. You may review the entire Oracle Certification Program Candidate Agreement online Here.



  


 Title: Proceudre Query :-Help
 RAJNISH  Posted: Aug 30, 2008 08:42:20 AM

 Total Post: 92
 Joined: Jan, 2007






 hi All,
ANY ONE CAN TELL ME .....MY QUESTION IS...

THERE R 2 SCHEMA I.E SCHEMA A AND SCHEMA B

MY EXALE:- CREATE PROCEDURE PROC1
IS
BEGIN
INSERT INTO EMPLOYEE(1001.RAMESH);
END;
I HAVE GIVEN EXECUTE RIGHTS SCHEMA B TO EXECUTE THESE PROCEDURE..BUT EMLOYEE TABLE ALSO AVAILABLE IN SCHEMA B.
WHEN SCHEMA B EXECUTE THESE PROC THEN DATA INSERT INTO WHICH SCHEMA'S TABLE.
WEATHER IT IS INSERT INTO EMPLOYEE TABLE OF SCHEMA A OR SCHEMA B.

2ND QUESTION IS..IF IT IS INSERT THE DATA INTO EMPLOYEE TABLE OF SCHEMA A THEN I WANT INSERT THE DATA INTO EMPLOYEE TABLE OF SCHEMA B FOR THESE CASE WHAT SHOULD I DO?

--RAJNISH


 vino
Posted: Sep 01, 2008 05:51:37 AM  

 Total Post: 357
 Joined: Aug, 2008






 
Hi Rajinish,

The schema who is executing the procedure will get the value on his owned table. It won't go the another user table.

To insert values in schema A,use

INSERT INTO A.EMPLOYEE(1001.RAMESH);

To insert values in schema B,use

INSERT INTO B.EMPLOYEE(1001.RAMESH);



 RAJNISH
Posted: Sep 01, 2008 06:01:25 AM  

 Total Post: 92
 Joined: Jan, 2007






 
Hi Vino,
But i dont want give Schmena in Alise.
my proc in schema A only but i have given grant to execute rightd to schema B.
whenever schea B execute this proc then in wch table data will b insert and whcih schema as well.

i dotn give A.emloyee in proc.
in my proc scrit is like this only.
insert into emp('1','aaaa');



 Vish
Posted: Sep 02, 2008 01:04:18 PM  

 Total Post: 127
 Joined: Jan, 2007






 
Dear Rajnesh

Ans 1

If you want to execute procedure of scheam A then you need to use
following
execute schemaname.procdurename
then only your procedure will be executed.
and it will insert value in main schema ie. schema A. not in schema B.

Ans 2

If you want to insert in to table which in in schema B then you need
to write following
insert into tablename values ();


I hope i have clear your doubt. If you have any problem pl. e-mail me on vis_72@yahoo.com

Pl. tell me if i am wrong.

 Time Zone: EDT

  




Forum Rules & Description


Who Can Read The Forum? Any registered user or guest
Who Can Post New Topics? Any registered user
Who Can Post Replies? Any registered user




 








Get FREE Magazines

Top 10 Forum User

  Murtuja Khokhar857
  Mohammed Taj746
  positive fanatic483
  Jayanta Sur479
  Vigyan Kaushik386
  Vinoth Kumar357
  Gopu Gopi340
  Gitesh Trivedi322
  neeraj sharma258
  Ramesh Jois246






oracle Mag



  About Us Advertise Terms of Use Privacy Newsletters Contact Us    

Home   Discussion Forum   FAQs  Articles  Jobs   Newsletters  Directory  Downloads 

Our Premium Sponsor
Confio Software