Pergunta

I am working on sql server 2005 with a linked server set up to Oracle. I can't get at the underlying account for the link. I need run the

desc <table>

command from SSIS to Oracle. I do have access to openquery. Is there a way to do this? I am guessing no but a question is easy :).

I do know that

select * from OPENQUERY(<server>,'desc <schema>.<table>') ;

doesn't work. The DBAs have been less than helpful with that, which is sad because all I need is the schema so that I can write the actual query that I need. I am open to any suggestions that might get me that answer. Thanks!

Michael.

Foi útil?

Solução

DESC is a SQLPlus command, not an Oracle command. Try this query instead:

SELECT
  Column_Name,
  Data_Type,
  Data_Length,
  Data_Precision,
  Nullable
FROM All_Tab_Columns
WHERE Owner = '<schema>' AND Table_Name = '<table>'
ORDER BY Column_ID

Make sure that <schema> and <table> are in uppercase.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top