PL/SQL :: Privileges Required For Calling A Function
Sep 6, 2012
11.2
For procedures, we need to grant EXECUTE privilege.
For example:
grant execute on scott.process_salary to john;Lets say I have a function SCOTT.GET_EMPIDS and I want another user john to be able to invoke this fuction. So, what is the privilege that needs to be granted to John.
I have one question regarding privileges required for export.I read in a document that
Quote: If you do not have the system privileges contained in the EXP_FULL_DATABASE role, you cannot export objects contained in another user's schema. For example, you cannot export a table in another user's schema, even if you created a synonym for it.
what are the system privileges required in EXP_FULL_DATABASE role to perform export objects contained in another users schema?
Which Privileges required to create a trigger like after logon on database. I have grant Create any trigger privilege to user but still not able to create and give me an error insufficient Privilege.
-- Create a table type of the table you want TYPE tbl_test IS varray(100) of VARCHAR2(30);
-- Function that will return the table type FUNCTION fnc_test RETURN tbl_test;
-- End package END;
CREATE OR REPLACE PACKAGE BODY pkg_test AS FUNCTION fnc_test RETURN tbl_test IS -- type table_name_va is varray(100) of VARCHAR2(30); -- Variable of the type tbl_test
[code]...
But i am having problem calling this to test it.
declare TYPE tbl_test IS varray(100) of VARCHAR2(30); var_tbl_test tbl_test; begin var_tbl_test:= pkg_test.fnc_test;
DECLARE var VARCHAR2(4000); BEGIN SELECT DBMS_LOB.SUBSTR(v_clob,4000,1) INTO var FROM test_clob; END; ** v_clob is a CLOB column in test_clob table.
I get the below error:
wrong number or types of arguments in call to 'SUBSTR'"SYS"."DBMS_LOB"."SUBSTR": invalid identifier...I have execute privileges to DBMS_LOB.SUBSTR function.
I created a PROCEDURE in that i am calling function which calculate sum of salary...I just want Output in format for that which function i need to use...?
Actual Output:::
DEPt_Name SALARY ACCOUNTING 8750 RESEARCH 10875 SALES 11600
I want Output in well alignment column...i WANT Output IN column format but my output in not geting in that format...Is there any function to align output...I want Output in well alignment column
I tried to use external C procedure from the database and i did all required steps as below. 1. create a C program 2. compile and link the C program 3. copy it to the Oracle_home/bin directory 4. configure listener.ora and tnsnames.ora files
I am getting a (PL/SQL: ORA-00903: invalid table name) compile error in a procedure using a merge statement. I have seen many examples using this technique and am at a loss as to why I can't compile.
the pipelined function is:
FUNCTION f_crcli_pipe(pi_source_data IN sys_refcursor, pi_limit_size IN PLS_INTEGER DEFAULT pkg_crcli_variables.c_cursor_limit_def) RETURN CRCLI_AA PIPELINED PARALLEL_ENABLE(PARTITION pi_source_data BY ANY) IS
[code].....
the error is pointing to the TABLE function in the USING clause of the merge statement.
I'm trying to execute a dynamic sql that calls a function. But that function has inserts and deletes inside and this way it can't be called through a select statement. And to be worst, it has an other problem, my function uses a record type as parameter.
My code (sample): ----------------- DECLARE type r_parameters is record (cd_query cons_query_param.cd_query%type, cd_usuario cons_query_user.cd_usuario%type, nr_param cons_query_param.nr_param%type, vl_param varchar2(2000),
We have a daily batch job executing a oracle-plsql function. Actually the quartz scheduler invokes a java program which makes a call to the oracle-plsql function. This oracle plsql function deletes data (which is more than 6 months) from 4 tables and then commits the transaction.
This batch job was running successfully in the test environment but started failing when new data was dumped to the tables which happened 2 weeks ago (The code is supposed to go into production this week). Earlier the number of rows in each table was not more than 0.1 million. But now it is 1 million in 3 tables and 2.4 million in the other table.
After running for 3 hours, we are getting a error in java (written in the log file) "...Connection reset; nested exception is java.sql.SQLException: Io exception: Connection reset....". When the row-counts on the tables were checked, it was clear that no record was deleted from any of the tables.
Is it possible in oracle database, for the plsql procedure/function to be automatically terminated/killed when the connection is timed out and the invoking session is no longer active?
There are 2 Oracle databases with pseudo names Remote and Local. I have a function in Remote called FUS.F_Return_10 which simply returns 10 for testing purposes, where FUS is a schema name. In Local I want to create a procedure that will call the above function. Here's the PL/SQL:
CREATE OR REPLACE PROCEDURE TEST ( V_COUNT OUT NUMBER ) AS V_FOO NUMBER(2,0); BEGIN
[Code]...
There's a Public Database Link called PER_ACC in Local. When I try to create this procedure I get: Encountered symbol "@" when expecting one of the following: .(*%&................
I'm trying to call a Java function from within a PL/SQL aggregation function with a (array of) complex data type.
a) basic definitions (work and are ok)
CREATE OR REPLACE TYPE eventtype AS OBJECT ( relevance NUMBER, bid1 NUMBER,tid1 NUMBER,prob1 NUMBER, bid2 NUMBER,tid2 NUMBER,prob2 NUMBER, bid3 NUMBER,tid3 NUMBER,prob3 NUMBER, bid4 NUMBER,tid4 NUMBER,prob4 NUMBER, bid5 NUMBER,tid5 NUMBER,prob5 NUMBER, bid6 NUMBER,tid6 NUMBER,prob6 NUMBER ); CREATE OR REPLACE TYPE eventtuple IS TABLE OF eventtype; /
b) The following call works (but is not exactly that what I want):
public class pcompDP { public static NUMBER probComputation(oracle.sql.STRUCT pin) throws java.sql.SQLException { ... } } create or replace FUNCTION pcompDPFunc(cin IN eventtype) RETURN NUMBER PARALLEL_ENABLE DETERMINISTIC AS LANGUAGE JAVA NAME 'pcompDP.probComputation(oracle.sql.STRUCT) return BigDecimal'; / SELECT pcompDPFunc(eventtype(5, 6, 0.3, 10, 20, 0.45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)) from dual;
c) The following call doesn't work (but should have the intended semantics):
public class pcompDP { public static NUMBER probComputation(oracle.sql.STRUCT[] pin) throws java.sql.SQLException { ... } } create or replace FUNCTION pcompDPFunc(cin IN eventtype) RETURN NUMBER PARALLEL_ENABLE DETERMINISTIC AS LANGUAGE JAVA NAME 'pcompDP.probComputation(oracle.sql.STRUCT[]) return BigDecimal'; / SELECT pcompDPFunc(eventtuple(eventtype(2, 3, 0.234, 1, 1, 0.123, 0, 0, 0, 0, 0, 0, 0, 0, 0), eventtype(5, 6, 0.3, 10, 20, 0.45, 0, 0, 0, 0, 0, 0, 0, 0, 0))) from dual;
d) What's the error? Do I have to use JPublisher or is it possible without it? I guess an array should be possible without it.
The type of the parameter seems to be wrong. Question is whether in PL/SQL, Java or SQL.
I have a procedure with 20 parameters, acutely it is to update a table and each param represents respective columns in a table. I want to update only few selected columns(random), as of now am passing Null as param values for remaining.
Is there any way to ignore the unnecessary parameters instead of passing NULL value.My Proc call looks like...
In our project we have many instance running with Oracle in one solaris zone. We are in the process of cost reduction so planning to bring the CPU in shared pool and reduce them.
if we can bring all the NUP (Named user Perception) CPU on one shared pool. Will it be cost effective and is there any problems in performing such change.
I will be installing SOA Suite with OSB in Exalogic for testing. It is not for the production environment and very simple application will be used for testing. Database admin asked me what size database would be required but I did not find clear answer in the documentation anywhere.
i have a good query but I thought i know the solution but actually I didn't it's very simple and straight forward but i didn't catch the rope terminal to follow now I have the following code
NOW I NEED A QUERY which will select the only translator who knows the languages written in where clause like if i specify two languages like 'italy' and 'english' the query should retrieve to me GH and SE also if i passed languages 'spainsh' and 'persia' it should return JH only
but if i passed languages like 'Italy' and 'Dutch' it should not return any thing (just : no rows selected)