Sponsored Content
Top Forums Shell Programming and Scripting How to get and process mysql result set in shell script Post 302340270 by ashok1979 on Monday 3rd of August 2009 06:25:28 AM
Old 08-03-2009
How to get and process mysql result set in shell script

Hi All,
I am in a problem here is the description,
Actually in my shell script i am firing a mysql query which returns multiple records and i have to process each record one by one.
So could any one please suggest me how to solve my problem?
Thanks in Advance
Ashok Sharma
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

In a csh script, can I set a variable to the result of an SQLPLUS select query?

Can someone tell me why I'm getting error when I try to run this? #!/bin/csh -f source ~/.cshrc # set SQLPLUS = ${ORACLE_HOME}/bin/sqlplus # set count=`$SQLPLUS -s ${DB_LOGIN} << END select count(1) from put_groups where group_name='PC' and description='EOD_EVENT' and serial_number=1;... (7 Replies)
Discussion started by: gregrobinsonhd
7 Replies

2. Shell Programming and Scripting

shell script result to file

Since I'm not an expert in shell scripting, I have question on sending script result to file. I have script like this... if condition=0: then echo "service is not running" | mail -s "Server Status" uname@companyname fi sleep 10 if configtion=1: then echo "service is not running" | mail -s... (3 Replies)
Discussion started by: s_linux
3 Replies

3. Homework & Coursework Questions

A function in shell script,how can i get the right result

there is a directory /data/users/osa/psidp/dmp/files/cimdir ,it have some subdirectories ,and also the subdirectoriy have it's subdirectoriis. I want to get all the leaf nodes of the directory path . but the result of the script is wrong ,how can i get the right result somebody who can help... (1 Reply)
Discussion started by: fw0037
1 Replies

4. Shell Programming and Scripting

a function in shell script,how can i get the right result

there is a directory /data/users/osa/psidp/dmp/files/cimdir ,it have some subdirectories ,and also the subdirectoriy have it's subdirectoriis. I want to get all the leaf nodes of the directory path . but the result of the script is wrong ,how can i get the right result somebody who can... (1 Reply)
Discussion started by: fw0037
1 Replies

5. Shell Programming and Scripting

A function in shell script,how can i get the right result

there is a directory /data/users/osa/psidp/dmp/files/cimdir ,it have some subdirectories ,and also the subdirectoriy have it's subdirectoriis. I want to get all the leaf nodes of the directory path . but the result of the script is wrong ,how can i get the right result somebody who can help me... (3 Replies)
Discussion started by: fw0037
3 Replies

6. Shell Programming and Scripting

How do i access sybase using isql and how do i get result set in perl script?

Hi, How do i get result set in perl script using isql while connecting sybase server. I have a perl script which connected to sybase and get the result set. but i wanted to get the result set. How do i get the result set in perl script not unix shell script.. $server ="ServerName"; open... (1 Reply)
Discussion started by: solo123
1 Replies

7. Shell Programming and Scripting

shell script - unexpected result

I hv a file --am executing a script which is giving me unexpected results COntents of file: f1 CMT_AP1_CONT:/opt/sybase/syboc125:150:ASE12_5::Y:UX: CMT_AP1:/opt/sybase/syboc125:150:ASE12_5::Y:UX f1.tmp CMT_AP1_CONT:/opt/sybase/syboc125:150:ASE12_5::Y:UX:... (2 Replies)
Discussion started by: rajashekar.y
2 Replies

8. Programming

Query result from shell script

Hi, I wrote the below script to get the query result from a Syabase DB. isql -s -U **** -P **** SYBASE SERVERNAME USE ***(Database name in Sybase) @command.sql But im not getting the output. Can anyone help me on this (2 Replies)
Discussion started by: rohan G
2 Replies

9. Shell Programming and Scripting

Help needed with shell script to search and replace a set of strings among the set of files

Hi, I am looking for a shell script which serves the below purpose. Please find below the algorithm for the same and any help on this would be highly appreciated. 1)set of strings need to be replaced among set of files(directory may contain different types of files) 2)It should search for... (10 Replies)
Discussion started by: Amulya
10 Replies
mysql(1)							  MySQL database							  mysql(1)

NAME
mysql_fix_privilege_tables - Fixes MySQL privilege tables. SYNOPSIS
mysql_fix_privilege_tables [mysql_root_password] DESCRIPTION
This scripts updates the mysql.user, mysql.db, mysql.host and the mysql.func tables to MySQL 3.22.14 and above. This is needed if you want to use the new GRANT functions, CREATE AGGREGATE FUNCTION or want to use the more secure passwords in 3.23 If you get 'Access denied' errors, run the script again and give the MySQL root user password as an argument. SEE ALSO
isamchk(1), isamlog(1), mysql(1), mysqlaccess(1), mysqladmin(1), mysqld(1), mysqld_multi(1), mysqld_safe(1), mysqldump(1), mysqlshow(1), mysql_zap(1), perror(1), replace(1) For more information please refer to the MySQL reference manual, which may already be installed locally and which is also available online at http://www.mysql.com/doc/en/ BUGS
Please refer to http://bugs.mysql.com/ to report bugs. AUTHOR
This manpage was written by Christian Hammers <ch@debian.org>. MySQL is available at http://www.mysql.com/. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +--------------------+------------------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +--------------------+------------------------------------+ |Availability | SUNWmysqlr, SUNWmysqlu, SUNWmysqlt | +--------------------+------------------------------------+ |Interface Stability | External | +--------------------+------------------------------------+ NOTES
Source for mysql is available on http://opensolaris.org. MySQL 4.0 17 March 2003 mysql(1)
All times are GMT -4. The time now is 11:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy