LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 02-09-2007, 06:36 AM   #1
Robhogg
Member
 
Registered: Sep 2004
Location: Old York, North Yorks.
Distribution: Debian 7 (mainly)
Posts: 653

Rep: Reputation: 85
MySQL 5.0: Can I retrieve the query used to create a view?


I have several views based on complex queries. From time to time I want to alter these, but re-creating the query is tedious (yes, I know, I should have saved them as a script file on my pc).

Is there a way to retrieve the query? Trying describe view; just shows me columns, datatypes, and so on.

Thanks,
Rob
 
Old 02-10-2007, 10:51 AM   #2
mrtwice
Member
 
Registered: Feb 2002
Distribution: xubuntu 8.10
Posts: 225

Rep: Reputation: 31
Quote:
In order to retrieve the query that was used to define a view, we use a new variation on the SHOW CREATE command, as shown here:
Code:
SHOW CREATE VIEW view;
Found here:
http://www.devshed.com/c/a/MySQL/Vie...in-MySQL-50/1/
 
Old 02-13-2007, 06:29 PM   #3
Robhogg
Member
 
Registered: Sep 2004
Location: Old York, North Yorks.
Distribution: Debian 7 (mainly)
Posts: 653

Original Poster
Rep: Reputation: 85
Ah, Grazie Molto. Just what I needed.

Yours,
Rob.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL query Wim Sturkenboom Programming 2 09-05-2006 08:02 AM
PHP script to retrieve records from MYSQL db and pass them to an external program Julianus Programming 3 08-03-2006 02:09 PM
help with mysql query: return nth rows in query hawarden Programming 2 07-31-2006 06:36 PM
Mysql Error: Lost Connection to Mysql during query ramnath Programming 5 11-18-2003 12:27 PM
query DNS and create mysql database nabil Programming 0 01-18-2002 04:42 AM


All times are GMT -5. The time now is 08:51 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration