At 10:29 -0800 2/23/05, Nupur Jain wrote:
I am executing a mysql query through shell and expecting to see a return of SQL execution.

mysql -D $dbName --vertical -u $DBUSER -p$DBPASS < $queryFile > $opFile
rc=$?

Here rc is always 0 and so are $opFile entries. $queryFile contains exactly the same query as listed below.


If the same query is run in mysql client, I see the result as "Empty set (0.00 sec)". Why don't I get a return in shell.


mysql> select * from usrtbl where username='vou_0004016';
Empty set (0.00 sec)

The verbosity of mysql changes when its input isn't the terminal. You can increase it with -v:

% echo select 1 |mysql
1
1
% echo select 1 | mysql -v
--------------
select 1
--------------

1
1
% echo select 1 | mysql -vv
--------------
select 1
--------------

1
1
1 row in set

Bye
% echo select 1 | mysql -vvv
--------------
select 1
--------------

+---+
| 1 |
+---+
| 1 |
+---+
1 row in set (0.00 sec)

Bye

--
Paul DuBois, MySQL Documentation Team
Madison, Wisconsin, USA
MySQL AB, www.mysql.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to