Monthly Archives: September 2008
记录几个最近用到的简单Linux命令
显示所有环境变量: export 显示单个环境变量: echo $ORACLE_HOME 设置单个环境变量: export ORACLE_HOME=/home/oracle/product/10g 打包和压缩文件: tar cvzf test.tar *.log 查看压缩文件内容: tar tvf test.tar 解开压缩文件: tar xvf test.tar 输出当前日期 echo `date +%Y%m%d` 删除文件夹: rm -r folder1
用jxl读取Excel日期单元格内容
if (cell.getType() == CellType.DATE) { DateCell dateCell = (DateCell) cell; Date date = dateCell.getDate(); System.out.println(new SimpleDateFormat("yyyy/MM/dd").format(date)); }
从另外的表更新当前表的几个字段
update op_servdocinfo tset (t.customer_name, t.customer_type_code, t.customer_tel1, t.customer_tel2, t.customer_add) = (select t1.customer_name, t1.customer_type_code, t1.tel1, t1.tel2, t1.addressfrom customer_baseinfo t1where t1.customer_id = t.customer_id)where t.customer_name is null;
记录几个用到Oracle数据字典表
当前用户的表: USER_TABLES 当前用户表的备注信息: USER_TAB_COMMENTS 当前用户表的字段信息: USER_TAB_COLUMNS 当前用户表字段的备注信息: USER_COL_COMMENTS
使用insert插入大量数据的总结
create table t2 as select * from t1 insert into t1 select * from t1 如果追求速度的话,可以参考这篇文档:使用insert插入大量数据的总结 ,链接已经失效了。 记录一下我实际使用的方法和结果: First you need to drop all indexes on target table; INSERT /*+Append*/ INTO tab1 nologingSELECT * FROM tab2; 插入3000条记录,每条记录的平均长度在200字节,字段30个左右,花费时间约700秒。
Oracle中的Autocommit
在ABAP中调用外部数据库时,注意到了Oracle中的Autocommit功能。 在Debug模式,系统会自动Commit外部数据库的SQL语句。但如果程序没有显式的COMMIT语句,将会出现调试模式和正常运行结果不同的情况。 关于Autocommit的三个命令: SHOW AUTOCOMMIT SET AUTOCOMMIT ON SET AUTOCOMMIT OFF
UTF8编码的Oracle数据库的中文按拼音排序
1. 修改SQL语句的ORDER BY字句 ORDER BY NLSSORT(COLUNM_NAME, ‘NLS_SORT = SCHINESE_PINYIN_M’) 2.在Session级别修改NLS_SORT变量 ALTER SESSION SET NLS_SORT = SCHINESE_PINYIN_M 另外在Java中的使用Common Collection实现方法为:调用Collator.getInstance(java.util.Locale.CHINA)的compare方法
防止表格因为单元格的内容过长导致表格变形
table { table-layout: fixed; } .fixed-width-100 { width: 100px; overflow: hidden; text-overflow: ellipsis; } 参考文章: CSS小结:一行内文本超出指定宽度溢出的处理