06-15-2010
I guess that's a basic task using sqlpus to connect, fire off your sql stament which would be a SELECT and then either use some switch of sqlplus to define an output file or just redirect it to an output file. There should be plenty of examples on the web. Strange you did not find any.
My 1st result on Google entering "sqlplus script":
http://www.orafaq.com/wiki/SQL*Plus_FAQ
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am trying to transpose tables listed in the format into format. Any help would be greatly appreciated.
Input:
test_data_1
1 2 90%
4 3 91%
5 4 90%
6 5 90%
9 6 90%
test_data_2
3 5 92%
5 4 92%
7 3 93%
9 2 92%
1 1 92%
...
Output:... (7 Replies)
Discussion started by: justthisguy
7 Replies
2. Shell Programming and Scripting
I need to write a script to store the contents of a table in a csv file
I'm using Toad, it's a Oracle database. (5 Replies)
Discussion started by: ladyAnne
5 Replies
3. Shell Programming and Scripting
Hi,
I have a sybase stored procedure which takes two input parameters (start_date and end_date) and when it get executed, it gives few records as an output.
I want to write a unix script (ksh) which login to the sybase database, then execute this stored procedure (takes the input parameter as... (8 Replies)
Discussion started by: amit.mathur08
8 Replies
4. Shell Programming and Scripting
Hi ,
I have a query like
select err_qty,drop_qty,unbld_qty,orig_qty from usage_data;
I need to store the values of these fetched fields in variables,
Need to edit them and update the new values into the table.
Can anyone please help me in writing this piece of code:( (1 Reply)
Discussion started by: Rajesh Putnala
1 Replies
5. Shell Programming and Scripting
Dear All,
I am using the command to find the value from path
DYMV_STD_NAME=$( echo $file | sed 's#.*/*_\(*\).*#\1#' )
file = RRK11234_RKY5807_SRY000_HOME_20071010.zip
It give me value DYMV_STD_NAME = RKY5807
Now i have flat as below
The contect of the file would be as below.
... (1 Reply)
Discussion started by: yadavricky
1 Replies
6. Shell Programming and Scripting
I want to write a unix shellScript should store the csv files. into a paticular folder (2 Replies)
Discussion started by: RaghavendraT
2 Replies
7. Shell Programming and Scripting
Hi, I am newbie in shell script.
I need your help to solve my problem.
Firstly, I have 2 files of csv and i want to compare of the contents then the output will be written in a new csv file.
File1:
SourceFile,DateTimeOriginal
/home/intannf/foto/IMG_0713.JPG,2015:02:17 11:14:07... (8 Replies)
Discussion started by: refrain
8 Replies
8. Shell Programming and Scripting
I have the data in csv in 3 tables. how can I output the same into 3 tables in html.also how can I set the width. tried multiple options . attached is the format.
#!/bin/ksh
awk 'BEGIN{
FS=","
print "<HTML><BODY><TABLE border = '1' cellpadding=10 width=100>"
print... (7 Replies)
Discussion started by: archana25
7 Replies
9. Shell Programming and Scripting
I have a CSV file with hdfs directories, hive tables and hbase tables.
1. first column - hdfs directories
2. second column - hive tables
3. third column - hbase tables
I have to check the csv file and look for the first column and delete the hdfs directory from the hdfs path, now... (2 Replies)
Discussion started by: shivamayam
2 Replies
10. UNIX for Beginners Questions & Answers
Hello All,
just wanted to export multiple tables from oracle sql using unix shell script to csv file and the below code is exporting only the first table.
Can you please suggest why? or any better idea?
export FILE="/abc/autom/file/geo_JOB.csv"
Export= `sqlplus -s dev01/password@dEV3... (16 Replies)
Discussion started by: Hope
16 Replies
LEARN ABOUT DEBIAN
datacopy
datacopy(1) FreeTDS Utilities datacopy(1)
NAME
datacopy - move table data between two servers
SYNOPSIS
datacopy { -t | -a | -c owner } [-b batchsize] [-p packetsize] [-v] [-d]
[-S server/username/password/database/table_or_view]
[-D server/username/password/database/table]
DESCRIPTION
datacopy is a utility distributed with FreeTDS. datacopy will move table data from one server to another without the need for intermediate
files. datacopy is much faster and more efficient than is freebcp out/in.
datacopy makes use of the db-lib bcp API built into FreeTDS. This API is also available to application developers.
datacopy can be used to migrate data between Sybase ASE and SQL Server or vice versa.
OPTIONS
-t Truncate target table before loading data.
-a Append data to target table.
-c owner
Create the target table with the same schema as the source table. datacopy will submit a 'create table' command on the target
server/database using the specified owner in
the command, e.g. CREATE TABLE owner.table (...).
-b batchsize
The number of rows per batch of data copied. Each batch of data is effectively 'committed' to the database. The default is 1000.
-p packetsize
The number of bytes, per network packet, sent to and from the servers. Increased packet size can enhance performance.
-v Produce verbose output, including diagnostic timings.
-d Produce freetds TDSDUMP output. (Serious debug only!)
-S server/username/password/database/table_or_view
The connection information for the source server and the location/name of the table (or view) to be copied. If not specified, data-
copy will prompt the user for the information.
-D server/username/password/database/table
The connection information for the destination server and the location/name of the target table. If not specified, datacopy will
prompt the user for the information.
SEE ALSO
freebcp(1), defncopy(1), bsqldb(1), tsql(1), FreeTDS User Guide.
HISTORY
datacopy first appeared in FreeTDS 0.64.
AUTHORS
The datacopy utility was written by Bill Thompson (thompbil@exchange.uk.ml.com).
doc 13 November 2011 datacopy(1)