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.
Skualys
Member
1 Points
7 Posts
Query an Oracle function
Jan 17, 2013 11:26 AM|LINK
Hello !
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 !
ToughMan
Participant
1490 Points
635 Posts
Re: Query an Oracle function
Jan 27, 2013 04:20 AM|LINK
????
What exceptions?????
Lannie
Contributor
3724 Points
726 Posts
Re: Query an Oracle function
Jan 27, 2013 02:13 PM|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.