qingyujingyu427
qingyujingyu427 · 共 15 篇文章
oracle disable/enable all constraints and triggers
disable script: DECLARE BEGIN FOR i IN (SELECT table_name, constraint_name --disable first the foreign key FROM user_constraints WHERE constraint_type ='R' AND status = 'ENABLED' ) LOOP EXECUTE IMMEDIATE 'alter table "' ||i.table_name|| '" disable constraint ' ||i.constraint_name; END LOOP i; FOR i…
2009-06-12 13:35 · oracle · 评论(0)
pspad regex replace search
Replace Examples: Date format change from dd.mm.yyyy to yyyy-mm-dd. This will turn the European date style 26.8.1994 or 26/8/1994 into 1994-8-26. Search: ([0-9]{1,2}).([0-9]{1,2}).([0-9]{4}) Replace: $3-$2-$1 Find Examples: (.)\1+ matches 'aaaa' and 'cc'. (.+)\1+ also match 'abab' and '123123' (['"…
2009-05-22 09:14 · regex · 评论(0)
sql server disable all constraints and triggers
USE [database name] EXEC sp_MSforeachtable @command1="ALTER TABLE ? DISABLE TRIGGER ALL" GO EXEC sp_MSforeachtable @command1="ALTER TABLE ? NOCHECK CONSTRAINT ALL" GO Reference: http://www.sqlusa.com/bestpractices2005/disabletriggerconstraint/
2009-05-18 09:50 · sqlserver · 评论(0)
db2 modify column type
DB2 is so hard to use, also its documentation... Even such a simple operation, it takes me much time... Generally, char->varchar, smallint->integer, you can just modify the column through this sql: alter table [table name] alter column [column name] set data type [new type] But, if new column type …
2009-05-11 08:56 · db2 · 评论(0)
db2 snapshot
1. open cmd 2. execute command "db2cmd" 3. set trace on: db2 update monitor switches using statement on 4. get snapshot: db2 get snapshot for dynamic sql on "database name" >> "d:\sql.txt" 5. set trace off: db2 update monitor switches using statement off
2008-12-10 10:10 · db2 · 评论(0)
Head First Design Patterns 读书笔记
Decorator, don't alter interface, but add resposibility. Adapter, convert one interface to another. Facade, make interface simpler.
2008-08-18 09:33 · design pattern · 评论(0)
如何做一个rich text editor之初想
比如做一个wiki需要用的rich text editor,拿confluence和FCEditor为样本,需要有的基本功能: undo redo find replace Insert table (Insert row, Delete row, Insert column, Delete column) Insert unordered list Insert ordered list Bold text Italic text Underline text StrikeThrough text Paragraph format Outdent Indent Insert link In…
2008-07-28 08:18 · javascript · 评论(0)
JSF specification摘要
Specified that implementations running in a JSR-250 compliant container have their managed bean methods annotated with @PostConstruct be called after the object is instantiated, and after injection is performed, but before the bean is placed into scope. Specified that methods annotated with @PreDes…
2008-07-13 13:00 · JSF · 评论(0)
google code jam practice problems
Problem description can be found here . A. Alien Numbers Follow is the solution: public String getTargetNumber(String alienNumber,String srcLang,String targetLang) { String ret = ""; // convert alienNumber to decimal number first int decimalNumber = 0; //the base of src language. 几进制 int srcBaseNum…
2008-07-11 07:23 · algorithm · 评论(0)
Solving topcoder srm407 with python
CorporationSalary You can find the problem description here . Because the problem is little simple, so here change "If an employee has any subordinates, then his salary is equal to the sum of the salaries of his direct subordinates." as "If an employee has any subordinates, then his salary is equal…
2008-07-04 17:01 · python study · 评论(0)
list sort
Usage: list.sort([cmp[,key[,reverse]]]) how to use cmp parameter def my_cmp(x,y): if x<y: return -1 elif x==y: return 0 else: return 1 arr = [2,5,3,1,4] arr.sort(my_cmp) print arr Above example's result is [1,2,3,4,5]; how to use key parameter arr = ['bj:beijing','sh:shanghai','sd:shandong'] arr.so…
2008-07-04 15:03 · python study · 评论(0)
看过的觉得还算可以的网络小说
全本的: 裸兰 善良的死神 大唐行镖 随波逐流之一代军师 不死不灭 佣兵天下 正在更新的: 紫川 庆余年 师士传说 异人傲世录 神墓 赫氏门徒
2008-06-26 08:51 · Books · 评论(0)
JDBC调用oracle PLSQL(用jpublisher生成代码)
如果有一个TYPE: CREATE OR REPLACE type EMP_TYPE AS object ( id NUMBER , name VARCHAR2 , birthday DATE , sex CHAR (1) ); 有一个Pacakge: CREATE OR REPLACE PACKAGE EMP_UTIL IS FUNCTION get_emp_by_id (p_id NUMBER) RETURN EMP_TYPE; PROCEDURE create_emp (p_emp EMP_TYPE); END EMP_UTIL; 现在如果需要用JDBC调用这个Package的这两个功…
2008-05-14 08:34 · oracle · 评论(0)
oracle text performance
oracle text的索引跟其它的基本索引不同,当执行dml操作时,数据库不会自动维护这些索引(不过会将这些dml操作记录在表CTX_USER_PENDING里),需要调用存储过程ctx_dll.sync_index来维护索引。 当执行ctx_dll.sync_index时,会先去CTX_USER_PENDING表里查看未索引的行,然后将其索引。ctx_dll.sync_index能够利用多cpu的优势,并行执行。 Index Fragmentation The CONTEXT index is an inverted index where each word contains the …
2008-03-17 13:12 · 评论(1)
oracle用plsql将sql查询的所有数据导出为xml
第一步需要先建一个oracle directory。 create directory TEMP_DIR as '/home/oracle/temp'; declare xml_str clob; xml_file Utl_File.file_type; offset NUMBER := 1; buffer varchar2(4000); buffer_size number := 2000; begin xml_file := Utl_File.fopen('TEMP_DIR','l360_lookup_values.xml','W'); xml_str := DBMS_XMLGEN.ge…
2008-03-13 07:22 · oracle · 评论(0)