Hi,
i would like to retrieve seql result and write it into unix text file like "result.txt"
In unix, normally, I type "sql" and get into sql,then type "select....." to run and get the result....then copy and paste into result.txt
any possible way to write a script to run it automatically?... (3 Replies)
Hi,
I search all post...and no soluation about..if i would like to run a sql statement and output the result to txt file.
for example,
i usually run "sql" to logon the database and run select statement. Then I need to copy the output into the result.txt. Can I run the script to do this... (7 Replies)
Hi,
I have about 12 columns and 15 rows to be retrived from sybase isql command through unix. But when i output the sql into a file and see it, the formatting is going for a toss. can someone please suggest how can i get the result correctly in the output file ?
Thanks,
Sateesh (2 Replies)
Hi Friends...
Please assist me to assign the result of a SQL query that results two column, to two variables.
Pls find the below code that I write for assigning one column to one variable. and please correct if anything wrong..
#! /bin/sh
no='
sqlplus -s uname/password@DBname... (4 Replies)
Hi,
I want to write the shell script to change multple file name (the file name is get from DB)
e.g. cp db1.txt file1_new.txt
cp db2.txt file2_new.txt
cp db3.txt file3_new.txt
I have write the script like this:
VAR=`sqlplus -s $LOGON @<<ENDOFTEXT
set termout off
... (0 Replies)
I am currently returning an sql result with a number value that I want to format as an amount. The sql runs smoothly on its own, but when run inside my ksh script an error is encountered:
ERROR at line 3:
ORA-01481: invalid number format model
My sql is --
select distinct
... (6 Replies)
Hi all,
Very new to shell scripting so appreciate some help!
There is a process count that I need to monitor, I have the AIX command that gives this value and I've cleaned it up with grep/awk so it only spits out the value I'm interested in:
echo "psc -i 10050 -s RELOAD_SERVICE" | tmadmin... (14 Replies)
Hi
im trying to assign the result of the db2 command to a variable inside a shell script...
: tab_cnt=`db2 "select count(*) from syscat.tables where tabname = 'ABC' and tabschema = 'MATT01'" |head -4|tail +4|cut -c 11`
: echo $tab_cnt
when i echo im getting a blank value.. im expecting... (1 Reply)
I just wish to extract the result onli... but I dont which edit to perform to start from (**) :wall:
Current display result
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Sep 24 14:14:49 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g... (4 Replies)
Hi ALL,
How can I make a script take data from a file and execute the commands within `` in the file n put that that in a variable?
for i in `cat file`
do
file=`grep -i key file`
cp ${file} test
done
file
/tmp/`date +y`log
/tmp/unix`date +y`log (1 Reply)
Discussion started by: 3junior
1 Replies
LEARN ABOUT DEBIAN
isql
isql(1) UnixODBC Reference isql(1)NAME
isql - utility to submit SQL queries to a data source.
iusql - Unicode version of isql.
SYNOPSIS
isql DSN [UID [PWD]] [options]
DESCRIPTION
isql can be used to submit SQL to a data source and to format/output results. It can be used in batch or interactive mode.
OPTIONS
DSN Name of the data source you want to connect to.
UID Your login to connect the DSN.
PWD Your password needed to login to the DSN.
-b Batch mode. It will not do any prompting.
-dx Delimit columns with x.
-x0xXX Delimit columns with XX, where XX is in hex. For example -x0x09 will use a tab.
-w Wrap results in an HTML table
-c Print column names on first row. This options only has effect in combination with the -d option.
-mn Limit column display width to n
-v Verbose output.
--version
This prints the version.
EXAMPLES
cat My.sql | isql WebDB MyID MyPWD -w
Each line in My.sql must contain exactly 1 SQL command except for the last line which must be blank.
AUTHOR
This manual page was written by Kurt Roeckx <kurt@roeckx.be> for the Debian package of unixODBC.
UnixODBC Dec 2004 isql(1)