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
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
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
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
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
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
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
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
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
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
LEARN ABOUT DEBIAN
dbs_dumptabdata
DBS_DUMPTABDATA(1p) User Contributed Perl Documentation DBS_DUMPTABDATA(1p)
NAME
dbs_dumptabdata - Creates file set with SQL table data
DESCRIPTION
dbs_dumptabdata is an utility to create a file set with SQL table data. For each table in the database dbs_dumptabdata calls the appropri-
ate dumper utility with the output directed to a file named table.sql in the current directory. dbs_dumptabdata asks for a password if nec-
essary.
COMMAND LINE PARAMETERS
Required command line parameters are the DBI driver ("Pg" for Postgres or "mysql" for MySQL) and the database name. The third parameter is
optionally and specifies the database user and/or the host where the database resides ("racke", "racke@linuxia.de" or "@linuxia.de").
COMMAND LINE OPTIONS
-t TABLE[,TABLE,...], --tables=TABLE[,TABLE,...]
Comma-separated list of tables to dump.
--exclude-matching-tables=REGEXP
Excludes any table matching the regular expression REGEXP from dumping.
--use-printtab
Uses generic dump (similar to "dbs_printtab") instead of the dumper utility provided by the DBMS.
BUGS
msql is not supported.
AUTHOR
Stefan Hornburg (Racke), racke@linuxia.de
SEE ALSO
perl(1), DBIx::Easy(3)
perl v5.8.8 2007-02-01 DBS_DUMPTABDATA(1p)