Package / procedure privileges
In a manual, I found:
"Database applications explicitly call packaged procedures as necessary. After being granted the privileges for the package, a user can explicitly execute any of the procedures contained in it."
But this is not working for me. I have a developer that still cannot execute a procedure inside a package, after I granted him execute rights on the package.
He is still getting an insufficient privileges error. Any ideas ?
Hi,
SQL> conn scott/tiger
Connected.
SQL> create or replace package test_pack as
2 procedure proc1(a number);
3 procedure proc2(b number);
4 function func1(a number) return number;
5 end;
6 /
Package created.
SQL> create or replace package body test_pack as
2 procedure proc1(a number) is
3 begin
4 null;
5 end;
6 procedure proc2(b number) is
7 begin
8 null;
9 end;
10 function func1(a number) return number as
11 begin
12 return (a +10);
13 end;
14 end;
15 /
Package body created.
SQL> select test_pack.func1(4) from dual;
TEST_PACK.FUNC1(4)
14
SQL> exec test_pack.proc1(1);
PL/SQL procedure successfully completed.
SQL> grant execute on test_pack to test;
Grant succeeded.
Now connect as TEST user and execute the following:
SQL> conn test/test
Connected.
SQL> exec scott.test_pack.proc1(9);
PL/SQL procedure successfully completed.
SQL> select scott.test_pack.func1(2) from dual;
SCOTT.TEST_PACK.FUNC1(2)
12
Probably, you are not prefixing the package name with the owner (in my case SCOTT).
Similar Messages
-
Check package/procedure level privileges for a user
hi gurus,
how to check the package/procedure level privileges for a user? like dba_tab_privs for tables.
for eg: grant execute on dbms_scheduler to user1.
now, i need to verify that user1 has execute privilege on dbms_scheduler or not.
what's the view for this?
thanks in advance,
charlesSQL> select privilege, count(*) from dba_tab_privs group by privilege order by 1;
PRIVILEGE COUNT(*)
ALTER 19
DEBUG 256
DELETE 131
DEQUEUE 3
EXECUTE 19315
FLASHBACK 52
INDEX 14
INSERT 137
MERGE VIEW 36
ON COMMIT REFRESH 52
QUERY REWRITE 52
PRIVILEGE COUNT(*)
READ 7
REFERENCES 54
SELECT 3752
UNDER 3
UPDATE 111
WRITE 5
17 rows selected.DBA_TAB_PRIVS is for more than just tables. -
Getting error calling a package/procedure from DB
I'm on 11.1.1.6 and I'm trying to execute a procedure in a package in the DB my ADF application is connected to. I get the following error "Could not find saved view state for token". If I comment out the execution of the method that is calling the procedure the error goes away. The error shows up under the log for the application on the EM console. The procedure does not get executed. Can anyone tell me what it could be? I am using the tool Oracle provided to gain access to the EBS database without using the apps password. I wonder if that may be causing the issue? Can it be related to a security or grant issue of some kind? The package procedure is under the apps schema.
Hi,
I don't think that on this forum we know enough about EBS to be helpful with security privileges. But if you read this here ADF & Weblogic How To: TROUBLESHOOTING: Could not find saved view state for token ...
then it seems that there are some sort of access problem
Frank -
GRANT EXECUTE ON SCHEMA.PACKAGE.PROCEDURE TO USER
Hi,
GRANT EXECUTE ON SCHEMA.PACKAGE.PROCEDURE TO USER
returns:
ORA-00905, do you know why? Can I grant privileges on procedure inside package?
thanksAs per my knowledge of oracle, we cannot grant privileges on procedure inside a package.
<br><br>
Raj<br>
<b>www.oraclebrains.com<a>
<br><font color="#FF0000">POWERED by the people, to the people and for the people WHERE ORACLE IS PASSION.</font></b>
<br>
Sorry Leonardo Horikian & Kamal Kishore, I was late and didn't know that you guys have already posted the answer.
Message was edited by:
rajs -
942: error when trying to browse/refresh Packages, Procedures and Functions
Hi,
I'm using OSD 1.1 against 10g.
I can create and compile functions in a certain schema but when I try to browse the Functions node I get "ORA-00942: table or view does not exist." and the node does not expand.
The same thing happens with the Packages and Procedures nodes.
Does anyone have any ideas?
Thanks in advance
MikeI've got the same problem with SQL Developer 1.1.0.23.64 against 9.2.0.4.0 and 10.1.0.4.0. This error occured only for a few package/procedure/function owners. I've found that these owners have SELECT ANY TABLE system privilege. In such case SQL Developer generates following SELECT:
SELECT OBJECT_NAME, OBJECT_ID, DECODE(STATUS, 'INVALID', 'TRUE', 'FALSE') INVALID, 'TRUE' runnable, NVL( b.HAS_BODY, 'FALSE') HAS_BODY
FROM SYS.DBA_OBJECTS a,
(SELECT 'TRUE' HAS_BODY, object_name tmp_name FROM SYS.DBA_OBJECTS WHERE OWNER = :SCHEMA AND OBJECT_TYPE = 'PACKAGE BODY') b
WHERE OWNER = :SCHEMA
AND OBJECT_TYPE = 'PACKAGE'
AND object_name = tmp_name (+)
AND SUBOBJECT_NAME IS NULL
AND OBJECT_ID NOT IN ( SELECT PURGE_OBJECT FROM RECYCLEBIN )
Otherwise it generates
SELECT OBJECT_NAME, OBJECT_ID, DECODE(STATUS, 'INVALID', 'TRUE', 'FALSE') INVALID, 'TRUE' runnable, NVL( b.HAS_BODY, 'FALSE') HAS_BODY
FROM SYS.ALL_OBJECTS a,
(SELECT 'TRUE' HAS_BODY, object_name tmp_name FROM SYS.ALL_OBJECTS WHERE OWNER = :SCHEMA AND OBJECT_TYPE = 'PACKAGE BODY') b
WHERE OWNER = :SCHEMA
AND OBJECT_TYPE = 'PACKAGE'
AND object_name = tmp_name (+)
AND SUBOBJECT_NAME IS NULL
AND OBJECT_ID NOT IN ( SELECT PURGE_OBJECT FROM RECYCLEBIN )
Both for 10g.
So you could try to grant SELECT on DBA_OBJECTS to owner of your functions.
I don't know why SQL Developer doesn't SELECT from ALL_OBJECTS in all cases.
Jiri
Message was edited by:
Jiri Suchy
You will need grant SELECT on DBA_SOURCE, too. -
Hello all,
Does Forte support the calling of overloaded package procedures in Oracle?
Tim Sawyer
PanCredit
Leeds, UK.As I remember Forte picks correct overloaded procedure if you specify all
parameter names and qualifiers (input/output). This was the way it worked in
R2. Never tested it in R3 though - it may have changed.
Nickolay Sakharov
CBSI
-----Original Message-----
From: [email protected]
[mailto:[email protected]]
Sent: Friday, September 24, 1999 5:56 AM
To: Tim Sawyer
Cc: '[email protected]'; Rob Patrick
Subject: Re: (forte-users) Oracle Package Procedures
Tim,
The short answer is no. I had put in an enhancement request for this during
Forte 3.0.G.2 release. I don't know the status of this now.
Long answer: We faced the same issue when we Upgraded from Forte R2 to R3.
If there is an overloaded procedure, Oracle returns a list of package
specs. Forte picks one - I am not sure if it is the first or last. If it
happens to be the one you are looking for, you will be lucky. Otherwise,
you will get an exception.
Our work around was to create a dummy procedure that calls the overloaded
procedure. We call the dummy procedure from Forte.
Hope this helps.
Venkat
PriceWaterhouseCoopers
The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete the material from any
computer.
For the archives, go to: http://lists.sageit.com/forte-users and use
the login: forte and the password: archive. To unsubscribe, send in a new
email the word: 'Unsubscribe' to: [email protected] -
Error While Creating Block on Package Procedure
Hi
When I try to create a block on a package Procedure I get the following error
ifbld60.exe has generated errors and will be closed by Windows.
You will need to restart the program.
An Error log is being created,
and forms closes.
Is it something to do with Forms problem or with Windows? Is there a patch available for this problem or its a OS bug. The client I am testing this form from is Windows 2000 Professional.
Thanks for your help
DiogoHi
You cannot directly insert object in Stored Procedure universe,Whatever object you are using to define your derived table,you have to include all those objects into the universe first.
From the below image you can see that i have 3 derived tables ,but whatever objects i am trying to use all those i have inserted into the universe.
Try to build like this save and export.
Let me know if you face nay error -
Error while accessing oracle packaged procedure in crystal report./ How to
Hi,
When i tried to call a packaged procedure in crystal reports for .net, i am unable to access it.
i am getting error as 'unknown query engine'
In that packaged procedure i have a two IN parameters and one OUT TABLE parameter ( which is declared in package specification )
And when selecting the packaged procedure in crystal report,the wizard shows all the parameters like the IN parameters, and when i just leave it blank. i unable to set into report.
ie., the OUT table type is shown as IN paramters (Actually it is an output and has field fields in it.)
And No fields are coming in the Fields Explorer of crystal reports in .net.
can you provide any help.
thanks and regards
Mohan Raj K.
Actually using vs.net 2005 prof.
Message was edited by:
mohanraj_kActually the OUT Parameter type in the stored
procedure is showing as IN Parameters and asking
for input values in the crystal report creation
wizard(while selecting the
database,connection,storedprocedures/qualifiers).That sounds like a problem on the .net / crystal report creation wizard side of things. Oracle no doubt recognises them as OUT parameters, so it's not Oracle at fault. I would guess the .net stuff is just querying the data dictionary to see what parameters there are rather than differentiating between the INs and OUTs. -
Calling a package procedure with Date parameter only
Hi All,
Please help me to call a package procedure with Date parameter from sql prompt.
ArifCheck the below procedure.
SQL> ed
Wrote file afiedt.buf
1 create or replace procedure procdate (p_date_in date)
2 is
3 p_date_out date;
4 begin
5 p_date_out := add_months(p_date_in,6);
6 dbms_output.put_line(p_date_out);
7* end;
SQL> /
Procedure created.
SQL> exec procdate('01-JAN-2010');
01-JUL-10
PL/SQL procedure successfully completed.
SQL> exec procdate(to_date('01/01/2010','DD-MM-YYYY'));
01-JUL-10
PL/SQL procedure successfully completed.
SQL> exec procdate('31-DEC-2010');
30-JUN-11
PL/SQL procedure successfully completed. -
How to find out Unused Packages/Procedures/Functions/Triggers
Hi,
I have one database. This database is with 7 schemas. Around 1000 triggers are associated with each schema. But the application is using only some triggers.
How to find out the used triggers? Apllications is developed in J2EE.
Same way I want to find out the for Packages/Procedures and Functions.
Any easy way is available?
Please help me.
regards
MathewHi,
>Audit the execution event on the objects by access.
Kindly explain how to enable this auditing.
regards
Mathew -
Encryption of pl/sql package/procedures/function code
Is it possible to make the code inside a package/procedure/function un readable to other users.
As is some of the api package body code in portal ?
thanks in anticipation.
SD,PL/SQL Wrap Utilityhttp://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96624/c_wrap.htm#LNPLS016
Note, however that you cannot revert back to original un-wrapped code from a code that has been wrapped. You would need access to the original source files to get the original source code. -
How to Create a PDF file from database package/procedure in 10g?
Hi,
Is there a way to create a pdf file in 10g Application Server using PL/SQL package/procedure in 10g database?
Thanks in advance.
Regards
Vishnu Nekkantihttp://technology.amis.nl/2010/10/20/as_pdf-generating-a-pdf-document-with-some-plsql/
http://technology.amis.nl/2012/04/11/generating-a-pdf-document-with-some-plsql-as_pdf_mini-as_pdf3/ -
How to know (package , procedures or functions) name for current sessions
Hi all
I'm DBA and i want to find way to get object name whatever (package , procedures or functions) for current running statement in active session.
To clarify when i open session browser from toad i can see active sessions and see current statement for every session but without the name of the object.
Is there any way to know this point.
thanks in advanceselect *
from dba_objects
where object_id in (select nvl(t.PLSQL_ENTRY_OBJECT_ID,-1)
from v$session t
where sid = 452)
Ramin Hashimzade -
Calling a package.procedure that accepts a type table.
I'm getting the error "Error(45,20): PLS-00330: invalid use of type name or subtype name" when I run the procedure SP when it calls the d.is_date procedure that accepts a table as the second parameter.
below is the Abbreviated code for the package.procedures that contain the "is_date".
I've tried several things and can't seem to get SP to compile.
thanks.
create or replace
PROCEDURE SP AS
valid_out boolean;
date_out date;
date_fmt_out varchar2(30);
type Mask_Tabtype is
table of varchar2( 30 )
index by binary_integer;
Fmts Mask_Tabtype;
BEGIN
Fmts( 1 ) := 'fxDD-MON-RR';
Fmts( 2 ) := 'fxDD-MON-YYYY';
Fmts( 3 ) := 'fxDD-MON';
Fmts( 4 ) := 'fxMM/DD';
Fmts( 5 ) := 'fxMM/RRRR';
d.Is_Date( 'test', Mask_Tabtype, Valid_out, Date_out, Date_Fmt_out);
END SP;
create or replace package d as
type Mask_Tabtype is
table of varchar2( 30 )
index by binary_integer;
Fmts Mask_Tabtype;
Procedure Is_Date( Value_in in varchar2,
Tab in Mask_Tabtype,
Valid_out out boolean,
Date_out out date,
Date_Fmt_out out varchar2);
end d;
create or replace package body d as
Fmt_Count integer;
Date_Val date := null;
Date_Fmt varchar2( 30 ) := 'fxMM/DD/YYYY';
Procedure Is_Date(value_in in varchar2, Tab In Mask_Tabtype,
Valid_out out boolean, Date_out out date, Date_Fmt_Out out varchar2)
is
begin
/* Logic here removed to make post smaller
End Is_date;
End d;Here...
d.Is_Date( 'test', Mask_Tabtype, Valid_out, Date_out, Date_Fmt_out);you are passing in Mast_Tabtype, which is a type declaration, rather than a variable of that type.
Try...
d.Is_Date( 'test', Fmts, Valid_out, Date_out, Date_Fmt_out); -
How to give grant permission on packaged procedure
Hi ,
This is Ramesh what is my requirement is i want give permission packaged procedure that means i given permission only procedure not entire package it is possible or not? if yes then why
given exampleHi,
You can't give grant to package.function or procedure.
You can do that following way.
SQL> create or replace package p is function f return number; end p;
2 /
Package created.
SQL> create or replace function f return number is begin return p.f; end;
2 /
Function created.
SQL> grant execute on f to scott;
Grant succeeded.
Regards
Mahir M. Quluzade
Maybe you are looking for
-
Call functions in parent(?) from popup window(?)
I'm not sure the terms parent or window in flex 4. I want to call functions in parent from parent window. it seems to be hard. Help me please. Thanks in advance. ========================== index.mxml ========================== (root element : <mx:App
-
Xcelsius Crashes when I try and Preview
So I have a file I have been working on for sometime, and for some reason when I try and preview now, Xcelsius just stops working and I have to shut it down. It only started happening today when I added some new content, but my real question is, what
-
I had taken the Oracle 11g performance and Tuning class from Oracle. I am just wondering how close the 1z1-064 will be to the 1z0-054. I am also studying for the 1z1-064 exam. Are there any books out yet, or just the otn material. Thanks Roger
-
TS1389 SC Info Folder Won't Permanently Delete
What if the SC Info folder does not permanently delete even if I empty my trashcan? I have tried all of these steps and I'm still having the same problem.
-
Hi Gurus, While making MIGO entry for rework job order i am getting error "Deficit of stock w.vendor unr 12.250 kg". Actually showing error for "basic material" . Kindly let me know wether i have to make SPRO for 122 mvt. Eg. Required material - AAA