we have a package and we have grants to execute that package inside of that we have table, here we don't have privileges to this table? whether this package will execute or not?

Answers were Sorted based on User's Feedback



we have a package and we have grants to execute that package inside of that we have table, here we d..

Answer / prativa mishra

Yes, this package will execute.
example:- suppose we have create a package inside any user
create or replace package sn_pck is
procedure sn_pr(c out number);
end;

create or replace package body scn_pck is
procedure sn_pr(c out number) is
begin
select b into c from sn where name='sony';
DBMS_OUTPUT.PUT_LINE(C);
END;
END;

after that you shd connect hr user
and execute that package it execute 100%

how u will execute on hr user:-

declare
e number;
begin
prativa.sn_pck(e);
end;

note:- here i hv created that package in a user named prativa
and in user i hv create a table sn

Is This Answer Correct ?    2 Yes 1 No

we have a package and we have grants to execute that package inside of that we have table, here we d..

Answer / mathivanan

Of course it wont, it will error out..

As per the question, the user is creating a package inside which he is accessing a table that he has no access to.

it will error out.

Is This Answer Correct ?    0 Yes 0 No

we have a package and we have grants to execute that package inside of that we have table, here we d..

Answer / shareen

select empno,deptno,ename,sal,case when deptno=10 then
sal+3000
when deptno=20 then sal+2000
when deptno=30 then sal+1000
else sal end from emp

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More SQL PLSQL Interview Questions

How many joins can you have in sql?

0 Answers  


What is a boolean in sql?

0 Answers  


What is the command used to fetch the first 5 characters of a string?

0 Answers  


can sql servers linked to other servers like oracle? : Sql dba

0 Answers  


Hi am new to PLSQL & facing problems in writing code like in SP, Functions, so any one having some SP coding with in depth explanation please share with me my Email ID suvarnaatsuvarna@rediffmail.com Or taking tanning on this please do contact me

0 Answers  






What is an index and types of indexes. How many number of indexes can be used per table ?

12 Answers   Accenture, BirlaSoft, Cognizant, CTS, Symphony,


real time applications of nullif?

3 Answers  


column A column b | output 10 7 | 10 5 8 | 8 7 -9 | 7 3 5 | 5 0 6 | 6 Write a sql query to print such output.

4 Answers  


How does left join work in sql?

0 Answers  


How can I create a table from another table without copying any values from the old table?

8 Answers  


Q1.all the depts which has more then 10 empls? Q2.all the dept which does not have any emply? Q3 all the emp which does not have any dept? Q4 get all the emply detais with the dept details it dept is exit otherwise any emp details? Q5 how to debugg the dynamic sql and packages?

2 Answers  


What is prepared statement in sql?

0 Answers  


Categories