Sponsored Content
Top Forums UNIX for Advanced & Expert Users writing database tables into a file in unix Post 57755 by dreams5617 on Friday 5th of November 2004 10:15:28 AM
Old 11-05-2004
writing database tables into a file in unix

I want to collect the database tables(Ex: Emp,Sal,Bonus...etc)
in a file & give this file at the command prompt, when prompted for the tables list at command prompt. How can i do that ?

Ex:- Import jason/jason1 tables=emp,sal,bonus log=j1.log
i want to change this into
Ex:- Import jason/jason1 tables=i_tables.txt log=j1.log

where i_tables.txt should contain emp,sal,bonus.
How i can acheive this at the commnad prompt in unix .

Thanks !
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Automating back up of database tables

Hi all, i would like to set a cronjob to back up my db tables. I have written the par file, i would like to know how can i execute a exp command in a shell script. my par file userid=admin/password file=backup.dmp log=backupLOG.log tables= (Tables 1, Tables 2)My cron job script will be... (1 Reply)
Discussion started by: new2ss
1 Replies

2. Shell Programming and Scripting

writing script file for database

how to disable a constraint type of a field (present in diffrent tables) in the database unix a unix script file.. (3 Replies)
Discussion started by: shaksing
3 Replies

3. Shell Programming and Scripting

Tables to query to find users for database from shell script

I am coding shell script. I need to connect to different databases like DB2, Oracle and Sybase. I would then need to query tables where it has all the groups, users for that database. I would also need who has what kind of permissions. EG: I know for DB2 some TABAUTH table needs to be... (0 Replies)
Discussion started by: pinnacle
0 Replies

4. Programming

PHP Script Not Writing Bankfee To Database

The attached file, credits.php, is part of our new (experimental) banking / credits system for this site. I added a field bankfee in credits_transactions but it is not writing to the database (no PHP error). Can someone take a look at the attached PHP file and see if they can find out why... (4 Replies)
Discussion started by: Neo
4 Replies

5. Shell Programming and Scripting

Reading data from DataBase and Writing to a file

Hi All, Please help me in writing data to a file in one row. In database there is a column which contains large data which does not fit in the file in one row. The column contains list of paths. I want to write these paths to a file in one row. Please find the code below writes : ... (2 Replies)
Discussion started by: rajeshorpu
2 Replies

6. Shell Programming and Scripting

Several processes writing to an SQLite database at the same time

I have several bash scripts that write to an SQLite3 database at the same time. At some occasion the database returns: SQL error: database is locked. How would be the best way, to make a process to wait until the data base is 'free' again. I tried: sqlite3 test.db ".timeout 1000; update....."... (2 Replies)
Discussion started by: creamcheese
2 Replies

7. Programming

Dynamically checking rules in database tables using SQL

I want to check for rows in a table where all values (except the key) is empty. I am using MySQL 5.5. I plan to do this mechanically, so the approach should work for any table in my database schema. Suppose for illustration purposes I start with the following table: CREATE TABLE `sources` ( ... (4 Replies)
Discussion started by: figaro
4 Replies

8. UNIX for Dummies Questions & Answers

How to Understand file writing in Progress in UNIX?

Hi All, I have a requirement, where i have to pool file A data to file B continuously and need to process the data in the file B. Since the data need to be processed only once so i have to truncate the data in file A after every pool. So that on the next pooling i can get the fresh data and... (3 Replies)
Discussion started by: mayank2211
3 Replies

9. Shell Programming and Scripting

Script writing for tables with binary data

Hi There, I'm trying to write a simple script that will email me when we have an application job in a certain status that needs human intervention. I've used this script for other tables and it works great. However, this one gives me the warning that there is binary data so it might not. ... (2 Replies)
Discussion started by: Colel2
2 Replies
CLUSTERDB(1)						  PostgreSQL Client Applications					      CLUSTERDB(1)

NAME
clusterdb - cluster a PostgreSQL database SYNOPSIS
clusterdb [ connection-option... ] [ [ --verbose ] [ -v ] ] [ --table | -t table ] [ dbname ] clusterdb [ connection-option... ] [ [ --all ] [ -a ] ] [ [ --verbose ] [ -v ] ] DESCRIPTION
clusterdb is a utility for reclustering tables in a PostgreSQL database. It finds tables that have previously been clustered, and clusters them again on the same index that was last used. Tables that have never been clustered are not affected. clusterdb is a wrapper around the SQL command CLUSTER [cluster(7)]. There is no effective difference between clustering databases via this utility and via other methods for accessing the server. OPTIONS
clusterdb accepts the following command-line arguments: -a --all Cluster all databases. [-d] dbname [--dbname] dbname Specifies the name of the database to be clustered. If this is not specified and -a (or --all) is not used, the database name is read from the environment variable PGDATABASE. If that is not set, the user name specified for the connection is used. -e --echo Echo the commands that clusterdb generates and sends to the server. -q --quiet Do not display progress messages. -t table --table table Cluster table only. -v --verbose Print detailed information during processing. clusterdb also accepts the following command-line arguments for connection parameters: -h host --host host Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. -p port --port port Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. -U username --username username User name to connect as. -w --no-password Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password. -W --password Force clusterdb to prompt for a password before connecting to a database. This option is never essential, since clusterdb will automatically prompt for a password if the server demands password authentica- tion. However, clusterdb will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt. ENVIRONMENT
PGDATABASE PGHOST PGPORT PGUSER Default connection parameters This utility, like most other PostgreSQL utilities, also uses the environment variables supported by libpq (see in the documentation). DIAGNOSTICS
In case of difficulty, see CLUSTER [cluster(7)] and psql(1) for discussions of potential problems and error messages. The database server must be running at the targeted host. Also, any default connection settings and environment variables used by the libpq front-end library will apply. EXAMPLES
To cluster the database test: $ clusterdb test To cluster a single table foo in a database named xyzzy: $ clusterdb --table foo xyzzy SEE ALSO
CLUSTER [cluster(7)] Application 2010-05-14 CLUSTERDB(1)
All times are GMT -4. The time now is 01:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy