Sponsored Content
Special Forums UNIX and Linux Applications Help in copying table structure to another table with constraints in Oracle Post 302876706 by senkerth on Tuesday 26th of November 2013 07:12:23 AM
Old 11-26-2013
Help in copying table structure to another table with constraints in Oracle

hi,

i need to copy one table with data into another table,

right now am using


Code:
create table table1 as select * from table2

i want the constraints of table1 to be copied to table2 also , can anyone give me some solution to copy the constraints also, now am using oracle 10.2.0.3.0 version.

thanks,
senthil

Last edited by joeyg; 11-26-2013 at 08:57 AM.. Reason: Highlight the area, then click on the CodeTags button to encode the section
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Check the record count in table (table in oracle)

I have requirement: 1) Check the record count in table (table in oracle) 2) If records exists generate the file for existing records and wait for some time (Go to sleep mode) and Again check the record count after 10 min.......... (Loop this process if record count >0). 3) Generate touch... (1 Reply)
Discussion started by: kamineni
1 Replies

2. Shell Programming and Scripting

Check the record count in table (table in oracle)

I have requirement: 1) Check the record count in table (table in oracle) 2) If records exists generate the file for existing records and wait for some time then Go to sleep mode and Again check the record count after 10 min.......... (Loop this process if record count >0). 3) Generate touch... (1 Reply)
Discussion started by: kamineni
1 Replies

3. Shell Programming and Scripting

How to create a C structure using table description.

There is table 'DEPT' in the database with the following desciption: Name Null? Type ------- -------- ------------------------ DEPTNO NOT NULL NUMBER(2) DNAME NULL VARCHAR2(14) LOC NULL VARCHAR2(13) Using shell script, I need to create a structure for the... (2 Replies)
Discussion started by: ehari
2 Replies

4. Shell Programming and Scripting

select values from db1 table and insert into table of DB2

Hi I am having three oracle databases running in three different machine. their ip address is different. from one of the DB am able to access both the databases.(means am able to select values and insert values in to tables individually.) I need to fetch some data from DB1 table(say DB1 ip is... (2 Replies)
Discussion started by: aemunathan
2 Replies

5. Shell Programming and Scripting

Copying of multiple columns of one table to another by mapping with particular strings.

Hi, I would like to copy some columns from a particular file by mapping with the string names. i am using the .csv file format. my one file consist of 100 of columns but i want only particular 4 columns such as ( First_name, Middle_name,Last_name & Stlc). but they are listed in many files... (15 Replies)
Discussion started by: dsh007
15 Replies

6. UNIX for Dummies Questions & Answers

Creating a condensed table from a pre-existing table in putty

Hello, I'm working with putty on Windows 7 professional and I'd like to know if there's a way to gather specific lines from a pre-existing table and make a new table with that information. More specifically, I'd like the program to look at a specific column, say column N, and see if any of the... (5 Replies)
Discussion started by: Deedee393
5 Replies

7. Shell Programming and Scripting

Extract hive table structure

Hi, I need to extract only the create table structure with columns alone. for eg hive_table show create table hive_table: create table hive_table(id number,age number) OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat' LOCATION 'hdfs:/path/' I need only below ... (5 Replies)
Discussion started by: rohit_shinez
5 Replies

8. Web Development

Getting Rid of Annoying Bootstrap Table Borders and Wayward Table Lines

Bootstrap is great; but we have had some issues with Bootstrapped <tables> (and legacy <fieldset> elements) showing annoying, wayward lines. I solved that problem today with this simple jQuery in the footer: <script> $(function(){ $('tr, td, fieldset,... (0 Replies)
Discussion started by: Neo
0 Replies

9. Shell Programming and Scripting

JSON structure to table form in awk, bash

Hello guys, I want to parse a JSON file in order to get the data in a table form. My JSON file is like this: { "document":{ "page": }, { "column": } ] }, { ... (6 Replies)
Discussion started by: Gescad
6 Replies
SQL::Translator::Producer::GraphViz(3pm)		User Contributed Perl Documentation		  SQL::Translator::Producer::GraphViz(3pm)

NAME
SQL::Translator::Producer::GraphViz - GraphViz producer for SQL::Translator SYNOPSIS
use SQL::Translator; my $trans = SQL::Translator->new( from => 'MySQL', # or your db of choice to => 'GraphViz', producer_args => { out_file => 'schema.png', bgcolor => 'lightgoldenrodyellow', show_constraints => 1, show_datatypes => 1, show_sizes => 1 } ) or die SQL::Translator->error; $trans->translate or die $trans->error; DESCRIPTION
Creates a graph of a schema using the amazing graphviz (see http://www.graphviz.org/) application (via the GraphViz module). It's nifty--you should try it! PRODUCER ARGS
All GraphViz constructor attributes are accepted and passed through to "new" in GraphViz. The following defaults are assumed for some attributes: layout => 'dot', overlap => 'false', node => { shape => 'record', style => 'filled', fillcolor => 'white', }, # in inches width => 8.5, height => 11, See the documentation of "new" in GraphViz for more info on these and other attributes. In addition this producer accepts the following arguments: o skip_tables An arrayref or a comma-separated list of table names that should be skipped. Note that a skipped table node may still appear if another table has foreign key constraints pointing to the skipped table. If this happens no table field/index information will be included. o skip_tables_like An arrayref or a comma-separated list of regular expressions matching table names that should be skipped. o cluster Clustering of tables allows you to group and box tables according to function or domain or whatever criteria you choose. The syntax for clustering tables is: cluster => 'cluster1=table1,table2;cluster2=table3,table4' Or pass it as an arrayref like so: cluster => [ 'cluster1=table1,table2', 'cluster2=table3,table4' ] Or like so: cluster => [ { name => 'cluster1', tables => [ 'table1', 'table2' ] }, { name => 'cluster2', tables => [ 'table3', 'table4' ] }, ] o out_file The name of the file where the resulting GraphViz output will be written. Alternatively an open filehandle can be supplied. If undefined (the default) - the result is returned as a string. o output_type (DEFAULT: 'png') This determines which output method will be invoked to generate the graph: "png" translates to "as_png", "ps" to "as_ps" and so on. o fontname This sets the global font name (or full path to font file) for node, edge, and graph labels o fontsize This sets the global font size for node and edge labels (note that arbitrarily large sizes may be ignored due to page size or graph size constraints) o show_fields (DEFAULT: true) If set to a true value, the names of the colums in a table will be displayed in each table's node o show_fk_only If set to a true value, only columns which are foreign keys will be displayed in each table's node o show_datatypes If set to a true value, the datatype of each column will be displayed next to each column's name; this option will have no effect if the value of "show_fields" is set to false o friendly_ints If set to a true value, each integer type field will be displayed as a tinyint, smallint, integer or bigint depending on the field's associated size parameter. This only applies for the "integer" type (and not the "int" type, which is always assumed to be a 32-bit integer); this option will have no effect if the value of "show_fields" is set to false o friendly_ints_extended If set to a true value, the friendly ints displayed will take into account the non-standard types, 'tinyint' and 'mediumint' (which, as far as I am aware, is only implemented in MySQL) o show_sizes If set to a true value, the size (in bytes) of each CHAR and VARCHAR column will be displayed in parentheses next to the column's name; this option will have no effect if the value of "show_fields" is set to false o show_constraints If set to a true value, a field's constraints (i.e., its primary-key-ness, its foreign-key-ness and/or its uniqueness) will appear as a comma-separated list in brackets next to the field's name; this option will have no effect if the value of "show_fields" is set to false o show_indexes If set to a true value, each record will also show the indexes set on each table. It describes the index types along with which columns are included in the index. o show_index_names (DEFAULT: true) If "show_indexes" is set to a true value, then the value of this parameter determines whether or not to print names of indexes. if "show_index_names" is false, then a list of indexed columns will appear below the field list. Otherwise, it will be a list prefixed with the name of each index. o natural_join If set to a true value, "make_natural_joins" in SQL::Translator::Schema will be called before generating the graph. o join_pk_only The value of this option will be passed as the value of the like-named argument to "make_natural_joins" in SQL::Translator::Schema; implies "natural_join => 1" o skip_fields The value of this option will be passed as the value of the like-named argument to "make_natural_joins" in SQL::Translator::Schema; implies "natural_join => 1" DEPRECATED ARGS o node_shape Deprecated, use node => { shape => ... } instead o add_color Deprecated, use bgcolor => 'lightgoldenrodyellow' instead If set to a true value, the graphic will have a background color of 'lightgoldenrodyellow'; otherwise the default white background will be used o nodeattrs Deprecated, use node => { ... } instead o edgeattrs Deprecated, use edge => { ... } instead o graphattrs Deprecated, use graph => { ... } instead AUTHOR
Ken Youens-Clark <kclark@cpan.org> Jonathan Yu <frequency@cpan.org> SEE ALSO
SQL::Translator, GraphViz perl v5.14.2 2012-01-18 SQL::Translator::Producer::GraphViz(3pm)
All times are GMT -4. The time now is 09:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy