Create or replace synonym ... how to execute the script.

I have the scripts that creates synonyms and i need to execute these scripts from SQL Plus.
I want to pass the &owner_user value as an argument, but the script still comes back and asking for the owner_name.
create or replace synonym V_REPORTS_USAGE for &owner_user..V_REPORTS_USAGE;
create or replace synonym V_STATION_USAGE for &owner_user..V_STATION_USAGE;
How do i execute these scripts.
Thanks
-Prasad

it is working for me.
Try to give user name and object name
SQL> select * from v$version
  2  ;
BANNER
Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
PL/SQL Release 9.2.0.4.0 - Production
CORE    9.2.0.3.0       Production
TNS for Solaris: Version 9.2.0.4.0 - Production
NLSRTL Version 9.2.0.4.0 - Production
SQL>
  1*  create or replace  synonym  emp_temp for &emp
SQL> /
Enter value for emp: xxxx.emp
old   1:  create or replace  synonym  emp_temp for &emp
new   1:  create or replace  synonym  emp_temp for xxxt.emp
Synonym created.
SQL>

Similar Messages

  • How to execute the parametered stored procedure in sql *plus ?

    how to execute the parametered stored procedure in sql *plus ?
    my storedprocedure format
    CREATE OR REPLACE PROCEDURE SMS_SELECTMPLOYEE
    (empDOB out date, empEmpName out varchar2)
    thanks & regards
    mk_mur

    Oh, sorry... making many reading-too-fast mistakes today...
    You can't declare date variables in SQL*Plus (seel help var), but you can cast to varchar2:
    TEST> CREATE OR REPLACE PROCEDURE SMS_SELECTMPLOYEE (empDOB out date, empEmpName out varchar2) IS
      2  d date := sysdate;
      3  e varchar2(10) := 'bob';
      4  begin
      5  empdob := d;
      6  empempname := e;
      7  end;
      8  /
    Procedure created.
    TEST> var d varchar2(30)
    TEST> var n varchar2(30)
    TEST> call  SMS_SELECTMPLOYEE(:d,:n);
    Call completed.
    TEST> print d n
    D
    11/07/06
    N
    bobYoann.

  • Create or Replace Synonym Strange Problem

    I need to have an ability for database users to update private synonyms from a procedure. Can anyone please provide some insight on the following code.
    This syntax works perfectly fine
    begin
    execute immediate 'CREATE or replace SYNONYM USER_A.TBL_A FOR MAIN_DB.TBL_B';
    end;
    But when I do this
    CREATE OR REPLACE PROCEDURE update_syn IS
    BEGIN
    execute immediate 'CREATE or replace SYNONYM USER_A.TBL_A FOR MAIN_DB.TBL_B';
    END update_syn;
    begin
    update_syn;
    end;
    I get a ORA-01031: insufficient privileges error

    hi
    i think this is the duplicate thread
    insufficient privileges
    Khurram Siddiqui
    [email protected]                                                                                                                                                                                                                                                                                                                                           

  • How to execute the content of varchar  variable like a simple query

    Hi everyone!
    I did a PL/SQL region in apex, in this region I did the query which is storaged in a variable; it was did it concatenate several times,
    in the procedure I have several sentences.
    I thought that the command 'execute immediate' would get a good result but it do not print the result.
    declare
    variable varchar2(1000);
    begin
    --sentences
    --execute inmmediate( variable );
    --return variable
    end;
    I only want to how to execute the content of varchar variable.
    For example, suppose that the result of this procedure is
    'SELECT SYSDATE FROM DUAL'
    How and what do I must do for this query execute like a normal query that is in apex?
    I expect your prompt reply.
    Thank you for your help.
    Best regards

    Let us say your table containing SQL is
    t_sql_table
    and has two columns
    primary_key
    and
    sql_query.
    You would need to do the following:
    1. Create a Report of type "Function returning SQL Query"
    2. Put the following there:
    DECLARE
       v_query   VARCHAR2 (4000);
    BEGIN
       SELECT sql_query
         INTO v_query
         FROM t_sql_table
        WHERE primary_key = 1;
       RETURN v_query;
    END;Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • How to execute the method of a class loaded

    Hi,
    I have to execute the method of com.common.helper.EANCRatingHelper" + version
    version may be 1,2, etc
    if version = 1 the class is com.common.helper.EANCRatingHelper1;
    Iam able to load the class using following code.But iam unable to execute the method of the above class
    Can anybody help me how to execute the method of the class loaded.
    Following is the code
    String version = getHelperClassVersion(requestDate);
    String helperClass = "com.redroller.common.carriers.eanc.helper.EANCRatingHelper" + version;
    Class eancRatingHelper = Class.forName(helperClass);
    eancRatingHelper.newInstance();
    eancRatingHelper.saveRating(); This is not executing throwing an error no method.
    Thanks

    eancRatingHelper.newInstance();Ok, that creates an instance, but you just threw it away. You need to save the return of that.
    Object helper = eancRatingHelper.newInstance();
    eancRatingHelper.saveRating(); This is not executing throwing an error no method.Of course. eancRatingHelper is a Class object, not an instance of your EANCRatingHelper object. The "helper" object I created above is (though it is only of type "Object" right now) -- you have to cast it to the desired class, and then call the method on that.
    Hopefully EANCRatingHelper1 and 2 share a common interface, or you're up the creek.

  • How to execute the transaction SCI

    Hi All,
    How to execute the transaction SCI
    Thank you,
    Sridhar.

    Hai ,
    there are two ways to use SCI , one is you open you code in se38 -->display mode --> Program >check>code inspector. here your program is executed with a dafault variant provided in SCI.
    Second method is go to SCI , create a inspection  an choose a variant , here system provide you with a wide range of program checks (security/syntax etc)
    For any further help.
    Do reply.
    Regards
    Jase

  • Workflow Questions - How to execute the steps in a workflow automatically?

    I am using MDM 5.5 SP6.
    My Question is how to execute the steps in the workflow automatically. That means NO user interaction.
    I have a simple workflow, Start- Process -- Syndicate -  Stop.
    When a new record added /updated/inserted this workflow will start automatically.  The workflow inbox, the workflow status is u2018Receivedu2019 Step is u2018Processu2019.  Now I have to right click on the record then u2018Next Stepu2019 then click on u2018Syndicateu2019 then workflow completes automatically.
    How to execute the Syndication step automatically?.  I donu2019t want to have any user interaction to syndicate these records.
    Is this possible?
    The reason for this is I want to do some field validation and based on the field validation some assignments then then I want  to syndicate these records without user interaction..

    Hi,
    If you want to do some validations and then based on result assignments on some of the fields before syndicating, then you have to use workflow. Only syndication server will not fulfill this requirement.
    you may try by making validation's automatic property as "Error". This way it will not allow to add any record not fulfilling validation. You can also try using calculated fields instead of assignment.
    I am not sure if you can make your workflow fully automatic, because atleast one process step is must for any workflow, and process step means user action.
    Regards,
    Shiv

  • How to execute the data in the form when the data is already avaliable

    Hi,
    I am working with forms 6i. I have a problem while executing the data in the form
    Actually, the data is already present in the form. But when i run the form, the data is not displayed.
    can anyone please help me how to execute the data. below is the code
    Set_Alert_Property(alert_id,ALERT_MESSAGE_TEXT,'Do you want to refresh new Data for that Year and Field ? (it will take a time).') ;
                   SET_ALERT_BUTTON_PROPERTY(alert_id, ALERT_BUTTON1, LABEL, 'Yes');
                   SET_ALERT_BUTTON_PROPERTY(alert_id, ALERT_BUTTON2, LABEL, 'No');
                   SET_ALERT_BUTTON_PROPERTY(alert_id, ALERT_BUTTON3, LABEL, 'Cancel');
                   button_number :=Show_Alert(alert_id) ;
                   synchronize;
                   if button_number != ALERT_BUTTON3 then
                        if button_number = ALERT_BUTTON1 then
                             :param.field := :control.f_cd;
                             :param.year := :control.year;
                             build_tables;
                             fields;
    -- areas(:param.field);
                             PUT_PARAM;
                             COMMIT_FORM;
                        go_block('wet_criterias');
                        end if;
                        if button_number = ALERT_BUTTON2 then
                             :exhibits.field_display := :control.f_name || ' - Exhibits';
                             go_block('RESERVOIR');
                             execute_query;
                        end if;
                   end if;
              end if;
    else
         message('Fields must be entered...');
    end if;
    else
    message('Fields must be entered...');
    end if;

    It's hard to know what logic you are trying to implement.
    However, by looking at your code, it seems that if the user select 'Yes' to the question "Do you want to refresh", nothing is done except the go_block('wet_criterias'). Should there be an 'Execute_Query' ?
    No idea...

  • How to execute the logical database.

    how to execute the logical database.

    There are two ways of using a logical database - either by linking it with the executable program(specify the LDB name in the program attributes) or by using the function module LDB_PROCESS.
    1.Data read by the logical database is passed back to the program using the interface work areas.Use GET statements in the report.
    GET events are implemented internally as FORM routines.
    2.If you call the logical database using the above function module, the selection screen of LDB is not displayed.It uses special subroutines called callback routines, which are called by the function module and filled with the required data.
    Please refer the following link for more details.
    http://help.sap.com/saphelp_nw70/helpdata/en/9f/db9b5e35c111d1829f0000e829fbfe/frameset.htm

  • How to execute the content of varchar as query

    Hi everyone!
    I did a PL/SQL region in apex, in this region I did the query which is storaged in a variable; it was did it concatenate several times,
    in the procedure I have several sentences.
    I thought that the command 'execute immediate' would get a good result but it do not print the result.
    declare
    variable varchar2(1000);
    begin
    --sentences
    --execute inmmediate( variable );
    --return variable
    end;
    I only want to how to execute the content of varchar variable.
    For example, suppose that the result of this procedure is
    'SELECT SYSDATE FROM DUAL'
    How and what do I must do for this query execute like a normal query that is in apex?
    I expect your prompt reply.
    Thank you for your help.
    Best regards

    Erik,
    Try dropping this into a PL/SQL region
    DECLARE
      v_result VARCHAR2(500);
    BEGIN
      SELECT SYSDATE
        INTO v_result
        FROM DUAL;
      htp.prn(v_result);
    END;
    {code}
    use the htp.prn command to write html you want to display. In this case we are just writing the date to the screen.
    Good luck,
    Tyson                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to execute SAPGUI script from the command line?

    I have created a script and would like to execute it from the command line. There must be some flag that goes with SAPGUI.EXE. Any help appreciated.
    Thanks,
    Jeff

    Hi Jeff,
    the best way to do this is to run the script using the Windows Script Host, for example like this:
    cscript myscript.vbs
    This will execute the script which in turn can access SAP GUI. You may however have to make sure the script attaches to the correct session.
    Best regards,
    Christian

  • How to execute the messages in status 'scheduled' automatically?

    Hi.
    I find some messages every day which have status 'scheduled' for a long time - more then several hours. These messages use http adapter. When http server is not working, the messages scheduled, but not executed after http server become working. How to execute the messages automatically?

    http://help.sap.com/saphelp_nw70/helpdata/en/96/8412417301ee6fe10000000a1550b0/content.htm
    Is yours a EOIO scenario?

  • How to Execute the row by row sql syntax

    Hello,
    when I execute the below I get the result as attached, how to execute the syntax in each row, Thanks for your help!
    select 'select * into TestSSRS.'+ Table_Name + ' from AdventureWorksDW2008R2.'+ Table_Name FROM [dbo].[Tables_To_Copy]

    Maybe you could store the value of that field in a string variable using a cursor, i expect you dont need to execute this query very often, because using cursor is not always the best option in data sets.
    Regards!
    Sergio Sánchez Arias
    Oaxaca,México
    AYÚDANOS A AYUDARTE

  • How to execute the FM K_COSTS_PLAN_INTERFACE_TOTAL with ranges

    Hi All,
    can anybody suggest me, how to execute the Function module K_COSTS_PLAN_INTERFACE_TOTAL with  range of Cost element(KSTAR)
    and what is the field for Cost Element TO
    The fm is for tcode KP06
    Edited by: Kachi Reddy on Feb 17, 2012 2:26 PM

    Hi, Kachi.
    Try this example:
    REPORT rkkipl1t.
    * The parameters are used to fill the internal table and describe the
    * planning object.
    PARAMETERS: p_kokrs LIKE tka01-kokrs  MEMORY ID cac  OBLIGATORY,
                p_perab LIKE cobk-perab   DEFAULT '001'  OBLIGATORY,
                p_perbi LIKE cobk-perbi   DEFAULT '012'  OBLIGATORY,
                p_gjahr LIKE cobk-gjahr   MEMORY ID gjr  OBLIGATORY,
                p_versn LIKE cobk-versn   MEMORY ID kvt  OBLIGATORY,
                p_kostl LIKE cssl-kostl                  OBLIGATORY,
                p_kstar LIKE cskb-kstar                  OBLIGATORY,
                p_vrgng LIKE cobk-vrgng   DEFAULT 'RKP1' OBLIGATORY,
                p_kwaer RADIOBUTTON GROUP ein DEFAULT 'X',
                p_owaer RADIOBUTTON GROUP ein,
                p_twaer RADIOBUTTON GROUP ein,
                p_waers LIKE coss-twaer.
    DATA: i_rku01_cur LIKE rku01_cur.
    * internal table for function
    DATA: itrku01g TYPE TABLE OF rku01g WITH HEADER LINE.
    REFRESH itrku01g.
    PERFORM fill_itrku01g.
    * Which currency is to be used?
    IF p_twaer = 'X'.
    *   planning in transaction currency
      i_rku01_cur-wtg_man = p_twaer.
      i_rku01_cur-wtf_man = p_twaer.
    ELSEIF p_owaer = 'X'.
    *   planning in object currency
      i_rku01_cur-wog_man = p_owaer.
      i_rku01_cur-wof_man = p_owaer.
    ELSE.
    *   planning in controlling area currency
      i_rku01_cur-wkg_man = 'X'.
      i_rku01_cur-wkf_man = 'X'.
    ENDIF.
    CALL FUNCTION 'K_COSTS_PLAN_INTERFACE_TOTAL'
      EXPORTING
    *    BLTXT                  = ' '
    *    COMMIT                 = 'X'
    *    DELTA                  = ' '
        gjahr                  = p_gjahr
        kokrs                  = p_kokrs
        messages_show          = 'X'
        perab                  = p_perab
        perbi                  = p_perbi
        update_values          = 'X'
        versn                  = p_versn
        vrgng                  = p_vrgng
    *    ONLINE_VB              = ' '
        irku01_cur             = i_rku01_cur
    *    TESTMODE               = ' '
    *    KEEP_TWAER             = ' '
      TABLES
        irku01g                = itrku01g
    EXCEPTIONS
       messages_occured       = 1
       OTHERS                 = 2
    IF sy-subrc = 0.
      MESSAGE s000(15).
    *   Verbuchung wurde erfolgreich durchgeführt
    ENDIF.
    *  FORM FILL_ITRKU01G
    FORM fill_itrku01g.
    * fill internal table for function
      CLEAR itrku01g.
      itrku01g-kostl    = p_kostl.              "for CCA planning
      itrku01g-kstar    = p_kstar.              "must be filled
      itrku01g-wtgbtr   = 12000.                "value when planning
      itrku01g-wkgbtr   = 12000.                "value when planning
      itrku01g-wogbtr   = 12000.                "value when planning
      itrku01g-twaer    = p_waers.              "transaction currency
      itrku01g-fcwkg    = '1'.           "distribution key must be filled
      itrku01g-fcwkf    = '1'.                  "must be filled
      itrku01g-fcwkv    = '1'.                  "must be filled
      itrku01g-fcmeg    = '1'.                  "must be filled
      itrku01g-fcmef    = '1'.                  "must be filled
      itrku01g-fcmev    = '1'.                  "must be filled
      APPEND itrku01g.
    ENDFORM. "FILL_ITRKU01G.
    Best regards,
    George Shlyahov.

  • How to execute the packaged procedure(having out param) in TOAD for Oracle

    Hi.
    Could you help me
    How to execute the packaged procedure having out parameters in TOAD for Oralce..
    Thanks..

    Use anonymous PL/SQL block to execute it.
    Example.
    DECLARE
      <out variable name> <out variable data type>;
    BEGIN
      <package name>.<procedure name>(<out variable name>);
    END;

Maybe you are looking for

  • Selecting one of multiple midi inputs in Garageband

    Hi, I've connected an M-Audio Midisport 4X4 to my powerbook G4 and am trying to control the synths in Reason Adapted at the same time as a synth in Garageband, in order to play them together. Does anyone know how to select the midi input in Garageban

  • Customizing Infoview Disable shortcut option in XI 3.0

    Hi, We need to disable the shortcut option ,When a report is selected in the public folder area of Infoview and the organize button is selected can the copy shortcut option be disabled ? or Can we disable the shortcut option when sending a report thr

  • Problem in Integration directory

    I created a new object in integration directory.There is an option called to transfer integration scenario from integration repository.But i am not able to do it because my scenario does not appear in the menu.I activated my namespace in Integration

  • How to set a context of "/" ??

    How can i set a context of either "" or "/" such that when i call the URL htpp://localhost:7001/ I go to the location specified for that context ? Is this possible ? Srini

  • Iphone not removing reoccuring Outlook Calender events! ARGH

    Help. I've been syncing my iphone with my Outlook 2003 calendar all the time for months. I had a couple of re-occuring events that happened every week, those events have since expired, but the iphone g3 still thinks they are there and beeps at the ev