02-11-2010
Yes, works great!
Many thanx!
EDIT:
Yes works great, but now, when I use this on about 2000 rows of data I get this: "Database has gone away..."
or the statement takes more than one minute to execute for both examples.
Is there something I can do to optimize?
Last edited by lowmaster; 02-11-2010 at 09:28 PM..
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello
I would like to perform a select from a oracle table and return those values to my shell script
For example:
site=head -1 $infile | cut -c1-15 | awk '{printf "s%", $0}
sqlplus -s /nolog |& #Open pipe to sql
select col1, col2, col3, col4
from oracle_table
where col5 =... (6 Replies)
Discussion started by: houtakker
6 Replies
2. Shell Programming and Scripting
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)
Discussion started by: kotasateesh
2 Replies
3. Web Development
I have following.
.
.
.
$userid = 2
.
$query = "select username from users where userid = ".$userid.";";
.
$username = $line;
$data="Some Data Here";
.
$query = "insert into logger (username, data) valuse ($username, $data);";
.
I would like to not have 2 database calls. (3 Replies)
Discussion started by: Ikon
3 Replies
4. Shell Programming and Scripting
Dear All ,
I have file1.txt contain values like the following:
----------
23
24
25
and I have shell script which has the following :
more file1.txt | awk '{print "select 'DUMP',CODE1||'|'||CODE2||'|'||CODE3 from CODE where CODE1='" $1 "';"}' > file2.sql
all I need is to have the... (6 Replies)
Discussion started by: habuzahra
6 Replies
5. Shell Programming and Scripting
count.sh#!/bin/ksh
SQL1=`sqlplus -s usr/pwd @count.sql $1 $2 $3`
SQL2=`sqlplus -s usr/pwd @selectall.sql $1 $2 $3`
LIST="Count Select_All"
select i in $LIST
do
if
then
echo $SQL1
elif
then
echo $SQL2
fi
done (2 Replies)
Discussion started by: killboy
2 Replies
6. Shell Programming and Scripting
Hi there
I have a database on a remote box and i have been using shell script to insert data into it for example, i could have a script that did this
SN=123456
n=server1
m=x4140
sql="UPDATE main SET hostname='$n',model='$m' WHERE serial='$SN';"
echo $sql |/usr/sfw/bin/mysql -h... (4 Replies)
Discussion started by: hcclnoodles
4 Replies
7. Programming
Hello people,
as wrote in title I'm going crazy with a "complex" SQL select.
This is the seelct:
select T_ADDRESS, T_MCC,T_MNC,T_MSIN,T_IM_MNC, COUNT(*) FROM TABLETEST
WHERE T_MCC=123 AND (T_MNC=11 OR T_MNC=01)
GROUP BY T_ADDRESS,T_MCC,T_MNC,T_MSIN,T_IM_MNC HAVING count(*) > 5;This select... (7 Replies)
Discussion started by: Lord Spectre
7 Replies
8. Programming
Hi All,
I had a query related to sql select update replace command.
i have a table named clusters and it looks like this
name model characteristics
sample1.1 +123 parent
sample1.2 -456 clone
sample1.3 +122 ... (5 Replies)
Discussion started by: sonia102
5 Replies
9. Programming
Hi All,
I had a query related to sql select replace command.
i have a table named clusters and it looks like this
Code:
name characteristics
sample 1.1 parent
sample 1.2 ... (2 Replies)
Discussion started by: siya@
2 Replies
10. Shell Programming and Scripting
Hi Forum.
Need your expertise on the following question.
I have the following file which I would like to parse, find first block of SELECT statment and concatenate all input fields as 1 field (~ delimited):
Old File:
SELECT /*+ USE_HASH(CCOMM ICAR IMAP IAS IP IMAS IMPS IAP SPCA) */
... (5 Replies)
Discussion started by: pchang
5 Replies
LEARN ABOUT DEBIAN
cvm-mysql
cvm-mysql(8) System Manager's Manual cvm-mysql(8)
NAME
cvm-mysql - MySQL module
SYNOPSIS
cvm-mysql
CREDENTIALS
Pass phrase
DESCRIPTION
This module queries a MySQL database for the account name, compares the stored pass phrase with the given one using crypt(3).
CONFIGURATION VARIABLES
CVM_MYSQL_DEFAULT_FILE
The full path of the defaults file to read if the following variable is set. If not set, the file $HOME/.my.cnf will be read (the
MySQL default).
CVM_MYSQL_DEFAULT_GROUP
If set, the module will read connection default options from the named group in the defaults file as above
CVM_MYSQL_HOST
The hostname or IP of the MySQL server. If not set, a connection to the local host is assumed.
CVM_MYSQL_USER
The MySQL login ID to connect as. If not set, the invoking user is assumed.
CVM_MYSQL_PASS
The password for the above user.
CVM_MYSQL_DB
The database name, must be set.
CVM_MYSQL_PORT
The port number for the TCP/IP connection (only used if the server is not local).
CVM_MYSQL_POSTQ (optional)
The SQL query to execute after the credentials have been validated, see cvm-sql(7).
CVM_MYSQL_PWCMP (optional)
The password comparison module to use.
CVM_MYSQL_SOCKET
The path to the socket that should be used for connections to a local server.
CVM_MYSQL_QUERY (optional)
The SQL query to issue to retrieve the row containing the account information from the database, see cvm-sql(7).
SEE ALSO
cvm-sql(7), cvm-pgsql(8), cvm-pwfile(8), cvm-qmail(8), cvm-unix(8), cvm-vmailmgr(8), cvm-benchclient(8), cvm-checkpassword(8), cvm-test-
client(8)
http://untroubled.org/pwcmp/pwcmp.html
http://untroubled.org/cvm/cvm.html
cvm-mysql(8)