|
-
To do it interactively from SQL*PLUS:
desc my_table;
To do it in code:
set serveroutput on
declare x number;
begin
select count(*) into x from dba_tab_columns where table_name = 'My_Table_Name' and (column_name = 'ORDER_NUM' or column_name='DATE');
dbms_output.put_line(x);
end;
/
If the number output by X is the same as the number of columns you listed in the where clause above, they all exist. If X is less than the number of columns you listed, some of them don't exist.
Note: I used dbms_output.put_line solely to display the output for your use in SQL*PLUS. You could use this code in a procedure and test X with code rather than displaying it. Use capitals when searching the data dictionary for objects by name.
Is this what you wanted?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|