find a column in a schema


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting find a column in a schema
# 1  
Old 05-14-2010
Lightbulb find a column in a schema

Hi,
I need my script to accept a column name and give all the tables and its schema.
Any kind of help is appreciated...
Thanks in advance...
# 2  
Old 05-14-2010
Assuming Oracle and the column name is unique
-- there are two views ALL_TAB_COLUMNS, ALL_TABLES
this is the sql to use
Code:
select a.table_name
from all_tables a, all_tab_columns b
where
   a.owner=b.owner
and b.column_name='SOME_COLUMN';

# 3  
Old 05-14-2010
hey thanx, bt i didn't understand it properly, n a particular column name can exists in multiple tables across multiple schemas... I need to extract all the table names n their respective schemas!!
Thanx for d help...
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Programming

Find the minimum value of the column with respect to other column

Hi All, I would like get the minimum value in the certain column with respect to other column. For example, I have a text file like this. ATOM 1 QSS SPH S 0 -2.790 -1.180 -2.282 2.28 2.28 ATOM 1 QSS SPH S 1 -2.915 -1.024 -2.032 2.31 2.31 ATOM 1 ... (4 Replies)
Discussion started by: bala06
4 Replies

2. Shell Programming and Scripting

awk to find maximum and minimum from column and store in other column

Need your support for below. Please help to get required output If column 5 is INV then only consider column1 and take out duplicates/identical rows/values from column1 and then put minimum value of column6 in column7 and put maximum value in column 8 and then need to do subtract values of... (7 Replies)
Discussion started by: as7951
7 Replies

3. Shell Programming and Scripting

Find lines with matching column 1 value, retain only the one with highest value in column 2

I have a file like: I would like to find lines lines with duplicate values in column 1, and retain only one based on two conditions: 1) keep line with highest value in column 3, 2) if column 3 values are equal, retain the line with the highest value in column 4. Desired output: I was able to... (3 Replies)
Discussion started by: pathunkathunk
3 Replies

4. Shell Programming and Scripting

Parallel export of all oracle DB schema.

In my Oracle db there are 4 schemas. All the username & passwords are stored in a text file. I am using a while loop to export all the schemas. It read the first line and doing the export. For all users it export one by one. But I need all the schemas will exported simultaneously. i.e. all the... (1 Reply)
Discussion started by: priya001
1 Replies

5. Cybersecurity

LDAP rfc2307bis.schema or nis.schema?

Hi guys, we are implementing new ldap in our organization exclusively for Linux authentication purposes. As we are new to the subject, I would appreciate help regarding which schema to use to create group of users and accounts / passwords entries? I see both schemas listed in subject above... (0 Replies)
Discussion started by: Lastminute
0 Replies

6. Shell Programming and Scripting

find expression with awk in only one column, and if it fits, print whole column

Hi. How do I find an expression with awk in only one column, and if it fits, then print that whole column. 1 apple oranges 2 bannanas pears 3 cats dogs 4 hesaid shesaid echo "which number:" read NUMBER (user inputs number 2 for this example) awk " /$NUMBER/ {field to search is field... (2 Replies)
Discussion started by: glev2005
2 Replies

7. UNIX for Dummies Questions & Answers

creating a schema

hi guys, Unix dummy here. I need help creating a script for class. The assignment reads as follows: create a script that will create a new schema in schema.txt, it must accept 7 arguments (the first being the name of the schema) the other 6 being the 6 field names. the schema has to be tested... (1 Reply)
Discussion started by: zodester
1 Replies
Login or Register to Ask a Question