2011年3月24日 星期四

Update sql with join table

update TABLE_A
set TABLE_A.COLUMN_A = TABLE_B.COLUMN_A
from TABLE_A
join TABLE_B on TABLE_A.COLUMN_PK = TABLE_B.COLUMN_PK

2010年7月19日 星期一

Use '&' in oracle Database

oracle 裡面
[ & ]後面的字串會當做變數處理
(變數首碼符號)

set define off;

insert ......

set define on

2010年7月15日 星期四

oracle 自動新增欄位 procedure

SET SERVEROUTPUT ON; --ENABLE

EXEC DBMS_OUTPUT.ENABLE(1000000);

DECLARE

B NUMBER;

BEGIN

SELECT COUNT(*)

INTO B

FROM USER_TAB_COLUMNS

WHERE TABLE_NAME = 'TABLE_A' AND COLUMN_NAME = 'COLUMN_A';

IF B = 0

THEN

EXECUTE IMMEDIATE 'ALTER TABLE TABLE_A ADD(COLUMN_A NVARCHAR2(100) DEFAULT ''IB'' )';

DBMS_OUTPUT.PUT_LINE('ALTER TABLE TABLE_A ADD(COLUMN_A NVARCHAR2(100) DEFAULT ''IB'' )');

END IF;

END;

2010年6月29日 星期二

oracle drop database

shutdown abort;
startup mount exclusive restrict;
drop database_name;
exit;

Oracle imp/exp file

exp userid/password@SID file=d:\file_name.dmp full=y;

imp userid/password@SID file=d:\file_name.dmp ignore=y tables=(table1);
tables=(table1) is option

2010年6月14日 星期一

MS SQL rename table

ALTER TABLE tablename RENAME TO footable

EXEC sp_rename 'OldTableName', 'NewTableName'

EXEC sp_rename
@objname = 'TableName.OldColumnName',
@newname = 'NewColumnName',
@objtype = 'COLUMN'

2010年3月2日 星期二

Oracle marge into

若符合條件則 update,
否則 insert

MERGE INTO Table1 target
USING Table2 source
ON (target.COLUMN1 = source.COLUMN1)
WHEN MATCHED THEN UPDATE SET taeged.COLUMN2 = source.COLUMN2
WHEN NOT MATCHED THEN
INSERT /** (
target.COLUMN1, target.COLUMN2, target.COLUMN3) **/
VALUES (
source.COLUMN1, source.COLUMN2, source.COLUMN3)
;

2010年1月12日 星期二

MSN 檔案傳輸掃毒設定

MSN 檔案傳輸掃毒設定
Antivir

MSN > 工具 > 選項 > 檔案傳輸 > 勾選「使用下列軟體進行病毒掃瞄(V)」
[瀏覽] AntiVir 安裝資料夾裡的avscan.exe
並在後面加上參數" /GUIMODE=3 /PATH=%FILE%" (包含空格,不包含引號)

完成後應該像這樣
"C:\Program Files\AntiVir PersonalEdition Classic\avscan.exe" /GUIMODE=3 /PATH=%FILE%

GUIMODE=3 完全不會跳出視窗
GUIMODE=2 跳出簡易檢視視窗
GUIMODE=1 跳出完整檢視視窗

Kaspersky

MSN > 工具 > 選項 > 檔案傳輸 > 勾選「使用下列軟體進行病毒掃瞄(V)」
[瀏覽] 找到安裝 KIS/KAV 的目錄
- KAV 6 "C:\Program Files\Kaspersky Lab\Kaspersky Anti-Virus 6.0\avp.exe"
- KIS 6 "C:\Program Files\Kaspersky Lab\Kaspersky Internet Security 6.0\avp.exe"
- KAV 7 "C:\Program Files\Kaspersky Lab\Kaspersky Anti-Virus 7.0\avp.exe"
- KIS 7 "C:\Program Files\Kaspersky Lab\Kaspersky Internet Security 7.0\avp.exe"
並在後面加上參數" scan %1" (包含空格,不包含引號)

完成後應該像這樣
"C:\Program Files\Kaspersky Lab\Kaspersky Internet Security 6.0\avp.exe" scan %1
Kaspersky 7.0則路徑為 Kaspersky Anti-Virus 7.0或Kaspersky Internet Security 7.0

NOD32  (自動關閉視窗)

MSN > 工具 > 選項 > 檔案傳輸 > 勾選「使用下列軟體進行病毒掃瞄(V)」
[瀏覽] NOD32 安裝資料夾裡的nod32.exe
並在後面加上參數" /quit" (包含空格,不包含引號)

完成後應該像這樣
C:\Program Files\ESET\nod32.exe /quit

Norton AntiVirus

MSN > 工具 > 選項 > 檔案傳輸 > 勾選「使用下列軟體進行病毒掃瞄(V)」
[瀏覽] Norton AntiVirus 安裝資料夾裡的ccIMScn.exe

完成後應該像這樣
C:\Program Files\Norton SystemWorks\Norton AntiVirus\ccIMScn.exe

Norton AntiVirus 2003/2004/2005 需先進行 LiveUpdate 。

Avast

MSN > 工具 > 選項 > 檔案傳輸 > 勾選「使用下列軟體進行病毒掃瞄(V)」
[瀏覽] Avast 安裝資料夾裡的ashQuick.exe

完成後應該像這樣
C:\Program Files\Alwil Software\Avast4\ashQuick.exe

2009年10月1日 星期四

Key Code Reference Table

Key Code Reference Table


Key Pressed

Javascript Key Code

backspace

8

tab

9

enter

13

shift

16

ctrl

17

alt

18

pause/break

19

caps lock

20

escape

27

page up

33

page down

34

end

35

home

36

left arrow

37

up arrow

38

right arrow

39

down arrow

40

insert

45

delete

46

0

48

1

49

2

50

3

51

4

52

5

53

6

54

7

55

8

56

9

57

a

65

b

66

c

67

d

68

e

69

f

70

g

71

h

72

i

73

j

74

k

75

l

76

m

77

n

78

o

79

p

80

q

81

r

82

s

83

t

84

u

85

v

86

w

87

x

88

y

89

z

90

left window key

91

right window key

92

select key

93

numpad 0

96

numpad 1

97

numpad 2

98

numpad 3

99

numpad 4

100

numpad 5

101

numpad 6

102

numpad 7

103

numpad 8

104

numpad 9

105

multiply

106

add

107

subtract

109

decimal point

110

divide

111

f1

112

f2

113

f3

114

f4

115

f5

116

f6

117

f7

118

f8

119

f9

120

f10

121

f11

122

f12

123

num lock

144

scroll lock

145

semi-colon

186

equal sign

187

comma

188

dash

189

period

190

forward slash

191

grave accent

192

open bracket

219

back slash

220

close braket

221

single quote

222


2009年8月17日 星期一