Equivalent of CREATE TABLE syntax for functions?

Hello
I am trying to update my functions with a copy of another data base. Y at - it an equivalent syntax in CREATE TABLE as for functions? Basically, I want to drop my old feature in my dev environment and re-create it with the version on prod. I need to use it in a loop for all functions in prod, if just by using the statement plsql itself will not solve my problem.

Thank you
John

Hi, John,.

Discover the package supplied by Oracle dbms_metadata.

In addition, the source code for procedures, functions and packages is available in user_source, which you can query like this:

SELECT       text
FROM       user_source
WHERE       name     = 'PROC_X'
AND       type     = 'PROCEDURE'
ORDER BY  line
;

Tags: Database

Similar Questions

  • What is the correct syntax for function in SQL expressions filters?

    Hello

    I want to build a report that looks at the last dates 4 snapshot.
    I got every snapshot using this filter date

    Snapshot Date. "' Snapshot date" = TIMESTAMPADD (SQL_TSI_WEEK-10, TIMESTAMPADD (SQL_TSI_DAY, (7 - dayofweek (current_date) + 2), current_date)) has
    now the second would:
    Snapshot Date. "' Snapshot date" = TIMESTAMPADD (SQL_TSI_WEEK-10, TIMESTAMPADD (SQL_TSI_DAY, (6 - dayofweek (current_date) + 2), current_date)) B
    a third
    Snapshot Date. "' Snapshot date" = TIMESTAMPADD (SQL_TSI_WEEK-10, TIMESTAMPADD (SQL_TSI_DAY, (5-dayofweek (current_date) + 2), current_date)) C
    a 4th
    Snapshot Date. "' Snapshot date" = TIMESTAMPADD (SQL_TSI_WEEK-10, TIMESTAMPADD (SQL_TSI_DAY, (4 - dayofweek (current_date) + 2), current_date)) D

    for simplicity let's call filters A, B, C, D
    so, my sql expression should be something like the snapshot Date. "" Instant Date "in 'A', ' B', ' d ', 'C '.
    I tried to combine the underside, with hooks and comma separated, without brackets, with single quotes and without, but I always get a syntax error.

    Snapshot Date. "" Instant Date "in TIMESTAMPADD (SQL_TSI_WEEK-10, TIMESTAMPADD (SQL_TSI_DAY, (7 - dayofweek (current_date) + 2), current_date)).
    TIMESTAMPADD (SQL_TSI_WEEK-10, TIMESTAMPADD (SQL_TSI_DAY, (6 - dayofweek (current_date) + 2), current_date)).
    TIMESTAMPADD (SQL_TSI_WEEK-10, TIMESTAMPADD (SQL_TSI_DAY, (5 - dayofweek (current_date) + 2), current_date)).
    TIMESTAMPADD (SQL_TSI_WEEK-10, TIMESTAMPADD (SQL_TSI_DAY, (4 - dayofweek (current_date) + 2), current_date))

    He doesn't seem to like the function IN either.
    Any idea?
    Concerning
    G.

    Published by: user6185307 on October 27, 2009 08:07

    Take each of these filters and union in your report of responses.

    In this way, filter you up to exactly the last 4 days.

  • ORA-01031 error creating table

    I use DB 11g on Wn 2008 Server 64 bit. I run the following creation script:

    CREATE THE TABLE SUPPCHAIN. COUNTRIES (COUNTRY_ID, REGION_ID NUMBER NOT NULL, C
    COUNTRY VARCHAR2 (32) NOT NULL, CODE CHAR (2) NOT NULL, NUMBER OF THE POPULATION, THE AREA N
    UMBER, FXCODE CHAR (3), VARCHAR2 (32) OF CURRENCY, RATES FLOAT (126), PRIMARY KEY (COUN
    TRY_ID) VALIDATE, VALIDATE UNIQUE (COUNTRY), INVALID (CODE) UNIQUE, FOREIGN
    KEY (REGION_ID) REFERS TO SUPERAD. REGION (REGION_ID) VALIDATE)

    Get the following error

    ERROR on line 1:
    ORA-01031: insufficient privileges

    I know it has to do with foreign key references, but I do not know what privileges to set to allow the above run correctly.

    I put CREATE TABLE privileges for user SUPPCHAIN. User SUPERAD also has these privileges and the SYSDBA. So what other privileges should I create?


    Thanks, J

    Jay wrote:
    I use DB 11g on Wn 2008 Server 64 bit. I run the following creation script:

    CREATE THE TABLE SUPPCHAIN. COUNTRIES (COUNTRY_ID, REGION_ID NUMBER NOT NULL, C
    COUNTRY VARCHAR2 (32) NOT NULL, CODE CHAR (2) NOT NULL, NUMBER OF THE POPULATION, THE AREA N
    UMBER, FXCODE CHAR (3), VARCHAR2 (32) OF CURRENCY, RATES FLOAT (126), PRIMARY KEY (COUN
    TRY_ID) VALIDATE, VALIDATE UNIQUE (COUNTRY), INVALID (CODE) UNIQUE, FOREIGN
    KEY (REGION_ID) REFERS TO SUPERAD. REGION (REGION_ID) VALIDATE)

    Get the following error

    ERROR on line 1:
    ORA-01031: insufficient privileges

    I know it has to do with foreign key references, but I do not know what privileges to set to allow the above run correctly.

    I put CREATE TABLE privileges for user SUPPCHAIN. User SUPERAD also has these privileges and the SYSDBA. So what other privileges should I create?

    Thanks, J

    GRANT REFERENCES ON SUPERAD. SUPPCHAIN REGION;

  • Creating tables in a nested for loop

    Hi all.

    I was stuck in this problem for quite a while now and I still don't know how to continue. Some outside the entrance would be greatly appreciated!

    I'm doing the following:

    -Take an array of numbers, to check if they are within a certain range (e.g. between 2 and 4)

    -Build two new arrays: one with all the numbers that are inside the beach and the other with the rest.

    An additional condition is that the amount and value of the range conditions will change (for example, it could be between 2 and 4 only / 2, 4 AND 6 and 7 according to the entry)

    To treat this, I created two nested for loops - one that goes on a table that contains conditions of the beach and inside that actually go and check if the values are in the range. I think I did that part successfully, but the next part is confusing to me - how to actually create the tables separated within two loops for?

    My apologies if I did not explain it well. Another method to support this problem is I want to translate following LabVIEW:

    Ranges of table / / [1 5 7 10] exodus-> This means we want to divide numbers based on those who are in (1,2) and (4.5) against those who are not

    Table of values / / [2 3 6 11 3]

    EndOperationDelegate table / / array of values within the range
    Table outValues / / Array of values out of range

    for m = 1:size (ranges)

    for n = 1:size (values)
    If (THE NUMBER IS on the INSIDE of EACH RANGE)
    EndOperationDelegate = [EndOperationDelegate NEWNUMBER]
    on the other
    outValues = [outValues NEWNUMBER]
    end

    end
    end

    Sounds easy enough, but it gets so chaotic with Labview that I don't know what to do. I have attached a reference image - insertion in the array function is not in fact add to the table, it creates a new table. How can I save that for when the nested for the ends of the loop?

    I have seen a few examples with shift registers which lie in a loop and I couldn't successfully that transfers in my block diagram.

    Any help/direction would be greatly appreciated.

    Hello!

    See the following example to understand how you can create a table in the loop For

    In your case, you also can uce conditional terminal to create a table only when then located nearby. It makes the code much cleaner that the structures of the case

    Hope this helps, if not, let me know if I can help you!

    Marcin

  • SQLPLUS set variables for creating table.

    I do the following in SQLPLUS

    set l_date = to_char (sysdate, 'yyyy')
    define l_name = "«mytable"»
    set l_tn = & l_name | & l_date

    SQL > select & l_name | & double l_date;
    old 1: select & l_name | & l_date of the double
    new 1: select 'mytable '. TO_CHAR (sysdate, 'yyyy') of the double

    "MYTABLE".
    -----------
    mytable2010

    But when I use that way, I don't get the YEAR.

    SQL > select ' & l_tn' double.
    old 1: select ' & l_tn' of the double
    new 1: select 'mytable' of the double

    ' MYTABL
    -------
    MyTable


    I want to create table in sqlplus by using the following command:
    create table & l_tn (x number)

    Please let me know what I'm doing wrong here.

    Hello

    (Like TO_CHAR) SQL functions and operators (as |) are not executed in SQL * most orders (as DEFINED).
    Test your variables after you set you will see what I mean

    define l_date = to_char(sysdate,'yyyy')
    PROMPT     &l_date = l_date
    

    Output:

    to_char(sysdate,'yyyy') = l_date
    

    "In other words, l_date is used for a 23 character string, which starts with 't' and contains ' (',',' and ' ')', ', which are not allowed in file names (probably; depending on the system).
    I think you want that it set to a string of 4 characters, such as "2010".

    Use the COLUMN... New_value (or... Order OLD_VALUE) to define a variable substitution to the results of a calculation of SQL.

    I think you are trying to do something like this:

    COLUMN     year_col     NEW_VALUE     l_date
    
    SELECT     TO_CHAR (SYSDATE, 'YYYY')     AS year_col
    FROM     dual;
    
    define l_name = mytable
    
    CREATE TABLE  &l_name&l_date
    ...
    
  • Syntax for the existing index based on a function

    Hello:

    I'm on 10.2.0.3.

    Below is the list of indexes and the columns in the index on one of the tables. Aparantly one of the columns (SYS_NC00220$) is actually a function-based index.

    Anyone know how to get the SQL syntax for this index? TIA.

    INDEX_NAME UNIQUENES COLUMN_NAME POSITION_COLONNE
    ------------------------------ --------- ------------------------------ ---------------
    PS0BI_HDR not BILL_TO_CUST_ID 1
    PS0BI_HDR don't BUSINESS_UNIT 2
    PS0BI_HDR only SYS_NC00220$ 3
    PS1BI_HDR not BILL_STATUS 1
    PS1BI_HDR don't BUSINESS_UNIT 2
    PS1BI_HDR only SYS_NC00220$ 3
    PS2BI_HDR not CONTRACT_NUM 1
    PS2BI_HDR don't BUSINESS_UNIT 2
    PS2BI_HDR only SYS_NC00220$ 3
    NON-UNIQUE PSABI_HDR BILL 1
    PSABI_HDR don't BILL_TO_CUST_ID 2
    PSABI_HDR don't BUSINESS_UNIT 3
    PSABI_HDR not BILL_STATUS 4
    UNIQUE PROCESS_INSTANCE PSBBI_HDR 1
    UNIQUE BUSINESS_UNIT PSBBI_HDR 2
    INVOICE SINGLE PSBBI_HDR 3
    UNIQUE BUSINESS_UNIT PS_BI_HDR 1
    UNIQUE SYS_NC00220 PS_BI_HDR $ 2

    query user_ind_expressions and search for COLUMN_EXPRESSION.

    This will give you an expression.

  • Create table for users

    Hi all

    11.2.0.3.10

    AIX6

    I created a user SCOTT in our database.

    I have grant connect, resource to scott; because it is easier to do it this way.

    DBA, I wish that I'm the only one to create all the tables of scott, and he cannot create for himself.

    What is the effective way to do this? Is this order enough? > REVOKE CREATE a TABLE FROM SCOTT;

    Thank you

    MK

    RP gave you the right answer if you want to restrict users to create table, do not give them privilege resource.  See this demo:

    Connected to:

    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

    With partitioning, OLAP, Data Mining and Real Application Testing options

    SQL > create user test identified by the test.

    Created by the user.

    SQL > grant connect to test;

    Grant succeeded.

    SQL > connect test/test;

    Connected.

    SQL > create table tab1 (a number);

    create table tab1 (a number)

    *

    ERROR on line 1:

    ORA-01031: insufficient privileges

    SQL > connect sys/pw as sysdba

    Connected.

    SQL > grant create table to test;

    Grant succeeded.

    SQL > connect test/test;

    Connected.

    SQL > create table tab1 (a number);

    Table created.

    SQL > connect sys/pw as sysdba

    Connected.

    SQL > revoke create table test;

    Revoke succeeded.

    SQL > connect test/test;

    Connected.

    SQL > create table tab2 (a number);

    create the table tab2 (a number)

    *

    ERROR on line 1:

    ORA-01031: insufficient privileges

    SQL >

    Concerning

    Girish Sharma

  • [10g] calls for more information on CREATE TABLE?

    Is it possible to put something in place that invites you to insert a piece of information at any time a table is created?

    I have a table:
    CREATE TABLE     my_table_notes
    (     table_name     VARCHAR2(30)     NOT NULL
    ,     table_owner     VARCHAR2(3)     NOT NULL
    ,     date_added     TIMESTAMP     NOT NULL
    ,     notes          VARCHAR2(2000)
    ,     CONSTRAINT     dtn_pk     PRIMARY KEY (table_name, table_owner, date_added)
    );
    Where do I put the notes on the tables, that I added to my database. These notes are mainly to remind me exactly what is in the tables. I have a number of tables with similar names and similar columns, such as desc table does not always information that I need to remember what is a table. Yes, I could keep a document text or something with this information, but I like to have in the database.

    What I was asking is, is there anything I can do which will automatically ask me after I created a table, in order to enter comments on this table, such as the instruction insert the following would be generated?
    INSERT INTO     my_table_notes
    VALUES (<table just created>, <owner of table created>, SYSTIMESTAMP, <comments I provide on prompt>);
    I work in 10g (XE on my local machine)

    Published by: user11033437 on July 14, 2011 09:31: Oracle version added

    If you happen to start with serveroutput enabled in SQL * more permanently, a DDL trigger could potentially just released a note reminding you to create a comment. If you do not set serveroutput, you don't see the message. And, of course, you could easily ignore the message that came out. If you want just a friendly reminder, this is enough.

    Because PL/SQL runs on the database server, there is no way to ask a user for something - it has no facilities to get a user input. SQL * Plus has the ability to ask a user for the data, but then you need to run a given SQL * more script to create a table that seems much too heavy for the situation you describe.

    Justin

  • what need parameter should be ignored for creating table in LMT

    Hi all

    I have locally managed tablespace (LMT) with the type of ventilation SYSTEM and segment_space_management is AUTOMATIC. My database is Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi.

    I have for example:

    create table (ID)
    PCTFREE 5
    INITTRANS 2
    STORAGE (Initial...).


    Oracle documnetation, I found that it is recommended to omit the storage clause when you use LMT.

    I want to know, I do also omit PCTFREE 5, INITTRANS 2 of the create table statement?

    Thanks for any advice.

    Dear spur230,

    Yes, you can omit these parameters either.

    Here's the answer to your question;

    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14231/tspaces.htm#sthref1153

    +"+
    * + Creating a locally managed Tablespace + *.

    + Create a locally managed tablespace by specifying IN clause of the CREATE TABLESPACE statement SCOPE MANAGEMENT. This is the default value for new permanent storage space, but you must specify the EXTENT MANAGEMENT LOCAL clause if you want to specify the AUTOALLOCATE or the UNIFORM clause. You can have the database to manage extensions for you automatically with the clause AUTOALLOCATE (default), or you can specify that the tablespace is managed with uniform extents of a specific size (UNIFORM). +

    + If you plan the tablespace contains objects of various sizes, requiring many scopes with different sizes, then AUTOALLOCATE is the best choice. AUTOALLOCATE is also a good choice if it is not important for you to have a lot of control over the allocation of space and the deallocation, because it simplifies the management of the table space. A space may be wasted with this parameter, but the advantage of having the Oracle database manage your space probably outweigh this disadvantage. +

    + If you want exact control on unused space, and you can predict exactly the space to allocate for an object or objects and the number and size of extensions, and then UNIFORM is a good choice. This setting ensures that you will never have the unusable space in your tablespace. +

    * + When you do not explicitly specify the type of management, database Oracle determines management extended as follows: + *.

    + * _If the CREATE TABLESPACE statement omits the DEFAULT storage clause, then the database creates a locally managed tablespace autoallocated. _ +
    + * _If the CREATE TABLESPACE statement includes a default storage clause, then the database considers the following: _ +.
    + O _If you specified AS MINIMUM clause, the database evaluates if MEASURE MINIMUM values, INITIAL, FOLLOWING are equal, and the value for PCTINCREASE is 0. If so, the database creates a locally managed tablespace uniform with size = INITIAL measurement. If the parameters to MEASURE MINIMUM INITIAL and NEXT are not equal, otherwise PCTINCREASE is not 0, the database ignores storage extent parameters you specify and creates a locally managed tablespace autoallocated. _ +
    + o _If you have not specified a MEASURE MINIMUM clause, the database evaluates only if the values of storage are the same INITIAL and NEXT and PCTINCREASE is 0. If so, the tablespace is locally managed and uniform. Otherwise, the tablespace is locally managed and autoallocated. _ +

    + The following statement creates a managed tablespace locally named lmtbsb and specifies AUTOALLOCATE: +.

    + CREATE TABLESPACE lmtbsb DATAFILE ' / u02/oracle/data/lmtbsb01.dbf' SIZE 50 +.
    + EXTENT MANAGEMENT LOCAL AUTOALLOCATE; +

    + AUTOALLOCATE causes tablespace system managed with a volume of minimum extent of 64K. +

    + The alternative to AUTOALLOCATE is UNIFORM. who says that the tablespace is managed with uniform size extents. You can specify the size of the uniform SIZE clause. If you omit the SIZE, the default size is 1 M. +

    + The following example creates a tablespace with uniform extents of 128 K. (In a database with 2 K blocks, each would amount to 64 blocks of data). Each measure 128K is represented by a bit in the bitmap extent for this file. +

    + CREATE TABLESPACE lmtbsb DATAFILE ' / u02/oracle/data/lmtbsb01.dbf' SIZE 50 +.
    + EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K; +

    + You can not specify the storage, TEMPORARY or MEASURE MINIMUM clause by DEFAULT when you explicitly specify EXTENT MANAGEMENT LOCAL. If you want to create a locally managed temporary tablespace, use the statement to CREATE a TEMPORARY TABLESPACE. +
    +"+

    Hope that helps.

    Ogan

  • How to specify the tablespace for a India primary key in create table statement

    How to specify the storage space for a primary key index in a create table statement?
    Does the following statement is true?
    CREATE TABLE 'GPS'||TO_CHAR(SYSDATE+1,'YYYYMMDD')
                ("ID" NUMBER(10,0) NOT NULL ENABLE, 
                "IP_ADDRESS" VARCHAR2(32 BYTE), 
                "EQUIPMENT_ID" VARCHAR2(32 BYTE), 
                "PACKET_DT" DATE, 
                "PACKET" VARCHAR2(255 BYTE), 
                "PACKET_FORMAT" VARCHAR2(32 BYTE), 
                "SAVED_TIME" DATE DEFAULT CURRENT_TIMESTAMP, 
                 CONSTRAINT "UDP_LOG_PK" PRIMARY KEY ("ID") TABLESPACE "INDEX_DATA"
                 )            
                 TABLESPACE "SBM_DATA";   
    Thank you

    Published by: qkc November 9, 2009 13:42

    As orafad noted, you can use the documentation using ESCALATION clause, i.e.

    SQL> ed
    Wrote file afiedt.buf
    
      1  CREATE TABLE GPS
      2              ("ID" NUMBER(10,0) NOT NULL ENABLE,
      3              "IP_ADDRESS" VARCHAR2(32 BYTE),
      4              "EQUIPMENT_ID" VARCHAR2(32 BYTE),
      5              "PACKET_DT" DATE,
      6              "PACKET" VARCHAR2(255 BYTE),
      7              "PACKET_FORMAT" VARCHAR2(32 BYTE),
      8              "SAVED_TIME" DATE DEFAULT CURRENT_TIMESTAMP,
      9               CONSTRAINT "UDP_LOG_PK" PRIMARY KEY ("ID") USING INDEX TABLESP
    ACE "USERS"
     10               )
     11*              TABLESPACE "USERS"
    SQL> /
    
    Table created.
    

    Justin

  • confusion on the clause nologging - for create table

    Hi guys,.

    just 1 simple question.

    T1) when I create a table with no record, is the CREATION of the table not connected as well?


    Kind regards
    Noob

    OracleWannabe wrote:
    T1) when I create a table with no record, is the CREATION of the table not connected as well?

    If the table is created empty (as do not use a create table as select or DEC) then there is no difference in the design stage. The difference between REGISTRATION and NOLOGGING intervenes for direct path operations.

    The Oracle documentation provides a very good explanation:
    http://download.Oracle.com/docs/CD/B28359_01/server.111/b28313/usingpe.htm#i1009116

    Kind regards
    Greg Rahn
    http://structureddata.org

  • As sysdba, how to grant create table to a user for a particular tablespace?

    I did the PRACTICE tablespace and user SEAN. How can I give SEAN the privilege to create a table in the practical tablespace?

    CREATE TABLESPACE PRACTICE
    DATA FILE
    ' F:\DBM\FALLB\DB2046\ORACLE\ADMIN\ORAC...
    SIZE 20 M
    DEFAULT STORAGE OF DICTIONARY OF MANAGEMENT MEASURE (1 M INITIAL FOLLOWING 1 M MAXEXTENTS 20 PCTINCREASE 0);

    CREATE USER SEAN
    IDENTIFIED BY SEAN
    PRACTICE OF TABLESPACE DEFAULT;
    GRANT CREATE SESSION TO SEAN;

    -----------------------------------------------
    -----------------------------------------------
    SEAN GRANT SYSDBA;
    +
    Sean/[email protected] CONNECT as sysdba

    Works, but what happens if I don't want SEAN have sysdba privileges?

    -----------------------------------------------
    -----------------------------------------------
    Another question would be if I don't give SEAN sysdba privileges and then I connect like sean and then perform a
    SELECT * FROM TAB;
    to display the available tables, how can I do so that I can only see the paintings I do myself instead of all tables in the database?

    Hello

    Connect as sys and grant after privs to SEAN, I added a few privileges as well.

    Do not give any user other than SYS sysdba priv, unless you intend to use user SEAN as a user administrative addition to SYS.

    GRANT RESOURCE TO SEAN;
    GRANT CONNECT TO SEAN;
    GRANT CREATE SESION TO SEAN;
      -- GRANT UNLIMITED TABLESPACE TO SEAN;
    GRANT CREATE VIEW TO  SEAN;
    GRANT CREATE PROCEDURE TO SEAN ;
    GRANT CREATE TABLE TO SEAN
      -- 1 Tablespace Quota for SEAN
    ALTER USER  SEAN QUOTA UNLIMITED ON PRACTICE;
     
    

    Concerning

  • Another syntax for creating primary key


    Hello


    I have a question about the right way to create primary keys.
    Earlier, we were on Oracle 9i and we have upgraded to Oracle 10 g. The question is when creating primary key is allowed to create the unique index and then to create the primary key constraint? or directly create the first key is better? or are there ways to both the same?


    for example:
    one way:


    SQL & gt; CONN u2/u2@db1
    Connected.
    SQL & gt; create table a (a1, b1 varchar2 number (2), the date c1);


    Table created.


    SQL & gt; create an index on a (a1) tablespace unique pk_a t1;


    The index is created.



    SQL & gt; ALTER table a Add (constraint primary key (a1) using index pk_a);


    Modified table.
    Another way:
    SQL & gt; CONN u1/u1@db1
    Connected.
    SQL & gt; create table a (a1, b1 varchar2 number (2), the date c1)
    2.


    Table created.


    SQL & gt;
    SQL & gt; ALTER table a Add (constraint primary key (a1) using index tablespace t1 pk_a)
    2.


    Modified table.
    Which of the two approach is better? or are they the same?


    Thank you
    Cedric

    Oracle will attempt to create the index to apply the constraint. Of course, it is certainly possible that the creation of the index will fail, but you would be just to move the point of failure of the CREATE INDEX statement to the ALTER TABLE statement, assuming that everything else is equal (that is, you create the index in the same tablespace, quotas and tablespace sizes are the same, permissions are not changed, etc.)

    It may be preferable in some contexts to create a non-unique index before the creation of the constraint and instruct Oracle to use the non-unique index to apply the constraint. If you decide in the future to make the primary key constraint can be delayed, for example, have a non-unique index allows you to make this change without having to (implicitly), drop and re-create the index. A separate CREATE INDEX statement also influences when you go to remove a constraint / index. If the index was created before the constraint, you can remove the constraint without affecting the index. If the index was created after the constraint, deleting the constraint implicitly removes the index. Normally, particularly with OLTP applications, this doesn't buy you much. Sometimes, however, there are ETL process benefiting from such things.

    Justin

  • Creating tables with the same Structure and with the remote control FOR the parts database

    Hello

    I have a remote DB connection and a local DB connection in my system
    I want to create the same Table and data from my DB remote to Local Connection DB connection.

    Please tell me how to do this?

    CREATE TABLE LOCAL_TABLE AS SELECT * FROM REMOTE_TABLE@TNS_ALIAS;

  • syntax error in create table

    Could someone help me please as to what's wrong in the creation under the structure of the table:

    create table test (select * from schema.tablename where 1 = 2)
    TABLESPACE PCR_ARCHIVE_DATA_04
    PCTUSED 0
    PCTFREE 10
    INITRANS 1
    MAXTRANS 255
    STORAGE)
    64K INITIALS
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    DEFAULT USER_TABLES
    )
    NOLOGGING
    COMPRESS
    NOCACHE
    PARALLEL (INSTANCES OF 6 1 DEGREE)
    MONITORING;

    SELECT AS comes after the physical attributes, such as

    create table test TABLESPACE PCR_ARCHIVE_DATA_04
    PCTUSED 0
    PCTFREE 10
    INITRANS 1
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    )
    NOLOGGING
    COMPRESS
    NOCACHE
    PARALLEL ( DEGREE 6 INSTANCES 1 )
    MONITORING
    as (select * from schema.tablename where 1=2)
    

    Best regards

    Maxim

Maybe you are looking for