473,809 Members | 2,780 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 := SomeFieldCalcul ation
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 1264
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 := SomeFieldCalcul ation
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
2730
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 /home/dominator/public_html/footer.php on line 11 MySQL is running with PHP. How could I fix this problem? Thank you for your advise in advance.
12
2786
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 to do the whole job including content, design, graphics and logo. I may want some input or to supply text to work with for the content for obvious reasons. They need to be able to demonstrate that the sites they have done for writers have been...
3
1739
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 loop terminate. I hope that when an duplicate primary key exception thow, my application will keep silence, and continue to work until the loop is complete. How can I do that?
6
2024
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 travel to Indianapolis or within 50 miles of my home. I have some specific questions that I would like answered/explained to me. I would also like to develop a mentoring relationship which would allow me to ask questions in the future as well (for a...
1
1824
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
1272
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. I'm posting this because they are seeking more beta testers, particularly seeking "power-users" who understand the technology.
3
2890
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 s/he should see results in real-time. And I am stuck, do you have any solutions?? Thanks in advance
3
2640
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 IDs, and I can do searching keywords with them) The db-like modules are :
3
4238
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++) { Console.Beep(); ***************** //I have no idea what to put for 1 sec of silence }
0
10376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10387
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10120
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9200
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7662
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4332
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.