2012年5月8日

linux的shell编程中#!/bin/sh和$bash是什么意思

#! /bin/sh 是指此脚本使用/bin/sh来解释执行,#!是特殊的表示符,其后面根的是此解释此脚本的shell的路径。

$bash $表示系统提示符,$ 表示此用户为普通用户,超级用户的提示符是#。

bash是shell的一种,是linux下最常用的一种shell。

$bash的意思是执行一个子shell,此子shell为bash。

 

要注意,在每个脚本的开头都使用"#!",这意味着告诉你的系统这个文件的执行需要指定一个解 释器.#!实际上是一个2字节[1]的魔法数字,这是指定一个文件类型的特殊标记, 换句话说, 在 这种情况下,指的就是一个可执行的脚本(键入man magic来获得关于这个迷人话题的更多详细 信息).在#!之后接着是一个路径名.这个路径名指定了一个解释脚本中命令的程序,这个程序可 以是shell,程序语言或者是任意一个通用程序.这个指定的程序从头开始解释并且执行脚本中 的命令(从#!行下边的一行开始),忽略注释.[2] 如: 1 #!/bin/sh 2 #!/bin/bash 3 #!/usr/bin/perl 4 #!/usr/bin/tcl 5 #!/bin/sed -f 6 #!/usr/awk -f

注意: #! 后边给出的路径名必须是正确的,否则将会出现一个错误消息,通常是 "Command not found",这将是你运行这个脚本时所得到的唯一结果.

如果在脚本的里边还有一个#!行,那么bash将把它认为是一个一般的注释行.

posted @ 2012-05-08 16:05 猎-户-座 阅读(104) 评论(0) 编辑

2012年3月25日

Oracle data types and corresponding DataStage data types

Oracle data types and corresponding DataStage data types

Oracle data typeDataStage data type
CHAR(n BYTE)

SQL type: CHAR
Length: n
Scale: unset
Extended: unset

CHAR(n CHAR ) single-byte

SQL type: CHAR
Length: n
Scale: unset
Extended: unset

CHAR(n CHAR) multibyte

SQL type: NCHAR
Length: n
Scale: unset
Extended: unset

CHAR single-byte If the NLS_LENGTH_SEMANTICS database parameter is set to CHAR, then see CHAR(n CHAR). Otherwise, see CHAR(n BYTE) single-byte. In both cases, assume that n = 1.
CHAR multibyte If the NLS_LENGTH_SEMANTICS database parameter is set to CHAR, then see CHAR(n CHAR). Otherwise, see CHAR(n BYTE) multibyte. In both cases, assume that n = 1
VARCHAR2(n BYTE)

SQL type: VARCHAR
Length: n
Scale: unset
Extended: unset

VARCHAR2(n CHAR) single-byte

SQL type: VARCHAR
Length: n
Scale: unset
Extended: unset

VARCHAR2(n CHAR) multibyte

SQL type: NVARCHAR
Length: n
Scale: unset
Extended: unset

CLOB single-byte

SQL type: LONGVARCHAR
Length: unset
Scale: unset
Extended: unset

CLOB multibyte

SQL type: LONGNVARCHAR
Length: unset
Scale: unset
Extended: unset

LONG single-byte

SQL type: LONGVARCHAR
Length: unset
Scale: unset
Extended: unset

LONG multibyte

SQL type: LONGNVARCHAR
Length: unset
Scale: unset
Extended: unset

NCHAR(n)

SQL type: NCHAR
Length: n
Scale: unset
Extended: unset

NCHAR See NCHAR(n) and assume that n = 1.
NVARCHAR2(n)

SQL type: NVARCHAR
Length: n
Scale: unset
Extended: unset

NCLOB

SQL type: LONGNVARCHAR
Length: unset
Scale: unset
Extended: unset

NUMBER

SQL type: DOUBLE
Length: unset
Scale: unset
Extended: unset

NUMBER (ps) {p>=s} {s>=0}

SQL type: DECIMAL
Length: p
Scale: s
Extended: unset

NUMBER(ps) {p<s} {s>=0}

SQL type: DECIMAL
Length: s
Scale: s
Extended: unset

NUMBER(ps) {s<0}

SQL type: DECIMAL
Length: p-s
Scale: unset
Extended: unset

FLOAT(p) {1 <=p <=63}

SQL type: FLOAT
Length: unset
Scale: unset
Extended: unset

FLOAT(p) {64 <=p <= 127}

SQL type: DOUBLE
Length: unset
Scale: unset
Extended: unset

BINARY_FLOAT

SQL type: FLOAT
Length: unset
Scale: unset
Extended: unset

BINARY_DOUBLE

SQL type: DOUBLE
Length: unset
Scale: unset
Extended: unset

LONG RAW

SQL type: LONGVARBINARY
Length: unset
Scale: unset
Extended: unset

RAW(n)

SQL type: VARBINARY
Length: n
Scale: unset
Extended: unset

BLOB

SQL type: LONGVARBINARY
Length: unset
Scale: unset
Extended: unset

BFILE

SQL type: VARCHAR
Length: 285
Scale: unset
Extended: unset

DATE

SQL type: DATE
Length: unset
Scale: unset
Extended: unset

TIMESTAMP(fsp)

SQL type: TIMESTAMP
Length: unset
Scale: fsp
Extended: Microseconds

TIMESTAMP(fsp) WITH TIME ZONE

SQL type: TIMESTAMP
Length: unset
Scale: fsp
Extended: Microseconds

TIMESTAMP(fsp) WITH LOCAL TIME ZONE

SQL type: TIMESTAMP
Length: unset
Scale: fsp
Extended: Microseconds

TIMESTAMP See TIMESTAMP(fsp) and assume that fsp=6.
TIMESTAMP WITH TIME ZONE See TIMESTAMP(fsp) WITH TIME ZONE and assume that fsp=6.
TIMESTAMP WITH LOCAL TIME ZONE See TIMESTAMP(fsp) WITH LOCAL TIME ZONE and assume that fsp=6.
INTERVAL YEAR (yp) TO MONTH

SQL type: VARCHAR
Length: yp+4
Scale: unset
Extended: unset

INTERVAL DAY TO SECOND (sp)

SQL type: VARCHAR
Length: sp+13
Scale: unset
Extended: unset

INTERVAL DAY (dp) TO SECOND

SQL type: VARCHAR
Length: dp+17
Scale: unset
Extended: unset

INTERVAL DAY (dp) TO SECOND (sp)

SQL type: VARCHAR
Length: dp+sp+11
Scale: unset
Extended: unset

INTERVAL YEAR TO MONTH See INTERVAL YEAR (yp) TO MONTH and assume yp=2.
INTERVAL DAY TO SECOND See INTERVAL DAY (dp) TO SECOND (sp) and assume that dp=2 and thatsp=6.
ROWID

SQL type: CHAR
Length: 18
Scale: 18
Extended: unset

UROWID(n)

SQL type: VARCHAR
Length: n
Scale: unset
Extended: unset

UROWID See UROWID(n) and assume that n=4000.

XMLType stored as CLOB or 
OBJECT_RELATIONAL
single-byte

See CLOB single-byte.

XMLType stored as CLOB or 
OBJECT_RELATIONAL
multibyte

See CLOB multibyte.

XMLType stored as 
BINARY XML

See BLOB.
Other

SQL type: UNKNOWN
Length: unset
Scale: unset
Extended: unset

posted @ 2012-03-25 13:16 猎-户-座 阅读(91) 评论(0) 编辑

2012年3月22日

SQL Server 和Oracle 数据类型对应

摘要: SqlServer 2k转换为Oracle 10g列名SqlServer数据类型SqlServer长度Oracle数据类型column1bigint8 NUMBER(19)column2binary50 RAW(50)column3bit1 NUMBER(2)column4char10 CHAR(10)column5datetime8 DATEcolumn6decimal9 NUMBER(18)column7float8 BINARY_DOUBLEcolumn8image16 BLOBcolumn9int4 NUMBER(10)column10m...阅读全文

posted @ 2012-03-22 17:15 猎-户-座 阅读(224) 评论(2) 编辑

2012年3月8日

oracle 时间转换

己知 秒 sec  换算成00:00:00格式

floor(sec/3600)||':'||floor((sec-floor(sec/3600)*3600)/60)||':'||((sec/60)-floor(sec/60))*60

posted @ 2012-03-08 12:26 猎-户-座 阅读(146) 评论(0) 编辑

2012年2月27日

Cognos 维度函数

摘要: Cognos 维度函数以下函数说明均来自Cognos ReportNet说明,函数例子由本人总结编写(作者:HondaHsu 来源:博客园)firstFromSet ( set_exp, numeric_exp_max , numeric_exp_overflow )返回在集中找到的前几个(不超过 numeric_exp_max + numeric_exp_overflow)成员。 如果超过 numeric_exp_max + numeric_exp_overflow,则只返回成员的最大数目。remainderSet (member_exp, set_exp , numeric_exp )当.阅读全文

posted @ 2012-02-27 16:30 猎-户-座 阅读(229) 评论(0) 编辑

2012年2月8日

oracle的分析函数over 及开窗函数

摘要: oracle的分析函数over 及开窗函数一:分析函数over Oracle从8.1.6开始提供分析函数,分析函数用于计算基于组的某种聚合值,它和聚合函数的不同之处是 对于每个组返回多行,而聚合函数对于每个组只返回一行。 下面通过几个例子来说明其应用。 1:统计某商店的营业额。 date sale 1 20 2 15 3 14 4 18 5 30 规则:按天统计:每天都统计前面几天的总额 得到的结果: DATE SALESUM ----- -------- ------ 1 20 20 --1天2 15 35 --1天+2天3 1449--1天+2天+3天 4 18 67 . 5 30 9..阅读全文

posted @ 2012-02-08 11:50 猎-户-座 阅读(34) 评论(0) 编辑

2012年2月7日

Oracle over函数 累计求和

摘要: Oracle over函数SQL code: sql over的作用及用法 RANK ( ) OVER ( [query_partition_clause] order_by_clause ) DENSE_RANK ( ) OVER ( [query_partition_clause] order_by_clause ) 可实现按指定的字段分组排序,对于相同分组字段的结果集进行排序, 其中PARTITION BY 为分组字段,ORDER BY 指定排序字段 over不能单独使用,要和分析函数:rank(),dense_rank(),row_number()等一起使用。 其参数:over...阅读全文

posted @ 2012-02-07 16:22 猎-户-座 阅读(321) 评论(2) 编辑

2012年2月3日

oracel 游标 详解

摘要: -- 声明游标;CURSOR cursor_name IS select_statement --For 循环游标 --(1)定义游标 --(2)定义游标变量 --(3)使用for循环来使用这个游标declare --类型定义 cursor c_job is select empno,ename,job,sal from emp where job='MANAGER'; --定义一个游标变量v_cinfo c_emp%ROWTYPE ,该类型为游标c_emp中的一行数据类型 c_row c_job%rowtype; begin for c_row in c_job loop d阅读全文

posted @ 2012-02-03 11:37 猎-户-座 阅读(39) 评论(0) 编辑

2011年12月27日

Excel 数据 利用pl/sql developer 导入到oracle

摘要: 新建 sql window执行 select * from table_name for update -- table_name为目标表 F8快捷键点击 执行结果上面的锁状按钮,使查询内容处于编辑状态把鼠标放在查询结果的列上面 会出现 黑色往下的箭头 选中要导入数据的列然后 ctrl+c excel里的数据 之后 返回pl/sql developer 选中sql window 最后 ctrl+v(列要和excel里的 一一对应)阅读全文

posted @ 2011-12-27 11:44 猎-户-座 阅读(205) 评论(1) 编辑

2011年12月23日

oracle 触发器 简单表实例

摘要: CREATETABLEDWUSER.T1(OLD_VALUENUMBER(7,2), NEW_VALUENUMBER(7,2),UP_DATEDATE);CREATETABLEDWUSER.EMP(EMPNONUMBER(4), ENAMEVARCHAR2(10BYTE), JOBVARCHAR2(9BYTE), MGRNUMBER(4), HIREDATEDATE, SALNUMBER(7,2), ...阅读全文

posted @ 2011-12-23 17:02 猎-户-座 阅读(149) 评论(0) 编辑

仅列出标题  下一页

导航

统计

公告