visitor (0 QPoints)
  • FR
  • EN
  • NL
  • DE
  • ES
315 experts, 1193 registered users, 1659 questions already answered
European Experts Exchange, the very best site for high-quality IT solutions

New Improved Search!

 


05/10/2011 1h30 : Steve Jobs is dead, the father of Apple ][ is gone, we are all orphaned.

Languages :: Delphi :: How to use a 'describe' statement within a TQuery


By: Lemarin U.S.A.  Date: 18/06/2003 00:00:00  English  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 English  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 English  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 English  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 English  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 English  Type : Comment

Yes, I know, but I've tried "describe" too, and the message is equal...

Do register to be able to answer

EContact
browser fav
page generated in 345.798970 milliseconds

Why Google AdSense ads ?

compteur
 Ranking-Hits PageRank for this page