Skip to main content

Posts

Showing posts with the label triggers

Oracle SQL Tips

1.       Using SQL dummy table This query will subtract first number from second. Dual table is used as dummy table to complete the sql statement, do nothing though. select 36649-36598 from dual 2.       Audit details get audit details select * from DBA_AUDIT_TRAIL WHERE OBJ_NAME='course_material' get audit count SELECT * FROM all_tab_modifications   where TABLE_NAME = 'COURSE_MATERIAL' 3.       Constraint details get constraint details select * from ALL_CONSTRAINTS where CONSTRAINT_NAME = 'SYS_C0012069'; get column name of constratint SELECT * FROM all_cons_columns where CONSTRAINT_NAME = 'SYS_C0012069'; see what constraints are referencing a table SELECT * FROM USER_CONSTRAINTS WHERE TABLE_NAME = "tabnam"; disable constraints alter table "COURSE" DISABLE constraint "FK_PARENT_ID"; get referecing table names   select owner,constraint_name,const...