Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get the column names of a table referred by a dblink?

Tags:

sql

oracle

dblink

I am new to oracle. I have a table referred using a dblink, say MY_TABLE@MY_DBLINK. Suppose MY_TABLE has columns like COLUMN_1, COLUMN_2. How can I write a query to return the column names?

I tried to use DESCRIBE MY_TABLE@MY_DBLINK. But it is showing the error as "ERROR: object MY_TABLE does not exist". But I am able to display the contents of the same table using SELECT.

like image 457
988875 Avatar asked Oct 12 '11 06:10

988875


1 Answers

select column_name
  from all_tab_columns@MY_DBLINK
 where table_name = 'MY_TABLE'
like image 173
Rob van Wijk Avatar answered Sep 28 '22 06:09

Rob van Wijk