Languages :: Delphi :: How to use a 'describe' statement within a TQuery |
|||
| By: Lemarin |
Date: 18/06/2003 00:00:00 |
Points: 125 | Status: Answered Quality : Excellent |
|
I want to know if there is a way to write a 'Describe' statement with a TQuery. Example: Desc table1 I know it is dumb, but I can't find this information anywhere. Thanks a lot. |
|||
| By: VGR | Date: 18/06/2003 06:21:00 | Type : Answer |
|
| depends if your DB supports it :D "DESCRIBE tablename;" is a valid SQL query (in MySql for example), so yes, it should pass into a TQuery :D |
|||
| By: moxum | Date: 19/06/2003 20:23:00 | Type : Comment |
|
| Indeed, depends if your database support it. If you are using oracle it is not supported. Desc is an internal sql*plus command and sql*plus will translate it behind the screens. Instead use a normal select statement: select * from all_tab_columns; |
|||
| By: Lemarin | Date: 23/06/2003 22:53:00 | Type : Comment |
|
I've tried it, VGR, but it didn't work. I'm using MySQL Ver 11.18 Distrib 3.23.51, and Delphi reported the folowing error: "Invalid use of keyword. Token: desc" The query I wrote was: desc ":MyDatabase:table1" It appears to be a syntax error... |
|||
| By: VGR | Date: 23/06/2003 22:57:00 | Type : Comment |
|
| DESC is a reserved keyword meaning "desending" in an ORDER BY clause... along with ASC (ascending) The command you search for is DESCRIBE, not "desc" ! |
|||
| By: Lemarin | Date: 23/06/2003 23:10:00 | Type : Comment |
|
Yes, I know, but I've tried "describe" too, and the message is equal... |
|||
|
Do register to be able to answer |
|||
©2010 These pages are served without commercial sponsorship. (No popup ads, etc...). Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Please DO link to this page!








