This is a discussion on Nested Query with DESCRIBE within the MySQL forums, part of the Database Server Software category; --> Hello, guys. Is that possible? I would like to retrieve a name of a column in order to process ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hello, guys. Is that possible? I would like to retrieve a name of a column in order to process it then in my program. What I have written, was: 'select Field from (describe My_Table);' But MySQL answered with: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'describe My_Table)' at line 1 So, what did I wrong? I can't see Greetings Ewgenij P.S. Do not write I should use the Information_Schema table, I know that no such table in this version. |
| |||
| On Thu, 12 Jun 2008 09:52:07 +0200, Ewgenij Sokolovski <ewgenijkkg@compuserve.de> wrote: > Hello, guys. Is that possible? I would like to retrieve a name of a > column in order to process it then in my program. What I have written, > was: > > 'select Field from (describe My_Table);' > > But MySQL answered with: > > You have an error in your SQL syntax; check the manual that > corresponds to your MySQL server version for the right syntax to use > near 'describe My_Table)' at line 1 AFAIK, you can't nest the DESCRIBE / SHOW commands as a subquery, or even JOIN them for that matter. Why do you need to? This example just strips some small unneeded data, which you could easily ignore in you application. > P.S. Do not write I should use the Information_Schema table, I know > that > no such table in this version. Alas. -- Rik Wasmus ....spamrun finished |
| ||||
| > AFAIK, you can't nest the DESCRIBE / SHOW commands as a subquery, or even * > JOIN them for that matter. That's sad Why do you need to? This example just strips * > some small unneeded data, which you could easily ignore in you application.. > Yeah, sure, I can write a workaround, but I wondered if it is possible to implement the feature on the direct SQL way. Would look nicer OK, if that's not possible I have to program the other way. |
| Thread Tools | |
| Display Modes | |
|
|