Skip to content

Instantly share code, notes, and snippets.

@544
Forked from luisuribe/oracle shortcuts
Created April 13, 2011 17:26
Show Gist options
  • Save 544/917956 to your computer and use it in GitHub Desktop.
Save 544/917956 to your computer and use it in GitHub Desktop.
-- Show all tables
> SELECT TABLE_NAME FROM TABS
-- List fields from a table
> SELECT *
FROM user_tab_cols
WHERE table_name = 'table_name'
-- List some fields fields from a table
> SELECT column_name, data_type, FROM user_tab_cols WHERE table_name = 'table_name'
-- Alter table
ALTER TABLE table MODIFY ( field type )
select R_CONSTRAINT_NAME from user_constraints where
Constraint_name = 'W1244_T0238_FK';
select table_name, COLUMN_NAME
from user_cons_columns where
CONSTRAINT_NAME = 'Obtained from above'
select table_name, COLUMN_NAME
from user_cons_columns where
CONSTRAINT_NAME ='W1244_T0238_FK';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment