sqlplus run procedure + accepting + invites

Hi all

I am a little confused with the execution of a procedure.

Procedure synonymexistmgr

< pre >
CREATE OR REPLACE PROCEDURE synonymexistmgr
(tables_schema IN VARCHAR2)
AUTHID CURRENT_USER
AS
CURSOR tab_cur IS SELECT table_name FROM all_tables owner WHERE tables_schema AND table_name = not like '% MDRT ".
BEGIN
FOR x IN THE LOOP of tab_cur
RUN IMMEDIATELY CREATE OR REPLACE SYNONYM | x.table_name |' FOR ' | tables_schema |'. ' || x.table_name;
END LOOP;
END;
< / pre >

Want to run it as one accepts a tables_schema entry in sqlplus

* 01.sql*

< pre >
Journal of 01.Intro coil

ACCEPT the USER PROMPT "enter the value for the USER (for example USER_X/USER_Y):

Synonymmgr EXEC ('& user');

01 FAST is over.
< / pre >

When I run it through a command .bat,

< pre >
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production 64-bit
With the partitioning, Data Mining and Real Application Testing options

Enter the value for the USER (for example USER_X/USER_Y):
< / pre >
I typed in 'abc '.

and came with

< pre >
PL/SQL procedure successfully completed.
< / pre >

There is no user of this type in the form ABC, why was the PL? SQL executed successfully, how can I include a few checks and balances in the process?

Thank you very much in advance for your advice.

You must make all checks custome for yourself.

Here is an example of how you can make your check.

create or replace procedure synonymexistmgr
(
     tables_schema in varchar2
)
authid current_user
as
     invalid_user exception;
     lUser varchar2(100);
begin
     begin
          select username into lUser
            from all_users
           where username = upper(tables_schema);
     exception
          when no_data_found then
               raise invalid_user;
     end;

     for x in (
               select table_name
                 from all_tables
                where owner = upper(tables_schema)
                  and table_name not like 'MDRT%'
           )
     loop
          execute immediate 'create or replace synonym '||x.table_name||' for '||tables_schema||'.'||x.table_name;
     end loop;
exception
     when invalid_user then
          raise_application_error(-20001, 'The input user ' || tables_schema || ' does not exist.');
end;

Tags: Database

Similar Questions

  • Changed to an individual on behalf of the team.  Person by clicking on "Accept invite" in the invitation email is asked for the password to connect even if it is just to establish his account. Previous individual but with a different user account.

    Had an individual with the user ID account [email protected] (example)

    Converted to an account of the team because we need now of 2 users.

    Team has always has [email protected] as admin ID

    Under admin, sent guest 2 users.  One was the person who initially used under [email protected], but he sent a new email account for them.

    When he clicks the "ACCEPT INVITE" in the e-mail, he is prompted for credentials - auto the new adobe ID with the new email (which is good) but wants a password (which is bad because it has not yet been established).

    Eventual goal is to have an admin account Adobe ID [email protected] 2 user accounts and [email protected] and [email protected]

    It turns out that the e-mail address is already existed as an Adobe ID old back when he tried once a free trial.  We have all understood, thank you!

  • Updated part and notifications to accept invite

    I can't share or accept invitations to collaborate. Any ideas on what is the cause or how to solve?

    There was a problem with our backend.

    We have now fixed.

    You should now be able to accept sharing guest without any problem.

  • Player running and accepting its terms and conditions

    I downloaded and installed the reader, but cannot print PDF files because I have a message to the reader 'RUN' and accept the terms and conditions.

    However, after installation, there is not the possibility to accept the terms and conditions and before clicking 'INSTALL' message said that to install is to automatically accept the terms and conditions. How to stop this vicious circle?

    C/Program Files(x86) / Adobe / 11.0 / player

    Double-click the file Eula.exe

    Accept the agreement and you are on your way...

  • How to call a stored procedure accepts VARIABLE in run

    Hello

    CREATE OR REPLACE PROCEDURE getEmpName
    * (EMP_UNAME IN VARCHAR, EMP_PWD VARCHAR OUT) *.
    IS
    BEGIN
    SELECT PASS IN EMP_PWD
    USERS
    WHERE NAME = EMP_UNAME;
    END;

    How call this stored using the execute procedure, I tried to run getEmpName('Sai'); and I myself
    ERROR on line 1:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in the call to 'GETEMPNAME '.
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored

    The Sybrand & Tyro two examples show the declaration of the variable, i.e.

    SQL> variable ename varchar2(100);
    

    You must do it before SQL * Plus could know how to solve: ename in your call.

    Justin

  • Cannot access on the Board of the company; access denied and already accepted invitation messages

    Received an invitation for Enterprise Dashboard. He accepted and following the procedures outlined. Now, I get "access denied" errors Read the other discussions in the forum about it but can't find a solution. When I try to accept the invitation again, its said to another user agreed. Any ideas on how I can fix this and connect to Enterprise Dashboard? Thank you in advance. (Federal official stuck using the Explorer 11)

    Looks that you have been invited as an end user rather than as an admin, in which case you don't need to log on the dashboard (this is only for admins). To use the right software connect when prompted.

  • Debug/run procedures within the package

    Debugging with SQL Developer was generally very nice and I have come to rely on these tools. Today, I've written a procedure in a package and I want to debug this process, but I don't see it in the list of targets. It seems that I see only functions in the target list. I understand that the procedures need not have the same kind of output in function, but sometimes I like to create procedures that have multiple SETTINGS, especially when it comes to an exit very closely related.

    The interesting thing is that I can create this same procedure as a stand-alone procedure and the run/debug works great. Apparently I'm missing something obvious in SQL Developer somewhere I thought it was there all the time (I guess for a while since I've written a procedure with OUT parameters) but maybe I'm wrong. Any ideas or help someone?

    Earl

    It should work.

    Is that you can create a package of simple heel with just a function procedure that is a NULL; and use it as a test?

    If this does not work there either, please send a screenshot so we can see what you see in the debugging with the missing procedure dialog box.

  • Cannot convert the accepted invitation

    We have a user who sent us in the invite to his Illustrator CC license. She has installed software, 35 days ago. Today, she receives a message that his trial has expired. On the administrative console, it seems that she never accepted the invitation. I cancelled the invitation and sent the invite, accessed his computer remotely, and click on the button of invitation accept myself. It allows me to connect as, she says, but there is no license associated with its identification code Adobe she has only 1 Adobe ID.

    Please check these:'

    I'm unable to accept an invitation from the creative team Cloud.

    Creative cloud for teams Invitation has not received

    He is mentioned in cannot accept the invitation of the CC team , you need to contact the support team too, CC help | Creative cloud for teams

    Concerning

    Stéphane

  • Already accepted invitation

    I am trying to accept the invitation of my administrator to join a creative team of cloud, but she came back with an error message "The Invitation already accepted" and the wont let me to go further. When I connect to my Adobe account, I have the creative team of visible cloud, but no product available. Someone can help me with this, or do I need to get my administrator to solve this problem?

    Hi Sebastian,.

    I just checked your account details and the cloud of Adobe Creative team is active in your Adobe ID

    Please download and install Adobe Creative Cloud apps and start using them.

    In case you get an error of the trial, please see the help below document:

    Applications creative Cloud back in test mode after an update until 2015 for CC

    Kind regards

    Sheena

  • R4 problem EA - Run procedure - input VARCHAR2 default setting

    The "Run" function (from the context menu or the green icon at the top of the code editor) for autonomous procedures has been improved to know and use the default values. Thank you.

    When using the default VARCHAR2 values, he locks the values double apostrophes that generates an error.


    Here are the PL/SQL block that is generated for a procedure:

    DECLARE

    PI_COMP_NAME VARCHAR2 (200);

    DATE OF PI_START_DATE;

    DATE OF PI_END_DATE;

    PI_RUN_EXTRACT BOOLEAN;

    PI_RUN_LOAD BOOLEAN;

    PI_TRUNCATE_TABLE BOOLEAN;

    NUMBER OF PI_BATCH_SIZE;

    NUMBER OF PI_PARALLEL_LEVEL;

    BEGIN

    PI_COMP_NAME: = " " "HPCCM""";

    PI_START_DATE: = NULL;

    PI_END_DATE: = NULL;

    PI_RUN_EXTRACT: = TRUE;

    PI_RUN_LOAD: = TRUE;

    PI_TRUNCATE_TABLE: = FALSE;

    PI_BATCH_SIZE: = 500000;

    PI_PARALLEL_LEVEL: = 2;

    () ADHOC_LOAD_USER_RFC_BRIDGE

    PI_COMP_NAME = > PI_COMP_NAME,

    PI_START_DATE = > PI_START_DATE,

    PI_END_DATE = > PI_END_DATE,

    PI_RUN_EXTRACT = > PI_RUN_EXTRACT,

    PI_RUN_LOAD = > PI_RUN_LOAD,

    PI_TRUNCATE_TABLE = > PI_TRUNCATE_TABLE,

    PI_BATCH_SIZE = > PI_BATCH_SIZE,

    PI_PARALLEL_LEVEL = > PI_PARALLEL_LEVEL

    );

    -restoration;

    END;


    Attempt to run this code resulted in the following error:

    ORA-06550: line 11, column 21:

    PLS-00103: encountered the symbol "HPCCM" when waiting for one of the following values: * & = +; /. is rest mod...

    replace the single quotes duplicated with active single quotes the code runs successfully.





    Reproduced, bugged, fixed for ai2.

  • Problem running procedure using Variables

    Hi all

    I am trying to execute the procedure in a statement declared/Begin/End and using variables as parameters of entry in my interior but I get away to an invalid SQL statement error. My code is below:
    declare
    
      START_dt  VARCHAR2(30);
      END_DT VARCHAR2(30);
      
         
      begin
            
        SELECT '01-APR-2011'
        INTO END_DT
        FROM DUAL;
      
        SELECT '01-APR-2020'
        INTO END_DT
        FROM DUAL;
             
           
         BEGIN EXECUTE IMMEDIATE 'INSERT_PROV_ACSC_IND_REF('||START_dt||','||END_DT||')';END;COMMIT;
    
     end;
    
    Error at line 1
    ORA-00900: invalid SQL statement
    ORA-06512: at line 18
    Is the way that I normally run my procedure outside this statement Declare/Begin/End: EXECUTE INSERT_PROV_ACSC_IND_REF('01-APR-2011','01-APR-2020');

    The table that takes the data from the procedure does not correct timestamp but my procedure takes the varchar above dates and turns them into dates in the procedure so that the entry date settings are left as a string.

    Any help would be appreciated.

    Thank you

    And if you want to use variables:

    declare
        START_dt  VARCHAR2(30);
        END_DT VARCHAR2(30);
    begin
        START_dt := DATE '2011-04-01';
        END_DT := DATE '2011-04-01';
        INSERT_PROV_ACSC_IND_REF(START_dt,END_DT);
    end;
    /
    

    SY.

  • We cannot accept invitation

    I sent an invitation to creative clouds for the teams, but the recipient cannot accept it, what can I do?

    Go to the creative forum Cloud.

    See the article: http://helpx.adobe.com/creative-cloud/help/manage-creative-cloud-teams-membership.html and try another browser.

    Kind regards

    Romit Sinha

  • Help run procedure

    OK, so embarrassing enough, I've never had to perform the procedure.

    I need perform this procedure, and I don't really know how the syntax will be.

    Code of procedure...

    PROCEDURE Rollover_Tables

    -Controls the creation of new nrn_sites, nrn_strata, nrn_use_levels records.

    - and nrn_sampleyears save for a new cycle. Return value is to be

    -"SUCCESS" or "ERROR: msg > '"

    (p_forest IN nrn_sites.aforest_code%type

    p_from_round IN nrn_sites.round%type

    p_to_round IN nrn_sites.round%type

    p_fiscal_yr_todo IN varchar2

    p_return OUT varchar2) IS

    v_return varchar2 (300);

    number of v_count;

    BEGIN

    IF p_forest is null or

    p_from_round is null or

    p_to_round is null or

    p_fiscal_yr_todo is null

    THEN

    p_return: = ' ERROR: one or more input parameters is null';

    ON THE OTHER

    -ensure that the forest is active

    Select count (1)

    in v_count

    of nrn_adminforests

    where aforest_code = p_forest

    and in_use = 'Y ';

    IF v_count = 1

    THEN

    Rollover_Sites_and_Strata (p_forest

    p_from_round

    p_to_round

    p_fiscal_yr_todo

    v_return);

    IF v_return <>'SUCCESS'

    THEN

    p_return: = v_return;

    ON THE OTHER

    Rollover_Use_Levels (p_forest

    p_from_round

    p_to_round);

    p_return: = 'SUCCESS';

    COMMIT;

    END IF;

    ON THE OTHER

    p_return: = ' ERROR: this forest is inactive, it cannot be reversed ";

    END IF;

    END IF;

    END Rollover_Tables;

    I understand that there was once a variable input... but still, I don't know how to write sql or pl/sql.

    I need:

    p_forest = A01117

    p_from_round = 3

    p_to_round = 4

    p_fiscal_year = 2013

    Thank you.

    Read the documentation. You can not survive without knowledge. You can start here http://docs.oracle.com/cd/E11882_01/appdev.112/e25519/subprograms.htm#LNPLS008

    DECLARE

    v_return varchar2;

    BEGIN

    Rollover_Tables ('A01117'

    3

    4

    2013

    v_return);

    dbms_output.put_line (v_return);

    END;

  • run a procedure for the period

    Hi all

    my need is to perform the procedure with an input parameter (date), for example
    exec ZOO.PKG_Z60over.prepare(date '2012-01-27')
    (1) this procedure accepts only 1 date, but I need to period, for example
    exec ZOO.PKG_Z60over.prepare(date '2012-01-27');
    exec ZOO.PKG_Z60over.prepare(date '2012-01-28');
    exec ZOO.PKG_Z60over.prepare(date '2012-01-29');
    (2) my dates are stored in the table calendar1, I would choose table instead of typing dates

    (3) how can I run without 'exec '?


    Thanks in advance.

    Marco wrote:
    Hi all

    my need is to perform the procedure with an input parameter (date), for example

    exec ZOO.PKG_Z60over.prepare(date '2012-01-27')
    

    (1) this procedure accepts only 1 date, but I need to period, for example

    exec ZOO.PKG_Z60over.prepare(date '2012-01-27');
    exec ZOO.PKG_Z60over.prepare(date '2012-01-28');
    exec ZOO.PKG_Z60over.prepare(date '2012-01-29');
    

    (2) my dates are stored in the table calendar1, I would choose table instead of typing dates

    (3) how can I run without 'exec '?

    Thanks in advance.

    You can write a PL/SQL block like this where you query the table calendar and loop through it and call the procedure for each line.

    begin
      for i in (select  from calender1)
      loop
        ZOO.PKG_Z60over.prepare(i.);
      end loop;
    end;
    /
    
  • Alarm procedure runs at startup

    Hello

    I created an alarm that monitors a calculated channel. The upper limit of the alarms is 5. There is no lower limit. If the alarm procedure is called that sets a flag. It works very well. But if I deploy the project the flag is already set at the opening of the workspace, even if the condition is not reached. It seems that the procedure is called on startup. This isn't my start-up procedure. In my startup procedure, the indicator is reset to 0.

    I read: unexpected running procedures

    and my startup procedure is now an end stage, but the situation has not changed.

    I use VS 2011.

    Frank

    Your installer works great, I use a PC host.

    I started to remove my installation so you sent it when all of a sudden, it worked. The problem is related to my calculated channel.

    This is the formula: abs ([Variable 0] - [Variable 1]) Variable 0 from a simulation model and variable 1 is a channel of the user.

    It seems to me like a timing problem of a certain type (model value init not ready or false).

    My solution is to set the initial state of the alarm for disabled and wait a bit before I turn it in my startup routine. For now it works.

    Thank you very much for your help!

Maybe you are looking for

  • Startup of the home pages are replaced. replaces the custom settings

    I am running FF 6.0.2 on Windows XP Professional Service Pack 3 on a network, but FF is installed on my local machine. I put my pages from start-up to Yahoo and Google News, but FF crushes my settings. Whenever I have reset my preferences and start t

  • Pavilion HPE 180 t, added third HD on Bay 4 in 5.25 SATA but win7 sees it as a DVD.

    I added the third hard drive to my Pavilion HPE 180 t on 3 SATA 5.25 Bay but win7 sees it as a DVD.  How can I do recognize this feature added as a third hard drive?  I have two HD in the bays of HD SATA 1 and 2 for RAID 0. Thanks for anyone who can

  • information masking

    I have a general question that does not appear in a search. I want to put in place of information hiding for some of my VI. LabVIEW seems do with refnums. For drivers, as I write, I need to keep the State. Easy to do with Clusters. However, I would l

  • imitate running a script to run Labview tera - serial communication

    Hi I have an anemometer which I am trying to communicate with via the serial interface. I am connected via a USB converter to 485. The manufacturer of the anemometer provided two scripts of term tera to communicate with the device. When I run scripts

  • WGA genuine notification at Service Pack 3 is not complete.

    Remember - this is a public forum so never post private information such as numbers of mail or telephone! Ideas: I've used windows service pack 3 for my windows xp professional. When she fills the download and installation of finishing successfully,