Author Topic: Setting shortcut for a particular query  (Read 386 times)

0 Members and 1 Guest are viewing this topic.

Offline paragkalraTopic starter

  • Irregular
  • Posts: 29
  • Gender: Male
    • View Profile
    • paragkalra.com
Setting shortcut for a particular query
« on: September 12, 2009, 01:12:27 AM »
Hello Folks,

Is there a way we can set shortcuts in mysql. Take for instance I use "select * from <mytable>" after every 5 minutes to check the values of various rows.

So I was think if I can get a way to set a shorcut to above query something like 'set myquery =  "select * from <mytable>"

This is should fetch me all the rows from <mytable> after executing "myquery" on "mysql" prompt as shown below:
mysql>myquery

For people knowing Linux - I want something like "alias" command.
Parag.A.Kalra, The Linux Man
http://www.paragkalra.com/
In this world without WALLS and GATES who need WINDOWS! USE LINUX! STOP PIRACY! GO OPEN SOURCE!

Offline corbin

  • Guru
  • Freak!
  • *
  • Posts: 7,951
  • Gender: Male
    • View Profile
Re: Setting shortcut for a particular query
« Reply #1 on: September 12, 2009, 01:41:22 AM »
Errrr....  No I don't think there's any way to do that.
Why doesn't anyone ever say hi, hey, or whad up world?

Offline fenway

  • MySQL Si-Fu / PHP Resident Alien
  • Global Moderator
  • 'Mind Boggling!'
  • *
  • Posts: 15,444
  • Gender: Male
    • View Profile
Re: Setting shortcut for a particular query
« Reply #2 on: September 12, 2009, 05:19:42 PM »
Stored procedures can do this... but why?
:anim_rules: Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.