- 浏览: 82461 次
- 性别:
- 来自: 南京
文章列表
#!/usr/bin/perl -w
#test the string
print "hello" ." ". "world!\n"; #字符串连接
print "hello" x 4 . "\n";
print "ha" x (2+3) . "\n";
print "12ggdd" * 3 ."\n"; #启用告警时,即#!/usr/bin/perl -w时,程序提示告警信息.
#计算从1到100的所有奇 ...
#!/bin/bash
declare -a colors;
echo "Enter your favorite colors (septated from each other by space).";
read -a colors;
#get the length of array
element_count=${#colors[@]};
index=0;
#all over the array.
echo "------all over the array------";
#the No1. method.
echo &quo ...
dblink常用方法:
1. 创建dblink
-- Create database link
create public database link XMDS_KF
connect to L2105
using '(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.137.17.99)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME =inomc)
)
)';
2.查询制定用 ...
1. 数据库分页:
mysql:
select * from A limit startRow,endRow
oracle:
select b.* from (select a.*,rownum as linenum from (select * from A) a where rownum<= endRow) b where linenum >= startRow
Hibernate分页
Query q = session.createQuery("from Cat as c");; ...
package read.file.form.emd;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.RandomAccessFile;
public class ReadFileFromEndUtils {
public static void main(String[] args) {
System.out.println(getUsefulStr("d:/file.txt", 1024, "machine"));
Sy ...
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.d ...
步骤 :
1. --创建DBLink
create public database link testLink
connect to l2108 identified by websms
using '(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.137.17.98)(PORT = 1521)))
(CONNECT_DATA = (SERVICE_NAME = inomc)))';
2. --实现远程调用(查询远程表corpmember)
select * from corpm ...
-- 判断V网类型
SELECT LENGTH(P_TYPE) INTO V_LEN FROM DUAL;
IF V_LEN != 1 THEN
P_RETVAL := 1002; -- V网类型不合法
RETURN;
END IF;
select NVL(REGEXP_SUBSTR(P_TYPE, '[0|1]'), '-1')
into V_ISCORPIDEXISTS
from dual;
IF V_ISCORPIDEXISTS = -1 THEN
P_RETVAL := 1002; -- V网类型不合法
return;
...
--开始编写分页的过程
create or replace procedure fenye(tableName in varchar2,
pageSize in number, --每页显示记录数
pageNow in number, ...
create or replace procedure test_proc is
v_corpid corpinfo.corpid%type := '16000000001%';
vv corpinfo%rowtype;
--定义游标
cursor one is
select * from corpinfo where corpinfo.corpid like v_corpid;
begin
--遍历游标1
open one;
loop
fetch one
into vv;
exit when one%notfound; ...
-- 查看表空间
SELECT UPPER(F.TABLESPACE_NAME) "表空间名",
D.TOT_GROOTTE_MB "表空间大小(M)",
D.TOT_GROOTTE_MB - F.TOTAL_BYTES "已使用空间(M)",
TO_CHAR(ROUND((D.TOT_GROOTTE_MB - F.TOTAL_BYTES) / D.TOT_GROOTTE_MB * 100,
2),
'990.99') &q ...
匹配:
写法1.
#!/bin/sh
aa="aabbb";
bb="aab";
if [[ "${aa}" = "${bb}"* ]];then
echo "aaaaaaaaaaaaaa";
else
echo "bbbbbbbbbbbbbb";
fi
~
写法2.
#!/bin/sh
aa="aabbb";
bb="aab";
if [[ ${aa} = ${bb}* ]];then
...
--------------------------- 一、循环语句 ----------------------------
1.for 语句:
例子:计算从1到10,所有正整数的和.
$sum=0;
for($i=1;$i<=10;$i++){
$sum+=$i;
}
print $sum . "\n";
2.foreach语句:
例子1、:计算从1..100,所有正整数的和.
$sum=0;
foreach(1..100){
$sum+=$_;
}
print $sum . "\n";
...
步骤:
1.用vi编写要执行的shell脚本t.sh :
例如:
#!/bin/bash
echo "I love you !" >>/home/luogen30/Desktop/t.txt
(注:该脚本是向t.txt文件中append一句话.)
2. 在命令终端输入: crontab -e 弹出命令编辑窗口.
3. 编辑如 ...
有关于异常处理的3个知识点:
1.EXCEPTION_INT编译指示
功能是将某命名异常同某特定Oracle错误关联起来.
主用用来捕捉某特定异常错误,而不是通过OTHERS来处理.
语法:PROGMA EXCEPTION_INIT(exception_name,oracle_error_number)
SQL>
SQL> DECLARE
2 expa EXCEPTION;
3 PRAGMA EXCEPTION_INIT(expa,-6502);
4 vn NUMBER(1);
5 BEGIN
6 vn:=24;
7 ...