Create Table or MV in PL/SQL

Hey everyone,
This is probably a really simple question, but I can't seem to create a table in a PL/SQL procedure. I have something like this:
PROCEDURE TEST_PROC IS
BEGIN
EXECUTE IMMEDIATE 'CREATE TABLE TEST_TBL AS SELECT * FROM DUAL';
END TEST_PROC;
I get a privs error when I try to execute the proc. I also tried first to create a materialized view in a very similar manner, but it also didn't work.
I did some looking and on someone's blog, they created a table using the full create table statement i.e. CREATE TABLE NAME ( COLUMN1 TYPE1, etc..);
But I want to create the table using the "AS" clause and defining a query.
Is there a specific privilege I need to be able to do this? It seems simple enough.
Thanks!
-Joe

Here's what I run:
I ran the query you provided above and here are the results:
UNLIMITED TABLESPACE
CREATE TABLE
Here are the commands I run:
CREATE TABLE TEST_TABLE AS SELECT * FROM DUAL;CREATE TABLE succeeded.
DROP TABLE TEST_TABLE;DROP TABLE TEST_TABLE succeeded.
CREATE PROCEDURE TEST_PROC IS
BEGIN
EXECUTE IMMEDIATE 'CREATE TABLE TEST_TABLE AS SELECT * FROM DUAL';
END TEST_PROC;PROCEDURE TEST_PROC Compiled.
EXEC TEST_PROC; Error starting at line 1 in command:
EXEC TEST_PROC;
Error report:
ORA-01031: insufficient privileges
ORA-06512: at , line 4
ORA-06512: at line 1
01031. 00000 - "insufficient privileges"
*Cause:    An attempt was made to change the current username or password
without the appropriate privilege. This error also occurs if
attempting to install a database without the necessary operating
system privileges.
When Trusted Oracle is configure in DBMS MAC, this error may occur
if the user was granted the necessary privilege at a higher label
than the current login.
*Action:   Ask the database administrator to perform the operation or grant
the required privileges.
For Trusted Oracle users getting this error although granted the
the appropriate privilege at a higher label, ask the database
administrator to regrant the privilege at the appropriate label.
Does this mean I need the CREATE ANY TABLE priv?
Thanks again everyone!
-Joe
Edited by: Joe Bertram on Dec 2, 2009 12:07 PM

Similar Messages

  • Create table statement in a pl/sql procedure

    Hi all.
    I have a problem in Oracle 10g.
    First of all I must say that I'm new in oracle 10.
    I have a stored procedure in which I have the instruction "create table name_table as
    select col1,col2,col3,..ecc
    from table1, table2
    where table1.col1 = table2.col2"
    When I compile this procedure it gives me an error.
    Is it changed the sintax????
    Is there anyone that can help me???
    Thanks all for the collaboration,
    Fabrizio

    A little mistake -- see it --
    SQL> ed
    Wrote file afiedt.buf
      1  Create or replace procedure My_procedure as
      2  begin
      3  EXECUTE IMMEDIATE 'create table my_table(fld number(5));'
      4* end;
    SQL> /
    Warning: Procedure created with compilation errors.
    SQL>
    SQL>
    SQL> ed
    Wrote file afiedt.buf
      1  Create or replace procedure My_procedure as
      2    str varchar2(200);
      3  begin
      4   str := 'create table my_table(fld number(5))';
      5  EXECUTE IMMEDIATE(str);
      6* end;
    SQL> /
    Procedure created.
    SQL>
    SQL>
    SQL> Create or replace procedure My_procedure as
      2  begin
      3  EXECUTE IMMEDIATE 'create table my_table(fld number(5));'
      4  end;
      5  /
    Warning: Procedure created with compilation errors.
    SQL> ed
    Wrote file afiedt.buf
      1  Create or replace procedure My_procedure as
      2  begin
      3  EXECUTE IMMEDIATE 'create table my_table(fld number(5))';
      4* end;
    SQL> /
    Procedure created.Regards.
    Satyaki De.
    N.B.: Please check the bolded line. You didn't write the ; outside the quotation. Otherwise, it will compile successfully.

  • Using Create table command in a Pl/Sql Anonymous Block

    Hi,
    I need to create a table dynamically based on the table_name and column_names that a user wants. When I use a Pl/sql Anonymous block to do this, it complains. Any suggestions ?
    Thanks,
    Marisa

    Personally this sounds like a bad design to me. I would say under most "normal" circumstances, you should not be creating tables on the fly. Especially one where a user has control over what columns,datatypes to use. Let a developer or dba take care of that.

  • How to create table from another in pl/sql

    Hi I need to create a table from another in pl/sql
    How can I do this

    The proper way to do this, is not to do it in PL/SQL. But do it in SQL, something like:
    create table tbl
    as
    select *
      from other_tbl;Doing it in PL/SQL is really slow compared to SQL.
    Yes, if you really want to create a table using PL/SQL then you will need to use DBMS_SQL or EXECUTE IMMEDIATE (Native Dynamic SQL) to do this.

  • Create table as in procedure vs SQL*Plus between 2 utf8-db's

    I have a 9.2.05 db with charset UTF8 and Polish characters in it. When I extract a table to another 9.2.05 db with UTF8 charset using create table x as selcect * ...
    When I run it in SQL*Plus everything works just fine but when I do the create table as from inside a procedure the national characters are converted to western characters and the length of the record are shorter. Why? How do I get the procedure to work as SQL*Plus does. /Göran

    This sounds strange. Could you show the code of the procedure? Could you double-check that your db link points to the right database? Could you add:
    SELECT VALUE INTO <variable1>
    FROM NLS_DATABASE_PARAMETERS
    WHERE PARAMETER='NLS_CHARACTERSET'
    SELECT VALUE INTO <variable2>
    FROM NLS_DATABASE_PARAMETERS@<dblink>
    WHERE PARAMETER='NLS_CHARACTERSET'
    to your procedure and output the contents of the PL/SQL <variable1> and <variable2>, e.g. using DBMS_OUTPUT, to verify the character sets of the databases?
    -- Sergiusz

  • Problem creating table with foreign key in SQL Workshop

    Application Express version 2.2.1.00.04
    Get error message "Number of referencing columns/data types must match referenced columns"
    Master table SLS_SUPPLIERS has primary key SLS_ID NUMBER(8,0) and when creating table SLS_PRODUCTS with FK SLS_SLP_ID NUMBER(8,0) using the create table wizard I get the above error.
    The name of the FK is SLP_SLS_FK, key column is SLP_SLS_ID, referenced table is SLS_SUPPLIERS and referenced column is SLS_ID.
    Any help is much appreciated.
    James Edey
    I should add that if I create the table without the foreign key constraint and then create the constraint separately in SQL Workshop then it creates OK. It only fails in the create table wizard dialog.
    Message was edited by:
    edeyje
    Obviously no-one interested in this - just thought it may be a bug in v2.2 that the development team would find useful.
    James
    Message was edited by:
    edeyje

    I replied to the other thread on this too -
    there is a bug on that page when you click Next. If you define more than one fk but then navigate using the links on the process chart on the left (Constraints, Confirm, etc), the page works fine. We do have a bug on this now and I just added the notes I will need to get this fixed in 3.1 (I have already assigned it to me - must have some rogue validation that fires on next).
    Sorry it took so long for this to get noticed - I am glad I checked the forum this morning -
    -- Sharon

  • SQL error #3115 during Create table

    As a new user to this AIR problem, I am using "adl
    application.xml" to start up testing.
    I am using disk file based table. Disk file is wiped out each
    time before startup this application.
    Following sql failed all the time. Is there anything wrong
    with adl or any cached data need to empty out prior to create
    table?
    createTables : function(callback) {
    // create tables
    var stmt = new air.SQLStatement();
    stmt.sqlConnection = this.sqlConnection;
    stmt.text = "CREATE TABLE IF NOT EXISTS Contacts ( " +
    "id INTEGER PRIMARY KEY AUTOINCREMENT, " +
    "manufacturer VARCHAR(32), " +
    "model VARCHAR(32), " +
    "sn VARCHAR(32), " +
    "orderNumber VARCHAR(64), " +
    "type VARCHAR(256), " +
    "shipping VARCHAR(32), " +
    "check VARCHAR(32), " +
    "notes VARCHAR, " +
    "photo BLOB)";
    var success = function(event) {
    if (callback) callback(true);
    var failure = function(event) {
    runtime.trace("CREATE TABLE error:", event.error);
    runtime.trace("event.error.code:", event.error.code);
    runtime.trace("event.error.message:", event.error.message);
    if (callback) callback(false, event.text);
    stmt.addEventListener(air.SQLErrorEvent.ERROR, failure);
    stmt.addEventListener(air.SQLEvent.RESULT, success);
    stmt.execute();
    D810# adl application.xml
    Loaded
    Loaded
    Loaded
    Loaded
    Loaded
    Loaded
    Loaded
    creating database D:\blackbooksafe\data\database.db
    CREATE TABLE error: SQLError: 'Error #3115: SQL Error.',
    details:'near 'VARCHAR'
    : syntax error', operation:'execute', detailID:'2003'
    event.error.code: undefined
    event.error.message: Error #3115: SQL Error.
    Cannot create database: Error #3115: SQL Error.
    D810#

    Hi Dimitri.
    If you click on the tables node before you right click, does this work for you? Apple's focus is different to windows and you need to click on the component you wish to get a menu on on OSX
    Let me know.
    B

  • ORA-00911 w/create table

    I'm trying to execute an SQL file with the following code:
    create table "t_ap_xml"
    "XML_ID" NUMBER,
    "XML_NAME" VARCHAR2(128),
    "XML_TYPE" VARCHAR(32),
    "XML_CONTENT" "SYS"."XML_TYPE",
    "XML_DESCRIPTION" VARCHAR2(4000)
    ..And i'm receiving the following error:
    ERROR at line 8:
    ORA-00911: invalid character
    It is pointing to the semicolon as the problem. If i remove the semicolon, it seems to work. But if I place that code in a DDL with other create table commands, it gives me a ORA-00922 error at the line with the next create statement. Any ideas? Thanks.

    I guess I should have been a bit more clear..
    I am using SQL*Plus, and GET-ing a text .sql file made in a text editor.
    It seems to work without the semicolon and only creating that single table. However, a problem occurs when trying to use multiple CREATE TABLE statements in the same sql file.
    So for example.. here is an excerpt:
    create table t_ap_xml
    create table another_table
    Generates the following error:
    ORA-00922: missing or invalid option
    ..That error occurs on the line in which the second CREATE TABLE statement was issued.
    Thanks for any help!

  • Unable to create tables through dbms_sql

    Hai
    I got the below error when i am createing table through dbms_sql package at any user except sys user.Our database is 8.1.6 standard edition
    SQL>CONNECT MOHAN/MOHAN;
    SQL> CREATE OR REPLACE Procedure EXECUTESQL (SQLStatement IN VARCHAR2) IS cursor
    _name INTEGER; ret
    2 INTEGER; BEGIN cursor_name := DBMS_SQL.OPEN_CURSOR; DBMS_SQL.PARSE(cursor_n
    ame, SQLStatement,
    3 DBMS_SQL.native); ret := DBMS_SQL.Execute(cursor_name); DBMS_SQL.CLOSE_CURS
    OR(cursor_name); END;
    4 /
    Procedure created.
    SQL> exec EXECUTESQL('create table test(name number)');
    BEGIN EXECUTESQL('create table test(name number)'); END;
    ERROR at line 1:
    ORA-01031: insufficient privileges
    ORA-06512: at "SYS.DBMS_SYS_SQL", line 782
    ORA-06512: at "SYS.DBMS_SQL", line 32
    ORA-06512: at "MOHAN.EXECUTESQL", line 2
    ORA-06512: at line 1
    Any idea about that
    Thanks in advance
    mohan

    Since you are using Oracle 8.1.6, you can use EXECUTE IMMEDIATE instead of DBMS_SQL. Make sure that the necessary privileges have been granted directly, not through roles. Click on the link below for more about privileges and roles and the error message that you got:
    http://osi.oracle.com/~tkyte/Misc/RolesAndProcedures.html
    Once you have the privileges granted properly, you should be able to use the code below. I should point out that this is still doing things the hard way. You can just issue the create table statement from the SQL prompt. I must assume that this is just a minimal experiment and that the eventual code involves more.
    SQL> CREATE OR REPLACE PROCEDURE executesql
      2    (SQLStatement IN VARCHAR2)
      3  IS
      4  BEGIN
      5    EXECUTE IMMEDIATE SQLStatement;
      6  END executesql;
      7  /
    Procedure created.
    SQL> EXEC executesql ('CREATE TABLE test (name NUMBER)')
    PL/SQL procedure successfully completed.
    SQL> DESC test
    Name                                      Null?    Type
    NAME                                               NUMBER

  • Problems on creating table under schema for BPM Demo project

    hi,
    i have not enough experience in database concepts, but i can create ,insert and modify the tables and data by using SQL query in oracle database 10 g express edition
    The reason behind send this qurery is i wanted to create the database tables under "Quote" schema., which is necessary to store and retrive data for my BPM demo project.
    Two important . Sql scirpt file namely create_user.sql and quote.sql used to create the database tables under "quote" schema available on e:/bpm/sql
    i could create "quote" schema by this command on commandline,
    >cd e:/bpm/sql
    >sqlplus sys/welcome as sysdba @create_user.sql quote quote
    but when creating database tables under "quote" schema , i got "SP2-0734 - unknown command exception thrown
    in commandline i was used like this to create table,
    >sqlplus quote quote @quote.sql
    Can anyone who familiar with database query concept help me to create tables on "quote " schema,
    thanks in advance

    Hello,
    Please find enclosed a complete chapter about the CREATE TABLE statement:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_7002.htm#i2095331
    At the end there're many examples.
    Hope this help.
    Best regards,
    Jean-Valentin

  • Create a table in SQL Server, Export tables from Microsoft Excel to Microsoft SQL Server, Populate the created table

    Hello team,
    I have a project that I need to do, what is the best approach for each step?
    1- I have to create a table in Microsoft SQL Server.
    2- I have to import data/ tables from Microsoft Excel or Access to Microsoft SQL Server. Should I use Microsoft Visual Studio to move data from Excel or Access?
    3-I should populate the created table with the data from the exported data.
    4-How should I add the second and third imported table to the first table? Should I use union query?
    After I learn these, I will bring up the code to make sure what I do is right.
    Thanks for all,
    Guity
    GGGGGNNNNN

    Hello Naomi,
    I have imported all the tables into SQL Server,
    I created a table:
    CREATE
    TABLE dbo.Orders
    Now I want to populate this table with the values from imported tables, will this code take care of this task?
    INSERT INTO dbo.Orders(OrderId, OrderDate)
    SELECT OrderId, OrderDate
    FROM Sales.Orders
    UNION
    SELECT OrderId, OrderDate
    FROM Sales.Orders1
    Union
    SELECT OrderId, OrderDate
    FROM Sales.Orders2
    If not, what is the code?
    Please advise me.
    GGGGGNNNNN
    GGGGGNNNNN

  • Using EXECUTE IMMEDIATE with Create Table SQL Statement not working

    Hi ,
    I am all the privileges given from the SYSTEM user , but still i am not able to create a table under procedure . Please see these and advice.
    create or replace procedure sp_dummy as
    begin
    Execute Immediate 'Create table Dummy99_99 (Dummy_Field number)';
    end;
    even i tried this way also
    create or replace PROCEDURE clearing_Practise(p_file_id in varchar2, p_country in VARCHAR2,p_mapId in VARCHAR2)
    AUTHID CURRENT_USER AS
    strStatusCode VARCHAR2(6);
    BEGIN
    EXECUTE IMMEDIATE 'create table bonus(name varchar2(50))';
    commit;
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line('ERROR Creating Table');
    END ;

    William Robertson wrote:
    Since the syntax is correct, my guess is you do not have CREATE TABLE system privilege granted directly to your account. A common scenario is that you have this privilege granted indirectly via a role, allowing you to create tables on the command line, but stored PL/SQL is stricter and requires a direct grant and therefore the procedure fails with 'insufficient privileges'.A bit like he's already been told on his first thread...
    Using of Execute Immediate in Oracle PLSQL
    Generally you would not create tables from stored PL/SQL. Also as you have found out, it's best not to hide exceptions with 'WHEN OTHERS THEN [some message which gives less detail than the one generated by Oracle]'.Again like he was told on the other thread.
    There's just no telling some people eh! :)

  • Creating an XML file from multiple sql tables

    I have very little xml experience, but need to generate an xml file from multiple table. I know what the output needs to look like, but do not know how to setup the code. Any help would be appreciated.
    - <Practice SourceID="EPIC" ExternalPracticeID="PPAWB">
    - <Provider ExternalProviderID="TB2" FirstName="THOMAS G" LastName="BREWSTER">
    - <Patient ExternalPatientID="99999" OldExternalPatID="" FirstName="test" MiddleName="J" LastName="test" Gender="M" DateOfBirth="2005-08-12" SocSecNumber="000-00-0000" LanguageID="22" AddressOne="test" AddressTwo="" City="test" StateID="20" ZipCode="99999" DayPhone="" EveningPhone="207-999-9999" StatusID="">
    <Measure MeasureID="2" MeasureValue="5" MeasureDate="2008-10-24 13:43:00" />
    <Measure MeasureID="2" MeasureValue="5" MeasureDate="2008-10-24 14:23:00" />
    <Measure MeasureID="3" MeasureValue="1" MeasureDate="2008-10-24 13:43:00" />
    <Measure MeasureID="3" MeasureValue="1" MeasureDate="2008-10-24 14:23:00" />
    <Measure MeasureID="32" MeasureValue="3" MeasureDate="2008-10-24 13:51:00" />
    <Measure MeasureID="33" MeasureValue="1" MeasureDate="2008-10-24 13:43:00" />
    <Measure MeasureID="33" MeasureValue="1" MeasureDate="2009-02-09 10:09:00" />
    <Measure MeasureID="4" MeasureValue="5" MeasureDate="2008-10-24 13:43:00" />
    <Measure MeasureID="4" MeasureValue="5" MeasureDate="2008-10-24 14:23:00" />
    <Measure MeasureID="40" MeasureValue="2008-10-24 13:43:00" MeasureDate="2008-10-24 13:43:00" />
    <Measure MeasureID="40" MeasureValue="2008-10-24 14:23:00" MeasureDate="2008-10-24 14:23:00" />
    <Measure MeasureID="41" MeasureValue="2008-10-24 13:43:00" MeasureDate="2008-10-24 13:43:00" />
    <Measure MeasureID="41" MeasureValue="2008-10-24 13:51:00" MeasureDate="2008-10-24 13:51:00" />
    </Patient>
    </Provider>
    </Practice>

    You are interested in XMLElement and probably XMLAgg. Since you didn't list a version, I can't provide links to the corresponding documentation. I cringe at all the attributes on the Patient element as that info should really be elements.
    To create the Measure node, your overall SQL statement may look something like (not tested)
    SELECT XMLElement....
              XMLAgg(SELECT XMLElement
                       FROM measures_table
                      WHERE join condition to parent)
      FROM patient,
           provider,
           practice
    WHERE join conditionsFor additional help, please include your version (4 digits), some sample data, and what you have tried.

  • Creating tables in pl/sql block

    I have the following piece of code that I execute in sqlplusw as @c:\process.sql
    On running @c:\process.sql, an input is provided as prompted. There is a
    declare and begin that processes some code. What I am looking for is -- Is there
    a way that I can check the all_tables view for the following 3 tables :
    TABLE1, TABLE2, TABLE3. Only on finding these tables, this
    anonymous sql (that is inside starting from declare ... should execute).
    If these tables are not found, I want to attempt creating the tables. If the attempt
    was successful, then process. If creating tables attempt fails, exit with a dbms_output.put_line message and don't process
    anything....
    Can this be done ? If so, any hints would be great.....
    Thanks
    ACCEPT input_ssn prompt 'Enter SSN :'
    SET feedback off
    SET serveroutput on
    SET echo off
    SET term off
    SET heading off
    SET pagesize 0
    SET linesize 10000
    SET verify off
    undefne sdate input_ssn
    COL sdate new_value sdate
    COL input_ssn new_value input_ssn
    SELECT TO_CHAR (SYSDATE, 'YYYYMMDD') sdate
    FROM DUAL;
    SPOOL C:\SCRUB_DATA_&&sdate._&&input_ssn..TXT
    SELECT 'REPORT GENERATED ON : ' || SYSDATE
    FROM DUAL;
    ALTER TRIGGER TRIG1 DISABLE;
    DECLARE
    BEGIN
    FOR i IN .........
    LOOP
    END LOOP;
    BEGIN
    SELECT ..........
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    NULL;
    END;
    UPDATE ...........
    FOR i IN .....
    LOOP
    UPDATE ....
    BEGIN
    SELECT ...
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    NULL;
    END;
    UPDATE ...
    BEGIN
    SELECT ....
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    NULL;
    END;
    UPDATE ...
    END LOOP;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
         NULL;
    WHEN OTHERS
    THEN
    ecode := SQLCODE;
    emesg := SQLERRM;
    DBMS_OUTPUT.put_line ('Error code is : '||' - '|| ecode);
    DBMS_OUTPUT.put_line ('Error message is :' || ' - ' || emesg);
    END;
    COMMIT ;
    ALTER TRIGGER TRIG1 ENABLE;
    SET term on
    SET HEADING on
    SELECT 'Processing complete for ' || '&&input_ssn'
    FROM DUAL;
    SPOOL off;
    SET verify on
    SET feedback on
    ----------------------------------------------------------

    This is what I am doing :
    ACCEPT input_ssn prompt 'Enter SSN :'
    SET feedback on
    SET serveroutput on
    SET echo on
    SET term on
    SET heading on
    SET pagesize 0
    SET linesize 10000
    SET verify on
    undefne sdate input_ssn
    COL sdate new_value sdate
    COL input_ssn new_value input_ssn
    SELECT TO_CHAR (SYSDATE, 'YYYYMMDD') sdate
    FROM DUAL;
    SPOOL C:\TEMP_DATA_&&sdate._&&input_ssn..TXT
    ALTER TRIGGER TRIG1 DISABLE;
    DECLARE
    v_postal cheque.postal%TYPE;
    v_count NUMBER;
    l_tabexist NUMBER;
    BEGIN
    DBMS_OUTPUT.PUT_LINE('HELLO THERE');
         BEGIN
              DBMS_OUTPUT.PUT_LINE('HI THERE');
              SELECT 1 INTO l_tabexist FROM all_tables
                   WHERE table_name = 'TABLE1_TEMP' AND owner='HARPER';
         EXCEPTION
              WHEN NO_DATA_FOUND THEN
                   EXECUTE IMMEDIATE 'CREATE TABLE TABLE1_TEMP AS SELECT * FROM TABLE1 WHERE 1=2';
                   EXECUTE IMMEDIATE 'ALTER TABLE TABLE1_TEMP ADD(TEMP_STATUS VARCHAR2(1))';
         END;
         BEGIN
                   SELECT 1 INTO l_tabexist FROM all_tables
                        WHERE table_name = 'TABLE2_TEMP' AND owner='HARPER';
              EXCEPTION
                   WHEN NO_DATA_FOUND THEN
                        EXECUTE IMMEDIATE 'CREATE TABLE TABLE2_TEMP AS SELECT * FROM TABLE2 WHERE 1=2';
                        EXECUTE IMMEDIATE 'ALTER TABLE TABLE2_TEMP ADD(TEMP_STATUS VARCHAR2(1))';
         END;
    BEGIN
    <my code that uses TABLE1_TEMP and TABLE2_TEMP supposed to be created above>
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    DBMS_OUTPUT.put_line ('No Data Found Exception encountered');
    END;
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.Put_Line('Something bad happened');
    RAISE;
    END;
    COMMIT ;
    ALTER TRIGGER TRIG1 ENABLE;
    SET term on
    SET HEADING on
    SPOOL off;
    SET verify on
    SET feedback on
    What is happening here is that until ALTER TRIGGER DISABLE, things are fine.
    Then, it tries to process <my code> and cries saying 'Table or view not found'. Finally it enables the trigger back.
    It is not even displaying either the 'HELLO THERE' or 'HI THERE' - which I suppose is the first thing it should have done.
    Thanks

  • Create and insert into table from Oracle to MS SQL server.

    Hello,
    Oracle Database 11g and Red hat 5
    I have a very different kind of issue. I am handling the ORACLE db(remote db with all the important data). On the other side their is a MS SQL server db(local db with some testing data in it). All the users will access the ORACLE db for the actual processing but for sometime they need to apply some of their own concepts. So they will transfer the data from ORACLE to MS sql server.
    I want to create a code in ORACLE db like a procedure , which will create a table in MS sql server , insert data into it,Also create some metadata table to keep some of my table's info on MS SQL serve db,If the table is present it should append the data, .... like many things ...
    Overall my question is , how can i write a code to make these operation on a remote db, that to these operations are DDL and on MS SQL Server(Non-Oracle) ???
    Please guide me with some ideas or solutions ...
    Also provide if you have some good links to study ...
    thanks in advance.

    I'm not sure why you never visit http://tahiti.oracle.com prior to asking any question. Is it forbidden in your locale? Are you afraid of it? Will your salary be decreased when you visit the documentation?
    http://www.oracle.com/pls/db111/search?word=sql+server&partno=
    should provide sufficient information.
    Your doc question must be considered a violation of Forum Etiquette and an abuse of this forum.
    Sybrand Bakker
    Senior Oracle DBA

Maybe you are looking for