Function&procedures using roles or grants

U cANNOT create a pl/sql function or procedure using a table which is granted to a
user via a role .
But there seems no problem in creating a function or procedure via a grant option.
Why is it so;
& how

Hello,
sqldev should do this. I wonder which no-oracle database you are attmpting to migrate, and possibly
a concise testcase, in terms of objects involved, that does have this problem.
I will try to test it here.
Thanks
Regards,
Marcello

Similar Messages

  • How  group by function/procedure used in function

    i want to capture information in different table which extract by select statement like(select trans_date from bankAccount group by cust_id).

    CTAS - Create Table As Select.
    Example:
    CREATE TABLE my_results
    NOLOGGING AS
    SELECT
      trans_date
    FROM bankAccount
    GROUP BY
      cust_idRefer to the [url http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14200/toc.htm]Oracle® Database SQL Reference for details.

  • Private function / procedure to be used with in a package

    Hi All
    I wanted to find out how would the definition be for a function which is defined so as to be used/called by the other functions / procedures with in a particular pakage and should not be visible/accessible for any other routine out side the package in which it is defined..
    could you please advice me on this? Thanks!
    Sarat

    It is possible: you can nest one function/procedure in another:
    SQL>CREATE OR REPLACE FUNCTION sum_squares(
      2     p_a   IN   NUMBER,
      3     p_b   IN   NUMBER)
      4     RETURN NUMBER
      5  IS
      6     FUNCTION square(
      7        p_n   IN   NUMBER)
      8        RETURN NUMBER
      9     IS
    10     BEGIN
    11        RETURN p_n * p_n;
    12     END square;
    13  BEGIN
    14     RETURN square(p_a) + square(p_b);
    15  END sum_squares;
    16  /
    Function created.
    SQL>SELECT sum_squares(3, 4) FROM dual;
    SUM_SQUARES(3,4)
                  25Urs

  • Calling Oracle function and Procedure using OCCI with in C++ code

    Could any body send me the sample code to create and execute Oracle function and Procedure using OCCI concept in C++?.
    Edited by: 788634 on Aug 16, 2010 4:09 AM

    Hi Vishnu,
    Yes, sure, you can create a PL/SQL procedure, function, package, package body, etc. from within an OCCI application. I would say that, generally, this is not the sort of activity a typical client application would perform unless there is some initialization/installation processes that need to happen. In any case, here is a simple demo showing how to create a stand alone procedure (in a real application I would use a package and body) that returns a ref cursor. The ref cursor is just a simple select of two columns in the hr.countries sample table. Of course, there is no error handling, object orientation, etc. in this demo - I wanted to keep the code as short and as simple as possible to illustrate the concept.
    Regards,
    Mark
    #include <occi.h>
    #include <iostream>
    using namespace std;
    using namespace oracle::occi;
    int main(void)
      // occi variables
      Environment *env;
      Connection  *con;
      Statement   *stmt;
      ResultSet   *rs;
      // database connection information
      string user = "hr";
      string passwd = "hr";
      string db = "orademo";
      // sql to create the procedure which returns a ref cursor as out parameter
      // should be run as hr sample user or in a schema that has select privilege
      // on the hr.countries table and a synonym (countries) that points to the
      // hr.countries table
      string sqlCreate =
        "create or replace procedure get_countries(p_rc out sys_refcursor) as "
        "begin"
        " open p_rc for"
        " select country_id, country_name from countries order by country_name; "
        "end;";
      // pl/sql anonymous block to call the procedure
      string sqlCall = "begin get_countries(:1); end;";
      // create a default environment for this demo
      env = Environment::createEnvironment(Environment::DEFAULT);
      cout << endl;
      // open the connection to the database
      con = env->createConnection(user, passwd, db);
      // display database version
      cout << con->getServerVersion() << endl << endl;
      // create statement object for creating procedure
      stmt = con->createStatement(sqlCreate);
      // create the procedure
      stmt->executeUpdate();
      // terminate the statement object
      con->terminateStatement(stmt);
      // now create new statement object to call procedure
      stmt = con->createStatement(sqlCall);
      // need to register the ref cursor output parameter
      stmt->registerOutParam(1, OCCICURSOR);
      // call the procedure through the anonymous block
      stmt->executeUpdate();
      // get the ref cursor as an occi resultset
      rs = stmt->getCursor(1);
      // loop through the result set
      // and write the values to the console
      while (rs->next())
        cout << rs->getString(1) << ": " << rs->getString(2) << endl;
      // close the result set after looping
      stmt->closeResultSet(rs);
      // terminate the statement object
      con->terminateStatement(stmt);
      // terminate the connection to the database
      env->terminateConnection(con);
      // terminate the environment
      Environment::terminateEnvironment(env);
      // use this as a prompt to keep the console window from
      // closing when run interactively from the IDE
      cout << endl << "ENTER to continue...";
      cin.get();
      return 0;
    }

  • How to use functions/procedures like wwv_flow_sw_api

    Hello,
    I want to use functions/procedures like wwv_flow_sw_api.check_priv(:P4_SCHEMA) in a process, but I get the error "identifier wwv_flow_sw_api.check_priv(:P4_SCHEMA); must be declared".
    How can I access these functions?
    Thank you,
    Kirsten

    Hi Jari,
    my problem is, that I need to replicate the exact feature of Query Builder page in my
    application (see thread Re: How to create Query Builder page in application
    So I imported the page 1002 and tried to make it working.
    Do you know any solution?
    Than you,
    Kirsten

  • Getting all Functions and Procedures using DBA_ARGUMENTS

    Hi All
    I am wanting to find out all functions and procedures that are within each of my packages and am using the following SQL to do this.
    SELECT DISTINCT A.OBJECT_NAME, A.PACKAGE_NAME,
    DECODE(POSITION,0,'FUNCTION','PROCEDURE')
    FROM DBA_ARGUMENTS A
    WHERE OWNER = 'NB'
    I have discovered however that if a procedure has been overloaded with function will appear twice: as procedure and as a function
    I was wondering if there was any workaround for this as I would only like a function to be displayed once?
    Kind Regards
    Mark

    There is an 'OVERLOAD' column which can be used to show only specific overloads (e.g. first).
    Determining which overload should be displayed in any given case may require some more thought.

  • Running a stored procedure using  isqlPlus

    I have written a simple stored procedure which takes EMPLOYEE_ID as IN parameter returns EMPLOYEE_FIRST_NAME as OUT parameter (For Learning purpose only)
    How do I run this stored procedure using isqlPlus.
    Below is my stored procedure.
    CREATE OR REPLACE PROCEDURE "HR"."MY_PROC_2" (
    EMPLOYEE_ID_NUM in NUMBER,
    EMPLOYEE_FIRST_NAME out VARCHAR2
    as
    begin
    Select FIRST_NAME into EMPLOYEE_FIRST_NAME from Employees
    where Employee_ID = EMPLOYEE_ID_NUM;
    return;
    end;

    did you run that same procedure in SQL*Plus and it functioned ?
    Joel P�rez

  • How to use Role Menu item in BI 7.0

    Hi experts,
    From web applications desiger in version 3.5 we can use Role Menu item to access our querys easily.
    In version 7.0 this item has been deleted from standard items. How can we manage it ? Thanks a lot
    Best regards,
    Santi

    You can use EP role to have the same functionality.
    Another option is to use the 3.X role menu web item after applying note 1075789, in this case role meny web item will display 7.0 objects also.
    Thanks.

  • How to pass array of Object in A Procedure using OCCI.......

    I m also trying for How to pass Object to a procedureb using OCCI...
    Steps....
    1. I created A type.....
    2. Then I created a VARRAY using that Type.
    3.After that I have written An Procedure with object as a parameter..
    now using OCCI how do u bind the parameter with this . plz note that using OTT
    i have already created the class representation of above object type i.e class
    four Files Created 1> demo.h 2>registermapping.h
    3> demo.cpp 2>registermapping.cpp
    After I want to Pass the Values in A Vector...
    vctor<full_name *> vect;
    stmt=con->createStatement("BEGIN Add_Object(:1); END;");
    full_name *name1 = new full_name; //Giving the Error here Given below....
    name1->
    name1->
    Through name1 Which Function I will call in which I will Pass a String....
    like
    name1->readSQL("Sanjay"); Or I have to add a function......
    vect.push_back(name1);
    setVector(stmt,1,vect,"FULL_NAME");
    error C2259: 'FullName' : cannot instantiate abstract class
    can u plz suggest me Why this Error is Giving......?
    How to pass the data?
    setFirst_name() and setLast_name() this two function I will add in Demo.cpp which one created automativcally by Using OTT command.....or other way plz tell me Boss ....
    Can u lz Suggest me ASAP....

    hi Nishant ,
    What u have done Now I mm trying ....
    can u Plz Suggest me......
    How to pass and Array of Object in Procedure using OCCI... Doing....
    90% finished Two Error's Are Coming...
    1> If I create the Class then Data Not Inserting table......
    2> If I will create the Class through OTT command.......
    then U can't Instantiate Object It is DIsplying ,this is Abstract Class(PObject)...
    Beco'z the below Method is Not adding Automatically by OTT command which is Pure Virtual Function.....
    But I added this Function Still SAme Error Giving..
    getSQLTypeName(oracle::occi::Environment env, void *schName,
    unsigned int &schNameLen, void **typeName,
         unsigned int &typeNameLen) const
    Plz Suggest me....
    regard's
    sanjay

  • How to use 'roles' attribute in action-mapping ?

    Hi,
    Can anybody tell me what are the steps needed to use 'roles' attribute in <action> tag of struts-config.xml file?
    I want to provide Action level security.
    Also pls post an example if u r having.
    Regards
    Veeru

    Hi,
    The RfcAdapter trys to find a Sender Agreement for this RFC call but the lookup failes. The values used for this lookup are:
    Sender Party/Sender Service: The values from Party and Service belonging to the sender channel.
    Sender Interface: The name of the RFC function module.
    Sender Namespace: The fix RFC namespace urn:sap-com:document:sap:rfc:functions
    Receiver Party/Receiver Service: These fields are empty. This will match the wildcard
    Regards,
    Suryanarayana

  • Error in reconcilation Function - Job "Reconcile roles and privileges"

    SAP NW 7.0 SP2 Patch 3
    Roles contain Privileges
    Help file says: "If you are using roles and privileges, you will need to perform a reconciliation of the roles/privileges assigned to the users in the identity store after the roles are modified. "
    Job imported as described.
    When I let the job run on the ID-Store, for each entry, the following error message occurs:
    runFunctionsInString($FUNCTION.reconcile( MSKEY )$$) got exception
    org.mozilla.javascript.NotAFunctionException: reconcile( MSKEY )
    ...where MSKEY is, of course, the MSKEY of the entry.
    If I let run the job with the Windows-Dispatcher and as a VB-script, it produces no error; however, in the output file, there are a lot of Messages like
    "!ERROR: Invalid use of Null"
    Only some entries (of Type MX_PERSON) show the "Priviliege added: (...)" output. But the job does not add the Privileges assigend to the role, as it should.
    So, I would suggest that one redefines the SQL-Query of the Job so that it runs only on MX_PERSONS. But then, still, in my case, it does nothing.
    Has anyone better experiences with the Job?
    Edited by: Thomas P. Felder on Sep 25, 2008 10:32 AM

    The job when imported by default uses java runtime engine but the script is written in vbscript syntax so you have to change the engine or the script syntax.
    When you did your select statement did you use SELECT DISTINCT.  That will also cause errors.  I do not narrow the entry type to MX_PERSON.
    I'm installing the patch now;  I will see if I get any errors.

  • Stored Procedure used as a data source for an Apex report

    Just wondering whether anyone has used a Stored Procedure as the data source for an Apex report. An option to select Stored Procedures(s) as the data source does not appear within the IDE (only displays Table, Views, Functions).
    Do you have to return the definition of the Stored Procedure via a function ... if so, how is this done ?
    Thank you.

    >
    Welcome to the forum: please read the FAQ and forum sticky threads (if you haven't done so already), and update your profile with a real handle instead of "920338".
    When you have a problem you'll get a faster, more effective response by including as much relevant information as possible upfront. This should include:
    <li>Full APEX version
    <li>Full DB/version/edition/host OS
    <li>Web server architecture (EPG, OHS or APEX listener/host OS)
    <li>Browser(s) and version(s) used
    <li>Theme
    <li>Template(s)
    <li>Region/item type(s)
    With APEX we're also fortunate to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproducing things there is the best way to troubleshoot most issues, especially those relating to layout and visual formatting. If you expect a detailed answer then it's appropriate for you to take on a significant part of the effort by getting as far as possible with an example of the problem on apex.oracle.com before asking for assistance with specific issues, which we can then see at first hand.
    Just wondering whether anyone has used a Stored Procedure as the data source for an Apex report. An option to select Stored Procedures(s) as the data source does not appear within the IDE (only displays Table, Views, Functions).
    Do you have to return the definition of the Stored Procedure via a function ... if so, how is this done ? When asking a question about "reports" it's firstly essential to differentiate between standard and interactive reports. Standard reports can be based on tables, views, SQL queries, or PL/SQL function blocks that return the text of a SQL query. Interactive reports can only be based on a SQL query.
    "Stored Procedures" are therefore not an option (unless you are using the term loosely to describe any PL/SQL program unit located in the database, thus including functions). What would a procedure used as the source of a report actually do? Hypothetically, by what mechanisms would the procedure (a) capture/select/generate data; and (b) make this data available for use in an APEX report? Why do you want to base a report on a procedure?

  • Weird Problem calling Stored Procedure using JDBC

    Scenario is..
    I have J2EE application and calling stored procedure using JDBC.
    My application connects to instance "A" of testDB.
    Schema "A" does NOT own any packages/procedure but granted execute on oracle packages/procedures that reside in schema "B" of testDB.
    In java code I call procedure(proc1) in package(pac1) which internally calls procedure(proc2) in package(pac2).
    The problem occurs when procedure pac2.proc2 is modified. After the modification, my java code fails and throws an exception "User-Defined Exception" and I am also getting "ORA-06508: PL/SQL: could not find program unit being called". This clears up only if I bounce the web container. (This doesn't happen if I modify pac1.proc1 and run my application)
    Has any one faced this problem? Please suggest if any thing can be changed in jdbc code to fix this problem.
    Thanks

    Hi,
    I assume these are PL/SQL packages and that the changes are made at the package specification level?
    If so, it looks like you are hitting the PL/SQL dependencies rules. In other words, if the spec of proc2 is changed, then proc1 is invalidated, since proc1 still depends on the old version of proc2's spec. As a result, if you try to run proc1, its spec must either be explicitly rewritten before it could run again or implicitly recompiled first, if the (implicit) recompilation fails, it won’t run.
    Kuassi http://db360.blogspot.com

  • How can I compile all functions, procedures and packages with a script?

    I need to compile all functions, procedures and packages of 5 schemas (users) with a script.
    How can I do it?
    Thanks!

    you can create a script to select all invalid objects in those schemas Since Oracle 8 introduced NDS this approach has struck me as a trifle old fashioned. It's much simpler to loop round the query in PL/SQL and use EXECUTE IMMEDIATE to fire off the DDL statements. No scripts, no muss, no fuss.
    Having said that, the problem with this approach and also with using DBMS_UTILITY.COMPILE_SCHEMA is that they do not compile all the invalid objects in dependency order. This may result in programs being invalidated by the subsequent compilation of dependencies. This is due to the introduction of Java into the database.
    The UTLRP script is much better, because it (usually) avoids cyclic references. But you still may need to run it more than once.
    In general it is better to avoid sledgehammer recompilations (like DBMS_UTILITY.COMPILE_SCHEMA, which starts by invalidating all the objects). If we have twenty invalid objects, nineteen of which are dependencies of the twentieth, we actually only need to recompile the master object, as recompiling it will trigger the recompilation of all the others.
    Cheers, APC

  • Read item from Java class and call to stored function/procedure of database

    Hi,
    I am looking solution that I was trying to find becasue of I am not expert and novice of ADF so I am getting problem to do. I am trying migrating from oracle forms to JDeveloper[ADF].
    I want to call database stored function from JSF pages by java bean class of a button press event (manually created) and after button event I have called java class which I created manually. But I can not read that values what I given into jsp page.
    question1: How can I read jsp pages items value to java class ?
    question2: How can I call to database stored function/procedure with that parameter?
    question3: How can I use return value of that stored function/procedure ?
    Please reply me .
    Thanks,
    zakir
    ===
    Edited by: Zakir Hossain on Mar 29, 2009 10:22 AM

    ---

Maybe you are looking for

  • How do i add text to the screen in java3d

    I have tried overiding the jpanel, but the paint and paintcomponents are not called. Is their a way i can draw directly to the screen, while using java3d in the background.

  • Finished Goods at  Moving average Price.

    Hi Experts, In my company FG maintained at Moving average price, during the Go-live they fed the value manually in material master of FG. Now at the time of production conformation system considering BOM for consumption, but for cost of production sy

  • How to select data from structure

    how to select data from structure

  • Installing PHP on OS 10.3.9 - any advice for unix novice??

    Not sure if this is the right forum, but here goes... I am trying to get PHP set up on my mac, but I have gotten a bit stuck. I think I have sucessfully downloaded and installed MySQL, but I am very confused about the best way to install the necessar

  • OIM SPML lookup requests

    Hello.. Can SPML service in OIM return User Defiend Fields of a user as a response in a "Lookup" / "Search" operation? If so can we restrict the User Defined Fields that can be returned in the response? .. Thank you.