Search code examples
c++coracleoracle-pro-c

Does Pro*C/C++ support "describe [schema.]object" statements?


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?


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.