Question

I can't prepare this statement in my Pro*C code. When I running this statement I get this error:

SQLERROR: ORA CODE: -900 MSG: ORA-00900: invalid SQL statement

Is there a way to exec this statement with EXEC SQL?

Was it helpful?

Solution

No, you can't do that because describe is a SQL*Plus command (under the covers it queries the data dictionary).

If you need to actually describe a table, in order to programmatically interpret columns and datatypes of a columns, you'll need to do dynamic SQL method 4.

See this link for a good description: http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10825/pc_15ody.htm#i22863

Hope that helps.

OTHER TIPS

You shouldn't call the describe function, or try to.

Use the information schema views or the other oracle specific views such as all_tab_columns, so you can get the schema meta data in a consumable format to your application.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top