SQL Column Heading


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting SQL Column Heading
# 8  
Old 05-26-2015
Moderator's Comments:
Mod Comment This thread has been moved as suggested by cero.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Joining Columnar heading from 2 lines

Hi, Below is the format of a report generated by a custom reporting solution. I opened the report in Notepad++ and junked data and values as in the image below. https://www.unix.com/attachment.php?attachmentid=7907&stc=1&d=1575507708 I want to convert the values to a PIPE delimited format as... (2 Replies)
Discussion started by: ramkrix
2 Replies

2. Shell Programming and Scripting

Need heading in files

Hi All, The below code is splitting the file "data.csv" into several files based on the"client_code" column. date_yyyymmdd=$(my_date "" -e"%Y%m%d") file_format="_$date_yyyymmdd.csv awk '{print $2, $3> DIR"/clients_" $1 file_out}' FS=' *; *' OFS=";" DIR="$TEMPL" file_out="_$file_format"... (3 Replies)
Discussion started by: ROCK_PLSQL
3 Replies

3. UNIX for Dummies Questions & Answers

Replacing "." with "GG" in a certain column of a file that has heading

Hi, all, I have a file that looks like: ## XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ## YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY #AA AB AC AD AE AF AG AH AI AJ AK AL 20 60039 60039 ... (5 Replies)
Discussion started by: kush
5 Replies

4. Shell Programming and Scripting

Script to get the heading in files along with data

Hi everyone, I have a file which has data with different heading and column names as below. Static Data Ingested ,,,,,,,,,,,,Known Explained Rejections Column_1,column_2,Column_3,Column_4,,Column_6,Column_7,,% Column_8,,Column_9 ,Column_10... (1 Reply)
Discussion started by: Vivekit82
1 Replies

5. Shell Programming and Scripting

Column not allowed, when I am writing sql in UNIX

Please advice to rectify below error #!/bin/ksh X=$(sqlplus -s user/pass << EOSQL set serveroutput on; set heading off feedback off serveroutput on trimout on pagesize 0 INSERT INTO TEST(df) VALUES('a'); COMMIT; EXIT; EOSQL) echo $X echo $? ERROR at line 2: ORA-00984: column not... (1 Reply)
Discussion started by: mirwasim
1 Replies

6. Shell Programming and Scripting

SQL sorrting issue, and unwanted blank line above heading

Hi, I am running a shell script on Compaq Tru64 UNIX V5.1A. I have attached the shill script with the sql script it is calling to extract some data(hyp_dta_Extr.sql), and the results. I need the file to be tab delimited. (please note that I have renamed hyp_dta_Extr.sql to hyp_dta_Extr.txt to... (1 Reply)
Discussion started by: dazz
1 Replies

7. Shell Programming and Scripting

SQL select all but not if it is already in an other column

I know I know.. for sure one of the easier mysql statements. But somehow I can not figure out this. I expect to see all distinct items of 'data_12' where 'kwroot' has 'straxx' in, and in the same row 'data_12' ist (not = 'kwsearched' in any existing row) data_12 ... (6 Replies)
Discussion started by: lowmaster
6 Replies

8. UNIX for Dummies Questions & Answers

Extracting column names from a table.. SQL with UNIX

:rolleyes: hi there everybody, i need help,... thanks anyway! i am working on a very huge table with the name table1. the problem is that i know only one field name in this table..., working with a ksh environment i don't know how to view the table to check out the field names :confused:. ... (4 Replies)
Discussion started by: fmina
4 Replies

9. 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

10. UNIX for Dummies Questions & Answers

What is the command to add heading to a file?

Hi, I'd like to add one line to the top of my file. I know there is a command to be able to do it. But I forgot ...... Please help if you can .... (3 Replies)
Discussion started by: whatisthis
3 Replies
Login or Register to Ask a Question
DBSchema::Column(3pm)					User Contributed Perl Documentation				     DBSchema::Column(3pm)

NAME
DBIx::DBSchema::Column - Column objects SYNOPSIS
use DBIx::DBSchema::Column; #named params with a hashref (preferred) $column = new DBIx::DBSchema::Column ( { 'name' => 'column_name', 'type' => 'varchar' 'null' => 'NOT NULL', 'length' => 64, 'default' => '', 'local' => '', } ); #list $column = new DBIx::DBSchema::Column ( $name, $sql_type, $nullability, $length, $default, $local ); $name = $column->name; $column->name( 'name' ); $sql_type = $column->type; $column->type( 'sql_type' ); $null = $column->null; $column->null( 'NULL' ); $column->null( 'NOT NULL' ); $column->null( '' ); $length = $column->length; $column->length( '10' ); $column->length( '8,2' ); $default = $column->default; $column->default( 'Roo' ); $sql_line = $column->line; $sql_line = $column->line($datasrc); $sql_add_column = $column->sql_add_column; $sql_add_column = $column->sql_add_column($datasrc); DESCRIPTION
DBIx::DBSchema::Column objects represent columns in tables (see DBIx::DBSchema::Table). METHODS
new HASHREF new [ name [ , type [ , null [ , length [ , default [ , local ] ] ] ] ] ] Creates a new DBIx::DBSchema::Column object. Takes a hashref of named parameters, or a list. name is the name of the column. type is the SQL data type. null is the nullability of the column (intrepreted using Perl's rules for truth, with one exception: `NOT NULL' is false). length is the SQL length of the column. default is the default value of the column. local is reserved for database-specific information. Note: If you pass a scalar reference as the default rather than a scalar value, it will be dereferenced and quoting will be forced off. This can be used to pass SQL functions such as "now()" or explicit empty strings as '' as defaults. name [ NAME ] Returns or sets the column name. type [ TYPE ] Returns or sets the column type. null [ NULL ] Returns or sets the column null flag (the empty string is equivalent to `NOT NULL') length [ LENGTH ] Returns or sets the column length. default [ LOCAL ] Returns or sets the default value. local [ LOCAL ] Returns or sets the database-specific field. table_obj [ TABLE_OBJ ] Returns or sets the table object (see DBIx::DBSchema::Table). Typically set internally when a column object is added to a table object. table_name Returns the table name, or the empty string if this column has not yet been assigned to a table. line [ DATABASE_HANDLE | DATA_SOURCE [ USERNAME PASSWORD [ ATTR ] ] ] Returns an SQL column definition. The data source can be specified by passing an open DBI database handle, or by passing the DBI data source name, username and password. Although the username and password are optional, it is best to call this method with a database handle or data source including a valid username and password - a DBI connection will be opened and the quoting and type mapping will be more reliable. If passed a DBI data source (or handle) such as `DBI:mysql:database' or `DBI:Pg:dbname=database', will use syntax specific to that database engine. Currently supported databases are MySQL and PostgreSQL. Non-standard syntax for other engines (if applicable) may also be supported in the future. quoted_default DATABASE_HANDLE Returns this column's default value quoted for the database. sql_add_column [ DBH ] Returns a list of SQL statements to add this column to an existing table. (To create a new table, see "sql_create_table" in DBIx::DBSchema::Table instead.) The data source can be specified by passing an open DBI database handle, or by passing the DBI data source name, username and password. Although the username and password are optional, it is best to call this method with a database handle or data source including a valid username and password - a DBI connection will be opened and the quoting and type mapping will be more reliable. If passed a DBI data source (or handle) such as `DBI:Pg:dbname=database', will use PostgreSQL-specific syntax. Non-standard syntax for other engines (if applicable) may also be supported in the future. sql_alter_column PROTOTYPE_COLUMN [ DATABASE_HANDLE | DATA_SOURCE [ USERNAME PASSWORD [ ATTR ] ] ] Returns a list of SQL statements to alter this column so that it is identical to the provided prototype column, also a DBIx::DBSchema::Column object. Optionally, the data source can be specified by passing an open DBI database handle, or by passing the DBI data source name, username and password. If passed a DBI data source (or handle) such as `DBI:Pg:dbname=database', will use PostgreSQL-specific syntax. Non-standard syntax for other engines (if applicable) may also be supported in the future. If not passed a data source (or handle), or if there is no driver for the specified database, will attempt to use generic SQL syntax. sql_drop_column [ DBH ] Returns a list of SQL statements to drop this column from an existing table. The optional database handle or DBI data source/username/password is not yet used. AUTHOR
Ivan Kohler <ivan-dbix-dbschema@420.am> COPYRIGHT
Copyright (c) 2000-2006 Ivan Kohler Copyright (c) 2007-2010 Freeside Internet Services, Inc. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. BUGS
The new() method should warn that "Old-style $class creation without named parameters is deprecated!" Better documentation is needed for sql_add_column sql_alter_column() has database-specific foo that should be abstracted info DBIx::DBSchema::DBD::Pg nullify_default option should be documented SEE ALSO
DBIx::DBSchema::Table, DBIx::DBSchema, DBIx::DBSchema::DBD, DBI perl v5.14.2 2010-03-26 DBSchema::Column(3pm)