Sponsored Content
Top Forums Shell Programming and Scripting Extract Mysql table output to a log file Post 302465763 by kalyankalyan on Sunday 24th of October 2010 05:21:38 AM
Old 10-24-2010
thanks for ur responce
i first need to extract the table1 output(mysql) to a log file
ex: mysql> select * from table; >> /tmp/logfile
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

extract table name from a control file

Hi, I need to extract the table name from an oracle control file which comes as the last word in the third line. Ex: LOAD DATA INFILE '/home/user/files/scott.dat' INTO TABLE SCOTT.EMP_SAL FIELDS TERMINATED BY.......... what i want to to is write the table name SCOTT.EMP_SAL to a... (2 Replies)
Discussion started by: mwrg
2 Replies

2. Shell Programming and Scripting

Compare file of hostnames with table in MySQL DB

Hi all, i have a list of files that contains some PC hostname, then i need to enumerate every hostname and check if there's a table with same name of the hosts in MySQL database XYZ. I need this because have to decide automatically if i have to make a create table or a insert into an existent... (2 Replies)
Discussion started by: maxlamax
2 Replies

3. UNIX and Linux Applications

missing delimiters when mysql output is redirected to log file

Hi, Pls check that '|' and '+' present in Step-1 are not copied to log file in Step-3. Pls suggest how to get the exact output from Step-1 (i.e. with out losing '|' and '+') in to a log file ~Thanks Step-1: Execute command > mysql -utest -ptest -htesthost testdb -e "select * from... (3 Replies)
Discussion started by: newbielgn
3 Replies

4. Shell Programming and Scripting

connecting to table to extract multiple rows into file from unix script

I need to extract the data from oracle table and written the below code. But it is not working.There is some problem with the query and output is shown is No rows selected" . If I run the same query from sql developer there is my required output. And if I run the shell script with simple sql... (7 Replies)
Discussion started by: giridhar276
7 Replies

5. UNIX for Dummies Questions & Answers

Extract table from an HTML file

I want to extract a table from an HTML file. the table starts with <table class="tableinfo" and ends with next closing table tag </table> how can I do this with awk/sed... ---------- Post updated at 04:34 PM ---------- Previous update was at 04:28 PM ---------- also I want to... (4 Replies)
Discussion started by: koutroul
4 Replies

6. Shell Programming and Scripting

Oracle table extract: all columns are not converting into pipe delimited in flat file

Hi All, I am writing a shell script to extract oracle table into a pipe dilemited flat file. Below is my code and I have attached two files that I have abled to generate so far. 1. Table.txt ==> database extract file 2. flat.txt ==> pipe delimited after some manipulation of the original db... (5 Replies)
Discussion started by: express14
5 Replies

7. Shell Programming and Scripting

I want query output to send on mail using table tag and output should be in table

#! /bin/ksh #] && . ./.profile 2>/dev/null if test -f '.profile'; then . ./.profile; fi; #. .profile LOG_DIR=/app/rpx/jobs/scripts/just/logs sendEmail() { pzCType="$1"; pzTitle="$2"; pzMsg="$3"; pzFrom="$4"; pzTo="$5"; pzFiles="$6"; pzReplyTo="$7" ( ... (21 Replies)
Discussion started by: ankit.mca.aaidu
21 Replies

8. Shell Programming and Scripting

Extract table from file

I need to sort out table in a file to a format below: Input: this is a test example Cat Bee Dat 1 2 3 more Example date data Bet Cla Blaa Dat A 6 T data.. Output: this is a test (10 Replies)
Discussion started by: aydj
10 Replies

9. Shell Programming and Scripting

Mysql output to file

Hi, Below is my code to execute mysql statement , how to save the output to a file ? #!/usr/bin/bash #Script to run automated sql queries #Declaring mysql DB connection MASTER_DB_USER='root' MASTER_DB_PASSWD='root' MASTER_DB_PORT=3306 MASTER_DB_HOST='localhost'... (1 Reply)
Discussion started by: Pratik4891
1 Replies

10. Shell Programming and Scripting

Parameterizing to dynamically generate the extract file from Oracle table using Shell Script

I have below 2 requirements for parameterize the generate the extract file from Oracle table using Shell Script. Could you please help me by modifying the script and show me how to execute it. First Requirement: I have a requirement where I need to parameterize to generate one... (0 Replies)
Discussion started by: hareshvikram
0 Replies
grass-mysql(1grass)						Grass User's Manual					       grass-mysql(1grass)

NAME
grass-mysql - MySQL driver MySQL driver MySQL driver in GRASS MySQL database driver in GRASS enables GRASS to store vector attributes in MySQL server. Because vector attribute tables are created automaticaly when a new vector is written and the name of the table is the same as the name of the vector it is good practice to create a new database for each GRASS mapset. Creating a MySQL database A new database is created within MySQL: mysql> CREATE DATABASE mydb; See the MySQL manual for details. Driver and database name GRASS modules require 2 parameters to connect to a database. Those parameters are 'driver' and 'database'. For MySQL driver the parameter 'driver' should be set to value 'mysql'. The parameter 'database' can be given in two formats: Database name - in case of connection from localhost String of comma separated list of kye=value options. Supported options are: dbname - database name host - host name or IP address port - server port number Examples of connection parameters: db.connect driver=mysql database=mytest db.connect driver=mysql database='dbname=mytest,host=test.grass.org' Data types GRASS supports almost all MySQL data types with following limitations: Binary columns (BINARY, VARBINARY, TINYBLOB, MEDIUMBLOB, BLOB, LONGBLOB) are not not supported. If a table with binary col- umn(s) is used in GRASS a warning is printed and only the supported columns are returned in query results. Columns of type SET and ENUM are represented as string (VARCHAR). Very large integers in columns of type BIGINT can be lost or corrupted because GRASS does not support 64 bin integeres on most platforms. GRASS does not currently distinguish types TIMESTAMP and DATETIME. Both types are in GRASS interpreted as TIMESTAMP. Indexes GRASS modules automaticaly create index on key column of vector attributes table. The index on key column is important for performance of modules which update the attribute table, for example v.to.db, v.distance and v.what.rast. Privileges Because MySQL does not support groups of users and because only MySQL 'root' can grant privileges to other users GRASS cannot automaticaly grant select privileges on created tables to group of users. If you want to give privilege to read data from your mapset to other users you have to ask your MySQL server administrator to grant select privilege to them on the MySQL database used for that mapset. For example, to allow everybody to read data in from your database 'mydb': shell> mysql --user=root mysql mysql> GRANT SELECT ON mydb.* TO ''@'%'; Schemas Because MySQL does not support database schemas the parameter 'schema' of module db.connect should never be set to any value. If you set that parameter for MySQL driver GRASS will try to write tables to the specified schema which will result in errors. Groups MySQL does not support user groups. Any settings specified by 'group' parameter of module db.connect are ignored by GRASS for MySQL driver. SEE ALSO
db.connect, SQL support in GRASS GIS Credits Development of the driver was sponsored by Faunalia (Italy) as part of a project for ATAC. AUTHOR
Radim Blazek Last changed: $Date: 2011-02-07 18:59:50 +0100 (Mon, 07 Feb 2011) $ Help Index GRASS 6.4.2 grass-mysql(1grass)
All times are GMT -4. The time now is 01:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy