Last post Jan 27, 2013 10:13 AM by Lannie
Jan 17, 2013 07:26 AM|Skualys|LINK
I'm facing the following problem :
I use a ODBC connector to Oracle 11g, which run wells, except for this request :
query.CommandText = "SELECT DBMS_METADATA.GET_DDL('TABLE','TABLE_NAME','USERNAME') FROM DUAL";
OdbcDataReader reader = query.ExecuteReader();
I got an exception, but it's void (no error code, no internal error, no message). The same request run wells in Toad / SQL Developer.
Thanks for any help !
Jan 27, 2013 12:20 AM|ToughMan|LINK
I got an exception
Jan 27, 2013 10:13 AM|Lannie|LINK
You have to use Oracle Parameters and Bind Variables to pass the values for TABLE_NAME and SCHEMA as these are dynamic. 'TABLE' is a constant and can be passed as is. USERNAME is not valid, although some people exchange this term for SCHEMA... SCHEMA being
a collection of Oracle database objects which are owned by the schema name...aka user.