Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Extracting column names from a table.. SQL with UNIX Post 302226401 by fmina on Tuesday 19th of August 2008 01:52:19 AM
Old 08-19-2008
thank you all

Thank you a lot Vi_Curious and jim!
This itty-bitty line of code works great! Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extracting Table names from a Select Stament

Hi, I am working on a code to extract the table names out of a select statement. Is there anybody who has worked on something similar? May be you could provide me with the regular expression for the same. Regards. Silas (2 Replies)
Discussion started by: silas.john
2 Replies

2. Shell Programming and Scripting

Print column names along with values from SQL

Hi, Can anyone tell me how to print the column name anong with the value from the table in shell script e.g #!/bin/ksh var=`sqlplus scott/tiger << -e set heading off feedback off select * from emp; quit; e` echo $var My output should be; ... (5 Replies)
Discussion started by: thana
5 Replies

3. UNIX for Dummies Questions & Answers

Extracting all table names from a given server

Using ksh and sqlplus... does anybody have an idea of how we can possibly extract all table names from server :confused:? thanks in advance. (6 Replies)
Discussion started by: fmina
6 Replies

4. UNIX for Dummies Questions & Answers

Advice on extracting special characters from a DB2 table to a file in the UNIX ENV

need some advice on the following situation. I have a DB2 table which has a varchar Column. This varchar column can have special characters like ©, ®, ™ . When I extract from this table to a sequential file for this varchar column I am only able to get © and ® . To Get the ™... (1 Reply)
Discussion started by: cosec
1 Replies

5. Shell Programming and Scripting

Show column names when access a table using perl

Hi all, I am using the following code in order to access the data of a table: my $sql = qq{ SELECT * FROM cc_test_cases}; $sth = $dbh->prepare( $sql ); $sth->execute( ); while(@row1 = $sth->fetchrow_array()) { # print "$row1: $row1\n"; print "@row1\n"; #print("THE VALUE... (1 Reply)
Discussion started by: chriss_58
1 Replies

6. Shell Programming and Scripting

updating a column in a unix table for a particular row

Hi, I have the following requirement. I have a unix table as below progname par1 par2 par3 par4 PROG1 abc def 0012 ooo PROG2 wed xas 0100 xxx PROG3 kkk ppp 0004 ppp Different programs(ex:PROG1,PROG2..) accesses this table and update... (5 Replies)
Discussion started by: thanuman
5 Replies

7. Programming

SQL for table with column (varchar2 2000) and line break in it

Hi, I need a sql statement for a table, which simply stores a text. It has a column ID, key1, key2, ..., text, date etc. The text can be entered using a line break (return) in an oracle form. ID key1 key2 text date 1 K1 ... (16 Replies)
Discussion started by: spidermike
16 Replies

8. UNIX for Dummies Questions & Answers

how to find all .sql file names in all .sh unix files

Hi Guys, Can any one help me on this, I want to write unix command to get all .sh unix file name which are refered .sql files in it. Thanks Kolipaka (3 Replies)
Discussion started by: lakshmanrk811
3 Replies

9. UNIX and Linux Applications

UNIX spool command not extracting complete record from the Oracle table

Hello All, I'm trying to spool an oracle table data into a csv file on unix server but the complete record is not being extracted. The record is almost 1000 characters but only 100 characters are being extracted and rest of the data getting truncated. I'm setting below options : SET... (4 Replies)
Discussion started by: venkat_reddy
4 Replies

10. Shell Programming and Scripting

Using Isql for SQL SERVER to get the table rows counts in UNIX shell script to

need to create shell script to read the table's name from file and connect SQL SERVER using isql (odbcunix) i 'm able connect to database with below command line syntex but i could not get working in shell script with SQL and storing the row count in variable. isql -v DSN USERNAME PASSWD ... (6 Replies)
Discussion started by: pimmit22043
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 01:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy