Link to database not be created using a stored procedure

Hello

I am creating a link of database using a stored procedure.

Here is the code for it

CREATE OR REPLACE PROCEDURE create_db_link (ca_db_name IN VARCHAR2,

ca_service_name IN VARCHAR2)

AUTHID CURRENT_USER IS

BEGIN

EXECUTE IMMEDIATE ' create public database link test_db_link connect to ca_db_name identified by ca_db_name using "ca_service_name" ';

END create_db_link;

During execution of the code is created the db_link. But, when I ask all_db_links I get the following result.

OWNER

------------------------------

DB_LINK

--------------------------------------------------------------------------------

USERNAME

------------------------------

HOST

--------------------------------------------------------------------------------

CREATED

---------

PUBLIC

TEST_DB_LINK. WORLD

CA_DB_NAME

ca_service_name

20 Aug 13

Could you please help me understand why it shows the parameter names in the name column of the USER and the HOST instead of the name of the database and the name of the service?

This is to show exactly what you said to do.

Did you expect that Oracle would read as if by magic through your string you passed to run immediately and magically know to replace all occurrences of the string that correspond to local (or even global) parameter/variable names with the values of these variables?  It does not work like that.  You could concatenate the values into the string.

for example

EXECUTE IMMEDIATE ' create public database link test_db_link connect to ' | ca_db_name |' identified by ' | ca_db_name: ' using the "' | ca_service_name | " ' ;

But why are create you database links running?  Shouldn't this be part of the design of your application and the initial fact before the application runs?

Tags: Database

Similar Questions

  • Tables created in a stored procedure cannot be used with dynamic SQL? The impact?

    There is a thread on the forum which explains how to create tables within a stored procedure (How to create a table in a stored procedure , however, it does create a table as such, but not how to use it (insert, select, update, etc.) the table in the stored procedure.) Looking around and in the light of the tests, it seems that you need to use dynamic SQL statements to execute ddl in a stored procedure in Oracle DB. In addition, it also seems that you cannot use dynamic SQL statements for reuse (insert, select, update, etc.) the table that was created in the stored procedure? Is this really the case?

    If this is the case, I am afraid that if tables cannot be 'created and used"in a stored procedure using the dynamic SQL, as is the case with most of the servers of DB dynamic SQL is not a part of the implementation plan and, therefore, is quite expensive (slow). This is the case with Oracle, and if yes what is the performance impact? (Apparently, with Informix, yield loss is about 3 - 4 times, MS SQL - 4 - 5 times and so on).

    In summary, tables created within a stored procedure cannot be 'used' with dynamic SQL, and if so, what is the impact of performance as such?

    Thank you and best regards,
    Amedeo.

    Published by: AGF on March 17, 2009 10:51

    AGF says:
    Hi, Frank.

    Thank you for your response. I understand that the dynamic SQL is required in this context.

    Unfortunately, I am yet to discover "that seeks to" using temporary tables inside stored procedures. I'm helping a migration from MySQL to Oracle DB, and this was one of the dilemmas encountered. I'll post what is the attempt, when more.

    In Oracle, we use [global temporary Tables | http://www.psoug.org/reference/OLD/gtt.html?PHPSESSID=67b3adaeaf970906c5e037b23ed380c2] aka TWG these tables need only be created once everything like a normal table, but they act differently when they are used. The data inserted in TWG will be visible at the session that inserted data, allowing you to use the table for their own temporary needs while not collide with them of all sessions. The data of the TWG will be automatically deleted (if not deleted programmatically) when a) a commit is issued or b) the session ends according to the parameter that is used during the creation of the TWG. There is no real need in Oracle to create tables dynamically in code.

    I noticed that many people say that the "Creation of the tables within a stored procedure" is not a good idea, but nobody seems necessarily explain why? Think you could elaborate a little bit? Would be appreciated.

    The main reason is that when you come to compile PL/SQL code on the database, all explicit references to tables in the code must correspond to an existing table, otherwise a djab error will occur. This is necessary so that Oracle can validate the columns that are referenced, the data types of those columns etc.. These compilation controls are an important element to ensure that the compiled code is as error free as possible (there is no accounting for the logic of programmers though ;)).

    If you start to create tables dynamically in your PL/SQL code, so any time you want to reference this table you must ensure that you write your SQL queries dynamically too. Once you start doing this, then Oracle will not be able to validate your SQL syntax, check the types of data or SQL logic. This makes your code more difficult to write and harder to debug, because inevitably it contains errors. It also means that for example if you want to write a simple query to get that one out in a variable value (which would take a single line of SQL with static tables), you end up writing a dynamic slider all for her. Very heavy and very messy. You also get the situation in which, if you create tables dynamically in the code, you are also likely to drop tables dynamically in code. If it is a fixed table name, then in an environment multi-user, you get in a mess well when different user sessions are trying to determine if the table exists already or is the last one to use so they can drop etc. What headache! If you create tables with table names, then variable Dynamics not only make you a lot end up creating (and falling) of objects on the database, which can cause an overload on the update of the data dictionary, but how can ensure you that you clean the tables, if your code has an exception any. Indeed, you'll find yourself with redundant tables lying around on your database, may contain sensitive data that should be removed.

    With the TWG, you have none of these issues.

    Also, what is the impact on the performance of the dynamic SQL statements in Oracle? I read some contrasting opinions, some indicating that it is not a lot of difference between static SQL and SQL dynamic in more recent versions of Oracle DB (Re: why dynamic sql is slower than static sql is this true?)

    When the query runs on the database, there will be no difference in performance because it is just a request for enforcement in the SQL engine. Performance problems may occur if your dynamic query is not binding variable in the query correctly (because this would cause difficult analysis of the query rather than sweet), and also the extra time, to dynamically write the query running.

    Another risk of dynamic query is SQL injection which may result in a security risk on the database.

    Good programming will have little need for the tables of dynamically created dynamically or SQL.

  • Use the stored procedure to create the data model for the bi publisher report

    Hi all

    Can we use stored procedure to create the data model for BI Publisher reports? I did find an example by using the stored procedure to complete the data model in the bi publisher report.

    Thank you

    Virat

    Check out these links

    BI publisher to use the stored procedure
    Re: Stored procedures and dynamic columns
    Re: Is it possible to use stored procedures in BI Publisher GUI?
    Re: PL/SQL stored w / model XML?

    If brand pls help

  • Cross-Schema insert by using the stored procedure

    Hi all.

    I am currently migrating 11.2.0.1 to 11.2.0.3,
    and I have to deal with an unexpected privileges error "ORA-13199: insufficient privilege for the table in the application of the xxx model."

    While inserting triplets in the table in the application of the model
    using a stored procedure which is
    owned by the owner of model table and app,
    but called by another issued user.

    There has never been a problem 10.2.0.4 or 11.2.0.1.
    It seems that something has really changed, (perhaps an authid pragma or something like this in the code internal SDO_RDF_TRIPLE?)
    The two users are needed on my system for security policy reasons.



    Here's a simplified script to reproduce the success on 1.2.0.1 and error on 11.2.0.3.
    Users are: ADMWAT = model, USEWAT = calling application


    SQL > connect SYS/xxxxx@DB_*11201*.world as sysdba
    Connected.
    SQL > select value of MDSYS. RDF_PARAMETER where namespace = "MDSYS" and the attribute = "SEM_VERSION";

    VALUE
    --------------------------------------------------------------------------------
    * 112 *.

    SQL >
    SQL > connect ADMWAT/xxxxx@DB_11201.world
    Connected.
    SQL > CREATE TABLE family_rdf_data (id NUMBER, triple SDO_RDF_TRIPLE_S);

    Table created.

    SQL >
    SQL > exec SEM_APIS.create_rdf_model ('family', 'family_rdf_data', 'three');

    PL/SQL procedure successfully completed.

    SQL >
    SQL > GRANT INSERT ON family_rdf_data in MDSYS.

    Grant succeeded.

    SQL >
    SQL > create or replace PROCEDURE NEW_TRIPLE IS
    BEGIN 2
    3 INSERT INTO family_rdf_data VALUES (1,
    4 SDO_RDF_TRIPLE_S ('family',
    5 "http://www.example.org/family/John."
    6 "http://www.example.org/family/fatherOf."
    7 'http://www.example.org/family/Suzie'));
    8 END;
    9.

    Created procedure.

    SQL >
    SQL > GRANT EXECUTE ON NEW_TRIPLE to USEWAT;

    Grant succeeded.

    SQL >
    SQL > connect ADMWAT/xxxxx@DB_11201.world
    Connected.
    SQL > exec ADMWAT. NEW_TRIPLE();

    PL/SQL procedure successfully completed.

    SQL > rollback;

    Complete restoration.

    SQL >
    SQL > connect USEWAT/xxxxx@DB_11201.world
    Connected.
    SQL > exec ADMWAT. NEW_TRIPLE();

    PL/SQL procedure successfully complete.

    SQL >
    SQL >
    SQL >

    ************************************************************************************************************
    ************************************************************************************************************
    ************************************************************************************************************

    SQL > connect SYS/xxxxx@DB_*11203*.world as sysdba
    Connected.
    SQL > select value of MDSYS. RDF_PARAMETER where namespace = "MDSYS" and the attribute = "SEM_VERSION";

    VALUE
    --------------------------------------------------------------------------------
    * 11203 *.

    SQL >
    SQL > connect ADMWAT/xxxxx@DB_11203.world
    Connected.
    SQL >
    SQL > CREATE TABLE family_rdf_data (id NUMBER, triple SDO_RDF_TRIPLE_S);

    Table created.

    SQL >
    SQL > exec SEM_APIS.create_rdf_model ('family', 'family_rdf_data', 'three');

    PL/SQL procedure successfully completed.

    SQL >
    SQL > GRANT INSERT ON family_rdf_data in MDSYS.

    Grant succeeded.

    SQL >
    SQL > create or replace PROCEDURE NEW_TRIPLE IS
    BEGIN 2
    3 INSERT INTO family_rdf_data VALUES (1,
    4 SDO_RDF_TRIPLE_S ('family',
    5 "http://www.example.org/family/John."
    6 "http://www.example.org/family/fatherOf."
    7 'http://www.example.org/family/Suzie'));
    8 END;
    9.

    Created procedure.

    SQL >
    SQL > GRANT EXECUTE ON NEW_TRIPLE to USEWAT;
    Grant succeeded.

    SQL >
    SQL > connect ADMWAT/xxxxx@DB_11203.world
    Connected.
    SQL > exec ADMWAT. NEW_TRIPLE();

    PL/SQL procedure successfully completed.

    SQL > rollback;

    Complete restoration.

    SQL >
    SQL > connect USEWAT/xxxxx@DB_11203.world
    Connected.
    SQL > exec ADMWAT. NEW_TRIPLE();
    BEGIN ADMWAT. NEW_TRIPLE(); END;

    *
    ERROR on line 1:
    ORA-55303: SDO_RDF_TRIPLE_S constructor failed:

    SQLERRM = ORA-13199: insufficient privilege for the application of the model family table [
    ORA-06512: at the 'MDSYS. MD", line 1723
    ORA-06512: at the 'MDSYS. MDERR", line 17
    ORA-06512: at the 'MDSYS. SDO_RDF_TRIPLE_S', line 41
    ]
    ORA-06512: at the 'MDSYS. MD", line 1723
    ORA-06512: at the 'MDSYS. MDERR", line 17
    ORA-06512: at the 'MDSYS. SDO_RDF_TRIPLE_S', line 68
    ORA-06512: at "ADMWAT. NEW_TRIPLE', line 3
    ORA-06512: at line 1


    SQL >

    Published by: damien.claveau on March 26, 2012 02:02

    Damien,

    Please submit a Service request for this issue in Support of Oracle.

    Meanwhile, until a patch will be available, another possible solution, you could consider to use is to grant the DBA role to ADMWAT.

    If you want, please contact me directly by email: souripriya das at oracle dot com dot

    Thank you
    -Smiled.

  • Using the stored procedure: Source does not have a target executable

    I'm a guy from MS - SQL, so I'm fairly familiar with T - SQL syntax, but feels a heck of a time trying to take the code I wrote for SQL and turn this works with Oracle.

    in any case, I'm using Oracle SQL Developer, and I have a stored procedure that calls the Alter Table statement and adds a column. Just trying to get this one to work before moving on to the other that I have. I get the message that source does not have a target executable when I try to run this command.

    create or replace PROCEDURE rta_conv_addcolumn (rtatablename1 in varchar (20),)
    rtatablename2 in varchar (20),
    rtacolumnname in varchar (256),
    rtacolumninfo in varchar (256))
    AS
    DECLARE rtasql VARCHAR (4000);
    BEGIN
    IF EXISTS (SELECT * from user_tables WHERE table_name = rtatablename1)
    AND NOT EXISTS (SELECT * from user_tab_columns WHERE column_name = rtacolumnname)
    AND table_name = rtatablename1)
    AND NOT EXISTS (SELECT * from user_tab_columns WHERE column_name = rtacolumnname)
    AND table_name = rtatablename2)
    Then rtasql: = ' ALTER TABLE ["+ rtatablename2 +"] ADD "+ rtacolumnname +" "+ rtacolumninfo;
    Run (rtasql);
    END rta_conv_addcolumn;

    If I try to compile I get the following messages, which make no sense, since the syntax I use to declare the input variables seems to be good.

    Error (1.54): PLS-00103: encountered the symbol "(" quand attend une deles de valeurs suivantes:: =.), @ default % of the characters of the symbol ': = ' has been replaced by "(" pour continuer.)
    Error (2.29): PLS-00103: encountered the symbol "(" quand attend une deles de valeurs suivantes:: =.), @ default % of the characters of the symbol ': = ' has been replaced by "(" pour continuer.)
    Error (3.29): PLS-00103: encountered the symbol "(" quand attend une deles de valeurs suivantes:: =.), @ default % of the characters of the symbol ': = ' has been replaced by "(" pour continuer.)
    Error (4.29): PLS-00103: encountered the symbol "(" quand attend une deles de valeurs suivantes:: =.), @ default % of the characters of the symbol ': = ' has been replaced by "(" pour continuer.)
    Error (6.1): PLS-00103: encountered the symbol "DECLARE" when expecting one of the following: begin function package pragma procedure < an ID > subtype type use < a between double quote delimited identifiers of > form current cursor external language the symbol 'start' is substituted for 'SAID' continue.
    Error (15.5): PLS-00103: encountered the symbol "RTA_CONV_ADDCOLUMN" when expects it one of the following values: If

    Adds the column to the table specified in rtatablename1, if there is neither rtatablename1 nor rtatablename2.

    NOT TESTED

    create or replace PROCEDURE rta_conv_addcolumn(rtatablename1 in varchar,
    rtatablename2 in varchar,
    rtacolumnname in varchar,
    rtacolumninfo in varchar)
    AS
    rtasql VARCHAR(4000);
    count1 number;
    count2 number;
    count3 number;
    BEGIN
      SELECT count(*) into count1 FROM user_tables WHERE table_name = rtatablename1;
      SELECT count(*) into count2 FROM user_tab_columns WHERE column_name = rtacolumnname AND table_name = rtatablename1;
      SELECT count(*) into count3 FROM user_tab_columns WHERE column_name = rtacolumnname AND table_name = rtatablename2;
      IF count1>0 AND count2 = 0 AND count3=0 Then
        rtasql:= 'ALTER TABLE '|| rtatablename1 ||'ADD ' || rtacolumnname || ' ' || rtacolumninfo;
        Execute immediate rtasql;
      END IF;
    END rta_conv_addcolumn;
    /
    

    Max

    Published by: Massimo Ruocchio, December 12, 2009 02:15
    Missing AND

  • Logic of tip insert - using a stored procedure?

    Here's my use case:

    • I have a table called TAGS that has two columns: id (number key, primary) and text (string)
    • the table has a constraint of database set that each text must be unique
    • the table also has a fixed sequence back next id available
    • I created an entity of the DB object and its default View object
    • I also created a page where I display a table read-only based on the View object
    • Finally, I added a text field and a button to the page
    • What I want to achieve is to insert all tags entered in the entry in the table fields, when the button is clicked. Note, however, that the entry field is a comma-separated list of tags, moreover, I have to insert only those tags that are new (to respect the constraint of database), and finally, I would like to use the sequence in insert or orders. Once completed, the page should also be updated.

    My first question is whether a stored procedure is the right way to perform such a step insert logical. If not, what other means must be used in the ADF.

    My second question is to know how to call the stored procedure and pass it the value of the input as a parameter field. I found this article http://andrejusb.blogspot.cz/2011/04/invoking-stored-procedures-and.html, but miss me a few transition points:

    1. How the callGreetingsFunction method call (I just get it that it's a method of the EO generated Java class?) after that the button is clicked?
    2. How to pass the value of the input field in this method as a parameter?

    Thanks in advance for your help.

    Now, what happens if I run it like this:

    A. the procedure is executed after a click on the button

    (B) the page is not updated (I had to do the research to get the new lines are visible in the table)

    C. the constraint is ignored (after discounting there were several lines with unique identification number, but pr is - empty)

    D. nothing has been committed to the database - if I closed the application window and it start again, the lines have disappeared from the table, but addition of new lines used number of increased seq

    E. Similarly, if I did directly inserts into the database, these lines did not appear until I transferred the application

    B. told it page to refresh. And that's usually enough to refresh your ViewObject with: viewObject.executeQuery)

    C. Si the constraint is not enforced for null values. And this has nothing to do with the adf, this is related to oracle db.

    D. you're calling commit.

    E. you must re-run your view object (viewObject.executeQuery ())

    Nevertheless, here is my rookie questions:

    There there a simple way to refresh the page (or just the table containing the data)?

    -How to validate changes (immediately after execution of the procedure)?

    -How is the constraint has been ignored? I am sure it would fail on validation, but I thought that it will be considered even for adding data to the table.

    -Are there a way to update the original Version of the database every time that the page is opened or refreshed?

    -Drag and drop operation Execute like button on your page (or call vo.executeQuery () by program)

    -Drag and drop the operation of posting as a button on your page (or invoke it by programming on the DBTransaction object)

    -ignored for what values? for null values? It is expected, because each null is "unique."

    -Yes, but you probably shouldn't do that for performance reasons, see this: Andrejus Baranovskis Blog: Cache results for ADF iterator property

    Read also this: Andrejus Baranovskis Blog: job ADF and PL/SQL Invocation changes side effect

    Dario

  • Using a stored procedure with the DBUM connector

    Hello, I am a new to the Oracle Identity Manager. The system that I am running on is Windows Server 2008. I recently installed the version 11.1.1.3.0 from the Identity and Access Management suite, as well as the appropriate components. I use a database of 11 g R2 as my deposit. I installed the DBUM connector and have successfully provided a user to my database (which is also an Oracle database).

    However, I have an instance where I need to provide not only a database user account, but also this user and password (after the execution of some arbitrary for her, as features by adding a 1 or chop) at a table in the same database.

    Could someone give me please a detailed description of what I need to do to achieve and possibly point me in the direction of certain documents? I greatly appreciate it.

    You can write your own custom code to execute a stored procedure. Here is the documentation for it: http://download.oracle.com/javase/tutorial/jdbc/basics/storedprocedures.html

    Create your code and deploy your jar file in the folder xellerate/JavaTasks. Create an adapter to use the code. Then on your commissioning process definition, create a new task and plug in the adapter. Finally, start the task of the user to create the task.

    -Kevin

  • Create or replace Stored procedure

    Hi all

    11.2.0.1

    I have the HR schema/user, who is the owner of all tables in the app.

    Then, all his paintings are also granted to BATCH - HR user with corresponding synonyms.

    This batch user will be used by computer operators to run reports of generations.

    For security reasons, they are not allowed to CONNECT to HR, but only to the BATCH - RH.

    My question is, can I create a stored procedure to the BATCH - RH which has only synonymous all tables?

    Or is it a good design to install it on human resources?

    Stored procedures recommend to operate only on base tables?

    Thank you

    Petra k.

    You can use everywhere in PL/SQL or external programs, because synonym is nothing more than a name new/more existing object; i.e. scott.emp table can have synonym1, synonym2, synonym3, etc.

    For more information: CREATE SYNONYM

    Concerning

    Girish Sharma

  • Using the stored procedure

    We use the procedure attached to within an ASP application obfuscation of the password database. I am able to use the same procedure in CF without modification? Right now, I have tried with cfstoredproc but'm "Procedure 'dt_External_Encrypt' expects parameter '@Encrypted', which was not supplied."



    You do not use the ODBC driver.

    Most likely, there is a typing error in the code or the stored procedure is not also displayed (or a copy).

    Change procedure = "dt_External_Encrypt" to procedure = "dbo.dt_External_Encrypt" "

    Open Query Analyzer, 'Edit' code stored procedure and make sure that it is really such displayed.

    Finally, try changing returnCode 'no '.

    If all else fails, join the code exact CF code and code from Query Analyzer.

  • Problem to INSERT INTO using the stored procedure in 10g

    I use a 10g R2 database.

    I created two tables as follows:
    SQL > create table t1 (c1 varchar2 (1), number (1) c2, c3 number (1);)
    SQL > create table t2 (deptid varchar2 (4), empid varchar (4), varchar2 (1) c1, c2 number (1) c3 number (1);)

    insert into t1 values ('A', 3, 5);
    insert into t1 values ('B', 5, 5);
    insert into t1 values ('C', 5, 5);

    I want to create a stored procedure to insert data into table t1 t2 and certain parameters of the procedure.
    Is this possible?
    As an example:
    SQL > execute test (1,2)

    This procedure will be insert these two parameters in table t2 AND select rows in table t1 and insert into table t2 at the same time.
    How can I write the procedure?
    Tip:
    SQL > create or replace procedure
    (v_deptid, v_empid number)
    is
    BEGIN
    Insert into t2 (deptid, empid, c1, c2, c3)
    ... Select c1, c2, c3 from t1;
    end;

    My question is: How can I insert the v_deptid and v_empid parameters at the same time?

    Try

    SQL > create or replace procedure
    (v_deptid, v_empid number)
    is
    BEGIN
    Insert into t2 (deptid, empid, c1, c2, c3)
    Select v_deptid, v_empid, c1, c2, c3 to t1;
    end;

  • selection of lines by using the stored procedure

    All the

    At the risk of asking something obvious, I would like to know if it is possible to wrap a selection within a stored procedure.

    Create the abc as procedure

    Start

    date of b;

    Select sysdate into double b;

    end;

    /

    Question: I have a select complex which should be called from JAVA. I don't want to create a VIEW since at the request of the view, indeed I will do so: SELECT * FROM (my original query) which leads to performance.

    I would like to be able to:

    exec has;

    This should give me the result of

    SELECT

    x, z, c

    Of

    one

    ;

    How can I make this possible a stored procedure?

    Thank you

    Well, yes there are ways to do it, but first of all, you are mistaken in thinking that select * from , would lead to a performance overhead.  The optimizer based on CSSTidy will optimize the request to provide results without worrying so there is no noticeable performance difference.

    Java, you probably want to use a ref cursor and get java to retrieve the results back.

    Example of refcursor function (demonstrated SQL * more I don't have Java)...

    SQL > create or replace function test RETURN as sys_refcursor
    cur_o 2 sys_refcursor;
    3. start
    4. open cur_o to select empno, ename from emp;
    5 return cur_o;
    6 end;
    7.

    The function is created.

    SQL > var r refcursor;
    SQL > exec: r: = test();

    PL/SQL procedure successfully completed.

    SQL > print r;

    EMPNO, ENAME
    ---------- ----------
    7369 SMITH
    7499 ALLEN
    7521 WARD
    7566 JONES
    7654 MARTIN
    7698 BLAKE
    7782 CLARK
    7788 SCOTT
    KING 7839
    7844 TURNER
    7876 ADAMS
    JAMES 7900
    7902 FORD
    7934 MILLER

    14 selected lines.

  • would you use a stored procedure or a function

    Hello

    I have a very long query. I reduced a large number of sections of it with views.

    But now I have a section that is repeated several times, about 40 times. It is about 15 lines of SQL code.

    The variation between these blocks are two fields which change their value and I always join the result of these blocks using the same ID.

    Of course, I think I can extract in a central block (DRY) and call them from a main request, the question is how.

    My first approach would be a stored procedure. But all the examples I found that you use some PL/SQL or Java, that I could also... but isn't it overkill?
    The function?
    Any recommendation?

    Thank you!

    refer wrote:
    who would do it, I guess that
    now the newbie question: in the function block: how to assign select va1 and va2 from a query results in the attributes of the object? I couldn't find an example where this is demonstrated (if possible).

    I should have simplified:

    create or replace function ma_fonction (a number, b varchar2) return my_type
    as
    my_type my_obj;
    Start
    -here:
    Select val1, val2 from table1 - is always only one line
    -my_obj: = my_type (a, b); -How can I assign those here?
    Return my_obj;
    end
    ;

    select my_type(val1,val2) into my_obj
    from table1;
    

    Published by: Toon Koppelaars on February 24, 2011 10:16

  • Problem: Not sufficient privileges execution of stored procedure in a package

    I am using Visual Studio 2008 Team Suite, ODT with ODAC 111.07.20 and I am trying to run a procedure stored within a packet, it displays the following error message:

    Oracle.DataAccess.Client.OracleException: ORA-01031: insufficient privileges
    ORA-06512: at & quot; KIKO. PACK_SP & quot; line 205
    ORA-06512: at line 1
    at Oracle.DataAccess.Client.OracleException.HandleErrorHelper (Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx * pOpoSqlValCtx, ByVal src, String, Boolean Bcheck procedure)
    at Oracle.DataAccess.Client.OracleException.HandleError (Int32 errCode, OracleConnection conn, String procedure, IntPtr opsErrCtx, OpoSqlValCtx * pOpoSqlValCtx, ByVal src, Boolean Bcheck)
    at Oracle.DataAccess.Client.OracleCommand.ExecuteNonQuery)
    at SqlOracleWebService.OracleReplicationTool.GetData (String strNameServer, String strNameDatabase, String strNameTable, String strNameStoreProcedure, String strUserId, String strPassword, intSince, intUntil, Int32 intPort, string strID Int64 Int64) in C:\Documents and Settings\kiko\Desktop\kiko\SQL-ORACLE\SqlOracleWebService\SqlOracleWebService\Oracle\OracleReplicationTool.vb:line 1171
    at SqlOracleWebService.OracleReplicationTool.SmallDataInit (String strNameServerSource, String strNameDatabaseSource, String strNameServerDestiny, String strNameDatabaseDestiny, String strNameTable, String strUserIdSource, String strPasswordSource, String strUserIdDestiny, String strPasswordDestiny, Int32 intPortSource, Int32 intPortDestiny) in C:\Documents and Settings\kiko\Desktop\kiko\SQL-ORACLE\SqlOracleWebService\SqlOracleWebService\Oracle\OracleReplicationTool.vb:line 614
    at SqlOracleWebService.OracleReplicationTool.ReplicationDataInit (Boolean boolBothDirections, String strNameServerSource, String strNameDatabaseSource, String strNameServerDestiny, String strNameDatabaseDestiny, String strNameTable, String strUserIdSource, String strPasswordSource, String strUserIdDestiny, String strPasswordDestiny, Int32 intPortSource, Int32 intPortDestiny) in C:\Documents and Settings\kiko\Desktop\kiko\SQL-ORACLE\SqlOracleWebService\SqlOracleWebService\Oracle\OracleReplicationTool.vb:line 28
    at SqlOracleWebService.Service1.Oracle_ReplicationDataInit (Boolean boolBothDirections, String strNameServerSource, String strNameDatabaseSource, String strNameServerDestiny, String strNameDatabaseDestiny, String strNameTable, String strUserIdSource, String strPasswordSource, String strUserIdDestiny, String strPasswordDestiny, Int32 intPortSource, Int32 intPortDestiny) in C:\Documents and Settings\kiko\Desktop\kiko\SQL-ORACLE\SqlOracleWebService\SqlOracleWebService\Service1.asmx.vb:line 20

    I have change the execute privileges and granted to the user KIKO execute the PACK_SP package, but it does not work. Could you help me?

    Thanks in advance.

    Published by: user9112176 on February 8, 2010 10:27

    This behavior is probably not related to the ODP and will happen when you run the same procedure as the same user of SQLPlus directly for example, so the PLSQL forum is probably a more appropriate place for assistance.

    What is 'KIKO. PACK_SP', line 205? Roles are disabled inside stored procedures, so you must have the permissions that are granted directly.

    It will be useful,
    Greg

  • How to use &amp; APP_ID. stored procedure to the inside.

    Hello, I created a stored procedure. I'm calling it my code in process. I want to use so many variables like page & APP_ID. I don't want to pass as an argument. Is it possible to use these variables without passing on the inside. ? (& page_id. and also an application of variable level)

    Any help is appreciated.

    Thank you.

    Dark Lord

    You can use the function 'v' to reference the APEX elements in pl/sql. Then APP_ID is done refers to

    v ('APP_ID')

    CITY

  • use the stored procedure VARIABLE in an ODI procedure

    Hello

    I have a stored procedure that takes custId as an input parameter and returns the age as output parameter.

    custId is a varaible ODI that we spend during execution.

    I want to insert the age value in a table.

    declare
    cust_age customer_details.age%type;
    Start
    FETCH_CUSTOMER_DATA(#Customer.CustomerID,cust_age);
    end;

    INSERT INTO CUSTOMER_AGE VALUES(#customerid,*cust_age*)

    Thank you.

    Hello

    Just use the insert in an ODI procedure in an anonymous pl/sql block.

    I mean:

    declare

    cust_age customer_details.age%type;

    Start

    FETCH_CUSTOMER_DATA(#Customer.CustomerID,cust_age);

    INSERT INTO CUSTOMER_AGE VALUES(#customerid,*cust_age*);

    end;

    Ok?

    Cezar Santos
    http://odiexperts.com

Maybe you are looking for