개발/데이타베이스39 INSERT, UPDATE WITH MULTI SELECT QUERY INSERT INTO account_type_standard (account_type_Standard_id, tax_status_id, recipient_id) VALUES( (SELECT account_type_standard_seq.nextval FROM DUAL), (SELECT tax_status_id FROM tax_status WHERE tax_status_code = ?), (SELECT recipient_id FROM recipient WHERE recipient_code = ?) ) 출처 : http://stackoverflow.com/questions/131164/oracle-insert-via-select-from-multiple-tables-where-one-table-may-not.. 2016. 11. 4. 오라클 세션 관련 특정 조건으로 한방에 지우기 ... ALTER SYSTEM ENABLE RESTRICTED SESSION; begin for x in ( select Sid, Serial#, machine, program from v$session where machine 'MyDatabaseServerName' ) loop execute immediate 'Alter System Kill Session '''|| x.Sid || ',' || x.Serial# || ''' IMMEDIATE'; end loop; end;I skip killing sessions originating on the database server to avoid killing off Oracle's connections to itself. 출처.. 2016. 11. 2. tibero drop table (wildcard 로 지우기) DECLARE BEGIN DBMS_OUTPUT.ENABLE; FOR c IN ( SELECT table_name FROM user_tables WHERE table_name LIKE 'ABC_%' ) LOOP --DBMS_OUTPUT.PUT_LINE(c.table_name); EXECUTE IMMEDIATE 'DROP TABLE ' || c.table_name; END LOOP; END; 2016. 10. 26. 이전 1 ··· 7 8 9 10 다음