473,387 Members | 1,742 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Seeking silence!

I just want to assign a variable from a query that returns a single value
result.
The problem is that the following will also emit (print) the result to the
terminal as a side effect.

SELECT @SomeVar := SomeFieldCalculation
FROM ...
WHERE ...

Is there not a simple way to accomplish this silently. IOW - get SELECT to
shut up since it is merely assigning a variable for use further along. Or
is there some other assignment syntax I should use that doesn't involve the
verbose SELECT.

And yes - I do know I can redirect the output to oblivion.

I just think I must be missing something ;-)
Thomas Bartkus
Jun 22 '06 #1
1 1247
It's a bit of a hack, but you can do this:

set @somevar := ( select randomtext from random_table where ... );

Thomas Bartkus wrote:
I just want to assign a variable from a query that returns a single value
result.
The problem is that the following will also emit (print) the result to the
terminal as a side effect.

SELECT @SomeVar := SomeFieldCalculation
FROM ...
WHERE ...

Is there not a simple way to accomplish this silently. IOW - get SELECT to
shut up since it is merely assigning a variable for use further along. Or
is there some other assignment syntax I should use that doesn't involve the
verbose SELECT.

And yes - I do know I can redirect the output to oblivion.

I just think I must be missing something ;-)
Thomas Bartkus


Jun 26 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Ben Sehara | last post by:
Hello, I have the following warning message when I move all the php files to the new server. It had no problem with the former server. Warning: main(): stream does not support seeking in...
12
by: David | last post by:
I am a full-time freelance writer. I am seeking an established, professional web designer who has designed more than one successful website for freelance writers. The individual needs to be able...
3
by: ad | last post by:
I use a loop to insert about 12 record into table: Mybe there are already some records exist in the table, When the duplicate primary key exception thow, my program will show an error page and the...
6
by: Greg M | last post by:
I have 5 years of MS Access/VBA development experience and am moving into the VB.net world. I am seeking a tutor which could facilitate this move. I live in Anderson, IN and am willing to...
1
by: Sakharam Phapale | last post by:
Hi All, I am developing an application like sound recorder. While recording if there is a silence for more than given time (say 5 seconds), Recording should be paused.
0
by: Jsobel | last post by:
Hi all: I downloaded this new Personal Audio Link app. They issued a press release looking for beta testers, with a compensation offer of 6 months free Vonage service for qualified testers. ...
3
by: carthia | last post by:
Hello All, I need to determine speaking time, but without pressing any button (such as start speaking/stop speaking), e.g. how long each person(microphone) was speaking during one meeting, and...
3
by: Jia Lu | last post by:
Hello all I see there are lots of flat db or db-like modules in the standard python modules. What about the keywords seeking speed of them ? (I want to put about 10000 articles with 10000...
3
by: alireza6485 | last post by:
I need to write a C# program that asks for a pattern and for each pattern beeps one and goes silence for 1 second. This is my code: for (int i=0;i< pattern; i++) { ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.