Create a stored procedure to convert a temporary table to the current table

I have a table in oracle, named motor_assist2 with columns:
NAME
ADDRESS
PHONE
CITY
STATE
ZIP
FRIENDSHIP
SERVICE
WAIT_TIME
CONT_SERVICE
COMMENTS
DATETIME
TECHNICIAN1_RADIO
TECHNICIAN1_NAME
LOCATION
COUNTY_NAME
COUNTY_ABBR
MAV_TROOP
TECHNICIAN2_RADIO
TECHNICIAN2_NAME
ID
BEG_DATE
END_DATE
MONTH
YEAR

I have an another table (motor_assist9) in excel with similar columns I want to insert this data into my table (motor_assist2) current using a procedure but do not know how to do it. Can someone help me? Thank you

Deanna

If the number of columns and the order of the columns match on both tables, you can use:

insert into motor_assist2 select * from motor_assist9;

If this isn't the case, you will need to specify which columns of the source and/or destination:

insert into motor_assist2 (destination, column, list)
       select source, column, list from motor_assist9;

To make a wrap just stored as appropriate procedure insert the statement with the following code:

create or replace procedure procedure_name as
begin
  
end;
/

Tags: Database

Similar Questions

  • How to create a stored procedure to delete and create table

    Version: Oracle 10g

    I am trying to create a stored procedure that is delete it and create a table based on a select statement. I can create the table, but I can't let it go.

    CREATE or REPLACE procedure EC_LOAD is
    Start
    INSERT INTO Sales_table
    (FSCL_WK,
    DIV,
    ACCT_TYPE)
    Select
    FSCL_WK,
    DIV,
    ACCT_TYPE
    Of
    sales_revenue;
    end ecload;

    I need to drop the Sales_table before inserting the values. How can I do this?

    user610131 wrote:

    I need to drop the Sales_table before inserting the values. How can I do this?

    If you drop off where you insert it :)? Do you mean DELETE or TRUNCATE?

    If table can be truncated (and don't forget TRUNCATE is DDL then he will commit):

    CREATE OR REPLACE procedure EC_LOAD is
    begin
    EXECUTE IMMEDIATE 'TRUNCATE TABLE Sales_table';
    INSERT INTO Sales_table
    (FSCL_WK,
    DIV,
    ACCT_TYPE)
    Select
    FSCL_WK,
    DIV,
    ACCT_TYPE
    from
    sales_revenue;
    end ecload;
    

    Otherwise, use DELETE:

    CREATE OR REPLACE procedure EC_LOAD is
    begin
    DELETE Sales_table;
    INSERT INTO Sales_table
    (FSCL_WK,
    DIV,
    ACCT_TYPE)
    Select
    FSCL_WK,
    DIV,
    ACCT_TYPE
    from
    sales_revenue;
    end ecload;
    

    SY.

  • Stored procedure to compare two data tables

    Hello

    I want to have a stored procedure that will compare two tables data (only one column) and remove the line that is not present in the second table.

    For example.,.
    I have 2 tables called Table1 and Table2, that have the same column called ID (PK).
    Data in Table1 are 1,2,3 and data into Table2 are 1.3. When the stored procedure is running, it must compare the ID column in Table1 to ID column in Table2 and since '2' is not there in Table2, I want to remove this line from Table1.

    Thanks in advance.

    delete from table1
    where does not exist (select 1 from table2 where table2.id = table1.my_field)
    ;

  • How to create a disc of forgotten password if you must have the current password?

    It makes no sense at all.  How to create a disc of forgotten password if you must have the current password?  It works only if you have created this from the beginning? Thank you

    Original title: Assistant password

    "How to enable or disable the built-in high administrator in Windows 7 account '

    http://www.SevenForums.com/tutorials/507-built-administrator-account-enable-disable.html

    'Activate the administrator account (hidden) on Windows 7, 8, or Vistone '

    http://www.howtogeek.com/HOWTO/Windows-Vista/enable-the-hidden-administrator-account-on-Windows-Vista/

    See you soon.

  • Create a stored procedure in the settings view

    I want to be able to create a view with the parameters of a stored procedure.

    Oracle 11g.

    don't know how to use the variable in immediate execution.

    CREATE OR REPLACE

    PROCEDURE TEST_GENERIC (TBL IN VARCHAR2, VWNAME IN VARCHAR2)

    AS

    BEGIN

    RUN IMMEDIATELY "CREATE OR REPLACE VIEW VWNAME AS SELECT SYSDATE FROM TBL";

    COMMIT;

    END;

    exec ('BIRD', 'DUAL') TEST_GENERIC

    Thanks for any help

    Hello

    Single quotes enclose a literal string; in other words, the text between the quotes literally means what it says, without reference to any variables.

    So, when you say:

    RUN IMMEDIATELY "CREATE OR REPLACE VIEW VWNAME AS SELECT SYSDATE FROM TBL";

    CREATE the word literally means to CREATE.  You may or may not have also a variable called CREATE, but that is irrelevant.

    The word OR means OR literally.  You may or may not have also a variable called operation GOLD, but that is irrelevant.

    REPLACE the word literally means REPLACE.  You may or may not have also a variable called to REPLACE, but that is irrelevant.

    ...

    The TBL Word literally means TBL.  You may or may not have also a variable called TBL, but that is irrelevant.

    If you want to reference a variable called TBL, then use TBL outside single quotes, like this:

    ...

    sql_text: = "CREATE or REPLACE VIEW VWNAME AS SELECT SYSDATE FROM '

    ||  TBL;

    dbms_output.put_line (sql_text |) "= sql_text before EXECUTE IMMEDIATE');   -For debugging

    EXECUTE IMMEDIATE sql_text.

    ...

    On the rare occasions when you use dynamic SQL statements, always put the dynamic SQL statement in a string variable (for example, sql_text, above) so that you can easily display for debugging purposes and to ensure that the command you are viewing is the same exact command that you should run.

    I guess the code you posted is a first test version of something that will be much, much different when it is finished.  Creating objects from database (such as views) in PL/SQL is almost always a terrible idea, and it seems that opinion that this code is attempting to produce would be very useful, anyway.

  • Create a stored procedure

    This procedure works fine, but I want to make a stored procedure to schedule it to run over time. I'd appreciate any help?

    SET SERVEROUTPUT SIZE 1000000
    declare
    cursor obj_cursor (objname Varchar2) is
    Select object_name, object_type, owner
    from dba_objects
    where owner = 'ITA '.
    and object_type IN ('TABLE', 'SEE')
    and object_name like '% JOB_;

    cursor c_job_status is
    SELECT ownerid jobid, starttime, endtime
    OF ita.tpis32_job_status
    WHERE starttime < sysdate - 800
    AND num_lines > 10000000;
    WK_SQL VARCHAR2 (500);
    WK_JOBSTR VARCHAR2 (500);
    BEGIN
    for c_job loop c_job_status
    wk_jobstr: = 'JOB_ | c_job. JobID | '%';
    for wk_rec loop obj_cursor (wk_jobstr)
    If wk_rec.object_type = "TABLE" then
    wk_sql: = 'drop table' |' ITA.' | wk_rec.object_name | ';';
    dbms_output.put_line (wk_sql);
    end if;
    If wk_rec.object_type = "DISPLAY" then
    wk_sql: = 'drop view ' | wk_rec.object_name | ';';
    dbms_output.put_line (wk_sql);
    -Wk_sql EXECUTE IMMEDIATE.
    end if;
    end loop;
    end loop;
    end;
    I tried this, but it did work ' t:
    create or replace procedure delete_table is
    SET SERVEROUTPUT SIZE 1000000
    declare
    cursor obj_cursor (objname Varchar2) is
    Select object_name, object_type, owner
    from dba_objects
    where owner = 'ITA '.
    and object_type IN ('TABLE', 'SEE')
    and object_name like '% JOB_;

    cursor c_job_status is
    SELECT ownerid jobid, starttime, endtime
    OF ita.tpis32_job_status
    WHERE starttime < sysdate - 800
    AND num_lines > 10000000;
    WK_SQL VARCHAR2 (500);
    WK_JOBSTR VARCHAR2 (500);
    BEGIN
    for c_job loop c_job_status
    wk_jobstr: = 'JOB_ | c_job. JobID | '%';
    for wk_rec loop obj_cursor (wk_jobstr)
    If wk_rec.object_type = "TABLE" then
    wk_sql: = 'drop table' |' ITA.' | wk_rec.object_name | ';';
    dbms_output.put_line (wk_sql);
    end if;
    If wk_rec.object_type = "DISPLAY" then
    wk_sql: = 'drop view ' | wk_rec.object_name | ';';
    dbms_output.put_line (wk_sql);
    -Wk_sql EXECUTE IMMEDIATE.
    end if;
    end loop;
    end loop;
    end delete_table;
    create or replace procedure delete_table is
    cursor obj_cursor(objname Varchar2) is
    select object_name, object_type, owner
    from dba_objects
    where owner = 'ITA'
    and object_type IN ('TABLE', 'VIEW')
    and object_name like 'JOB_%';
    
    cursor c_job_status is
    SELECT jobid, ownerid, starttime, endtime
    FROM ita.tpis32_job_status
    WHERE starttime < sysdate - 800
    AND num_lines > 10000000;
    WK_SQL VARCHAR2(500);
    WK_JOBSTR VARCHAR2(500);
    BEGIN
    for c_job in c_job_status loop
    wk_jobstr := 'JOB_' ||c_job.jobid||'%';
    for wk_rec in obj_cursor(wk_jobstr) loop
    if wk_rec.object_type = 'TABLE' then
    wk_sql := 'drop table ' ||'ita.'|| wk_rec.object_name || ';';
    dbms_output.put_line(wk_sql);
    end if;
    if wk_rec.object_type = 'VIEW' then
    wk_sql := 'drop view ' || wk_rec.object_name || ';';
    dbms_output.put_line(wk_sql);
    --EXECUTE IMMEDIATE wk_sql;
    end if;
    end loop;
    end loop;
    end delete_table;
    
  • Create a stored procedure or trigger to set a column equal to the other

    Hey guys,.

    I have two columns in a table, and when A column is updated or inserted, I need the database to update automatically the B column (in the same table) is equal to that. I can't create a trigger AFTER INSERT or UPDATE, because it's the same table and it gives me the error of changing tables.

    Any help is appreciated.

    How did you define your trigger? It seems that you should just be able to do

    BEGIN
      :new.columnB := :new.columnA;
    END;
    

    I guess if you get an error table mutation that your trigger is trying to query the table. I do not see a need to query the table.

    Justin

  • using stored procedures - I can't seem to get the right settings

    I am wanting to use stored procedures to create variables of substitution use UC4 (Appworx). (the databases I use are 10g) To do this, I first need to run command line in PL/SQL procedures. I don't seem to be able to create the correct command. This is the part of the package that I want to call



    CREATE OR REPLACE
    PACKAGE BODY 'APPLICATION_PACKAGE' AS


    PROCEDURE GET_APP_PARAM (V_APP_PARAM_ID IN CCOK. CC_APP_PARAM_DETAIL. APP_PARAM_ID % TYPE,
    V_APP_PARAM_NAME IN CCOK. CC_APP_PARAM_DETAIL. APP_PARAM_NAME % TYPE,
    OUT NOCOPY CCOK V_APP_PARAM_VALUE. CC_APP_PARAM_DETAIL. APP_PARAM_VALUE % TYPE)


    AS


    BEGIN

    SELECT APP_PARAM_VALUE
    IN V_APP_PARAM_VALUE
    TO CCOK. CC_APP_PARAM_DETAIL
    WHERE APP_PARAM_ID = V_APP_PARAM_ID
    AND APP_PARAM_NAME = V_APP_PARAM_NAME;


    END;




    It's the exact command I use command line

    run application_package.get_app_param(1000,'RUN_TYPE')

    When I do this I get invalid statements expected but still tweaking doesn't fix it and does not give me a clear idea of what I need to do to fix it.
    I get this sort of thing


    SQL & gt; run ccok.application_package.get_app_param(1000,'run_type')
    BEGIN ccok.application_package.get_app_param(1000,'run_type'); END;


    *
    ERROR on line 1:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in the call to 'GET_APP_PARAM '.
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored



    SQL & gt; run ccok.application_package.get_app_param(1000,'run_type',:result)
    SP2-0552: Bind variable 'RESULT' undeclared.
    SQL & gt; run ccok.application_package.get_app_param('1000','run_type')
    BEGIN ccok.application_package.get_app_param('1000','run_type'); END;


    *
    ERROR on line 1:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in the call to 'GET_APP_PARAM '.
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored



    Any help will be appreciated with more recognition.

    It's interesting.

    Package specification has "GET_APP_PARAM" with 2 parameters.
    The package body has "GET_APP_PARAM" with 3 settings.

    I tested this out case in my db. Oracle balk when the package body is compiled, but shows no errors.

    test@ORA10G> --
    test@ORA10G> DROP PACKAGE "APPLICATION_PACKAGE";
    
    Package dropped.
    
    test@ORA10G>
    test@ORA10G> drop table cc_app_param_detail;
    
    Table dropped.
    
    test@ORA10G> create table cc_app_param_detail (
      2    app_param_id    number(4),
      3    app_param_name  varchar2(20),
      4    app_param_value varchar2(20));
    
    Table created.
    
    test@ORA10G>
    test@ORA10G> insert into cc_app_param_detail
      2  select 1, 'name_1', 'value_1' from dual union all
      3  select 2, 'name_2', 'value_2' from dual union all
      4  select 3, 'name_3', 'value_3' from dual;
    
    3 rows created.
    
    test@ORA10G> commit;
    
    Commit complete.
    
    test@ORA10G>
    test@ORA10G> select * from cc_app_param_detail;
    
    APP_PARAM_ID APP_PARAM_NAME       APP_PARAM_VALUE
    ------------ -------------------- --------------------
               1 name_1               value_1
               2 name_2               value_2
               3 name_3               value_3
    
    test@ORA10G>
    test@ORA10G> --
    test@ORA10G> CREATE OR REPLACE PACKAGE "APPLICATION_PACKAGE" AS
      2    PROCEDURE GET_APP_PARAM (
      3      V_APP_PARAM_ID IN TEST.CC_APP_PARAM_DETAIL.APP_PARAM_ID%TYPE,
      4      V_APP_PARAM_NAME IN TEST.CC_APP_PARAM_DETAIL.APP_PARAM_NAME%TYPE);
      5  --    V_APP_PARAM_VALUE OUT NOCOPY TEST.CC_APP_PARAM_DETAIL.APP_PARAM_VALUE%TYPE);
      6  END;
      7  /
    
    Package created.
    
    test@ORA10G> show err
    No errors.
    test@ORA10G>
    test@ORA10G> DESC APPLICATION_PACKAGE
    PROCEDURE GET_APP_PARAM
     Argument Name                  Type                    In/Out Default?
     ------------------------------ ----------------------- ------ --------
     V_APP_PARAM_ID                 NUMBER(4)               IN
     V_APP_PARAM_NAME               VARCHAR2(20)            IN
    
    test@ORA10G>
    test@ORA10G>
    test@ORA10G> CREATE OR REPLACE PACKAGE BODY "APPLICATION_PACKAGE" AS
      2    PROCEDURE GET_APP_PARAM (
      3      V_APP_PARAM_ID    IN TEST.CC_APP_PARAM_DETAIL.APP_PARAM_ID%TYPE,
      4      V_APP_PARAM_NAME  IN TEST.CC_APP_PARAM_DETAIL.APP_PARAM_NAME%TYPE,
      5      V_APP_PARAM_VALUE OUT NOCOPY TEST.CC_APP_PARAM_DETAIL.APP_PARAM_VALUE%TYPE)
      6    AS
      7    BEGIN
      8      SELECT APP_PARAM_VALUE
      9      INTO V_APP_PARAM_VALUE
     10      FROM TEST.CC_APP_PARAM_DETAIL
     11      WHERE APP_PARAM_ID = V_APP_PARAM_ID
     12      AND APP_PARAM_NAME = V_APP_PARAM_NAME;
     13    END;
     14  END;
     15  /
    
    Warning: Package Body created with compilation errors.
    
    test@ORA10G> show err
    No errors.
    test@ORA10G>
    test@ORA10G>
    test@ORA10G> --
    test@ORA10G> var x varchar2(10)
    test@ORA10G> exec test.application_package.get_app_param(1,'name_1',:x);
    BEGIN test.application_package.get_app_param(1,'name_1',:x); END;
    
          *
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'GET_APP_PARAM'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    
    test@ORA10G> print x
    
    X
    --------------------------------
    
    test@ORA10G>
    test@ORA10G>
    test@ORA10G> select object_type, object_name, status from user_objects where object_name='APPLICATION_PACKAGE';
    
    OBJECT_TYPE         OBJECT_NAME                    STATUS
    ------------------- ------------------------------ -------
    PACKAGE             APPLICATION_PACKAGE            VALID
    PACKAGE BODY        APPLICATION_PACKAGE            INVALID
    
    test@ORA10G>
    test@ORA10G>
    

    What do you see as the State of the art and the body when he is interviewed command-line SQL * more?

    The solution would be to add the third parameter to the package specification and recompile.

    HTH,
    isotope

  • Handling exceptions in the stored procedure, loop IF... ON THE OTHER

    Hello guys,.
    We want to put in the exception handling in the loop, but get the following error:

    Error (43.3): PLS-00103: encountered the symbol "EXCEPTION" when expecting one of the following values: begin case declare end exit for goto rise back loop mod null pragma select update while < ID > < one between double quote delimited identifiers of > < a variable binding > < < close current delete fetch locking open insert commit rollback savepoint SQLExecute fusion forall hose set


    create or replace
    Xxxx PROCEDURE
    FOR IN MESSSY
    (
    Select i.
    FROM x I have

    )
    LOOP

    Upper IF (CODE) = 'n' THEN
    INSERT INTO T_MESS (MP)
    (
    Select I.MP_ID
    OF T_ME
    );
    Upper ELSIF (MESSSY.k2) = 'L' THEN
    DELETE T_MESS WHERE T_MESS. MP = MESSSY. MP;
    END IF;
    EXCEPTION
    WHEN DUP_VAL_ON_INDEX THEN
    A program attempted to insert duplicate values in a column that is constrained by a unique index.
    DBMS_OUTPUT. Put_line ("a program attempted to insert duplicate values in a column that is constrained by a unique index.")
    -No Rollback
    END;
    COMMIT;
    END LOOP;
    END xxxx;


    is - anyone know why?

    There are few changes needed in your code to compile successfully.

    Take a look at the following code. I pointed out the changes made by me with stars to compile successfully.

    I hope this helps.

    CREATE OR REPLACE PROCEDURE xxxx
    *as*
    *begin*
    FOR messsy IN (SELECT i.* FROM dual i) LOOP
      *begin*
       IF upper(CODE)='N' THEN
       INSERT INTO T_MESS(MP)
       (
       select I.MP_ID
       FROM T_ME
       );
       ELSIF upper(MESSSY.k2)='L' THEN
       DELETE T_MESS WHERE T_MESS.MP = MESSSY.MP;
       END IF;
    
       EXCEPTION
    
       WHEN DUP_VAL_ON_INDEX THEN
    
       A program attempted to insert duplicate values in a column that is constrained by a unique index.
       DBMS_OUTPUT.PUT_LINE ('A program attempted to insert duplicate values in a column that is constrained by a unique index.')
       --No Rollback
       END;
    
       COMMIT;
    END LOOP;
    END xxxx;
    
  • Call the stored procedure to support bean w / table setting dimensional bi

    Hi all, I use jdeveloper 11g

    I have a requirement where instead of calling several times a "insert into" statement rather call a stored procedure, a table shipping two-dimensional bi as a parameter.

    The table must have size [n] [4] and [0] [0] = string and others must have numbers.

    This is because users will be inserting thousands of records at a time, remote sites, so the load of sending of a should be avoided.

    Any suggestions?

    Thank you.

    Miguel,
    If you use ADFbc (VO and EO sense), you can use batch insert for this archive.
    However, he must think about the user interface and how to transfer data from the client to the server taking the place of the insert.

    How you accumulate the data to insert into the DB?
    Are able to collect you say 1000 records a time and transfer them in a single segment on the server?
    How about data validation and exception handling while inserting into the db?

    I'm sure you can use a pl/sql procedure to do the Insert, but the questions above should always be answered.

    Timo

  • Can someone create a program for me to tension and calclate to the current aid concert. I need a graphic Visual and some nuts for aesthetic purposes. PLS HELP

    Hey someone create a labview program that uses the current and voltage to find the resistance. I also need a chart and buttons for aesthetic purposes. PLS HELP A GAL!

    COME ON GUYS.  HELP A GAL JAVA!

    HERE YA GO, GAL.

  • 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;

  • MySQL temporary tables or call Stored procedures in CS4

    I need to filter the results by username before making a LEFT JOIN and including lines or IS NULL. The SQL works from the mysqli client, either by creating a temporary table using the "create a temporary table temp_appts select * from...» "Or by creating a stored procedure that contains the statement even 'create temporary table' and then running my LEFT JOIN statement against the temporary table.

    I've tried both in CS4, it accepts the code 'code' without errors but the page loads in a browser as a white or a 500 error in Internet Explorer. From my experience, this is caused by the exit before arriving to the html header.

    Is it possible to do either in CS4?  Here is the code I use.

    $varU_temp_appts = "-1";
    If (isset (<? php $_SESSION ['MM_Username'])) {}
    $varU_temp_appts = $_SESSION ['MM_Username"];
    }

    @mysql_select_db ($database_ess, $ess);
    $query_temp_appts = sprintf ("' CREATE TEMPORARY TABLE SELECT temp_appts * of appts WHERE username = %s", /GetSQLValueString($varU_temp_appts,"text") ");
    $temp_appts = mysql_query ($query_temp_appts, $ess) or die (mysql_error ());
    $row_temp_appts = mysql_fetch_assoc ($temp_appts);
    $totalRows_temp_appts = mysql_num_rows ($temp_appts);


    @mysql_select_db ($database_ess, $ess);
    $query_todays_appts = "SELECT * from appt_tm LEFT JOIN (temp_appts) ON appt_tm.appt_time = temp_appts.appt_hr WHERE (appt_date = CURDATE () OR appt_date IS NULL)";
    $todays_appts = mysql_query ($query_todays_appts, $ess) or die (mysql_error ());
    $row_todays_appts = mysql_fetch_assoc ($todays_appts);
    $totalRows_todays_appts = mysql_num_rows ($todays_appts);

    Any help is appreciated!

    Why not just use a derived table, rather than creating a temporary table?

  • 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

  • Creating views, dynamic SQL within stored procedure

    I'm having a problem with the creation of dynamic views of in a stored procedure. The following declare block works fine:

    DECLARE
    parameter i_nom_table varchar2 (200): = 'abc ';
    xyz cursor script, SELECT step
    STARTING from scripts
    WHERE table_name = i_nom_table parameter
    ORDER BY step CAD;
    l_sql scripts.script%TYPE;
    l_step scripts.step%TYPE;
    l_error VARCHAR2 (200);
    l_code VARCHAR2 (200);
    Start
    XYZ OPEN;
    LOOP
    XYZ-FETCH INTO l_step, l_sql;
    OUTPUT WHEN xyz % NOTFOUND;
    immediately run l_sql;
    insert into ingest_log values (null, sysdate, i_nom_table, l_step, l_sql, 'Success' parameter);
    END LOOP;
    CLOSE XYZ;
    insert into ingest_log values (null, sysdate, parameter i_nom_table, 0, "Accomplished all the steps.", "Success");
    EXCEPTION WHEN OTHERS THEN
    l_error: = substr (SQLERRM, 1, 200);
    l_code: = SQLCODE;
    insert into ingest_log values (null, sysdate, parameter i_nom_table, l_step, l_sql, l_code |) ' - ERROR - ' | l_error);
    END;

    However, if I create a procedure with this block and try to run it I get an insufficient privileges error. Do not know why. All tables, views, procedures are under the same user, and the user that I'm connected as the runtime of the declare block. The user has the following privileges:

    Connect, resource, xdbadmin, s/n

    Any reason you can think of for this? Script values are generally "CREATE OR REPLACE VIEW As.... » ;

    Permissions in Oracle to do indirectly through roles are not available when compiling packages, functions, and stored procedures. Direct subsidies are required during the creation of these objects in the database.

    http://articles.TechRepublic.com.com/5100-10878_11-6183799.html

Maybe you are looking for

  • Library &gt; com.apple.mail folder?

    I'm somehow more disk space on a mac air and I see GB 116 in my LIBRARY with 66 GB in support of the request, 14 GB and 29 GB in the Mail folder in the folder the user com.apple.mail. Anyone know about this? Thank you

  • I have no address bar on my newly installed on Imac firefox

    I just installed Firefox on my mac I. The installation was necessary because I had my hard drive replaced by Apple. I use Firefox for years. When I open Firefox appears no place to enter a www. etc.

  • Windows Vista Webcam 28 error code

    Hello, I have problems to make my webcam to work. I spoke to the manufacturer of the cam and went down to the solution that is missing a driver that should be installed after formatting my computer. I get the error code 28 when I try to install the d

  • Approval of request status is still pending

    HelloLast Friday 31 May 2013 13:54:18 submitted my application (product name: BNMtestApp Product id: 28974888) for approval, its almost 2 days even more my Application is on "Pending Review 13 Open CR", it has been given in the FAQ, the approval of a

  • Exclude because of the non supported data type DATE.

    I use SQL Developer with Oracle Data Miner GUI.All models excludes the data types DATE and TIMESTAMP as not supported.How to build time series forecast in workflow Data Miner?