2014年1月18日土曜日

Oracle Spool Script Sample

SET VERIFY OFF SET HEADING ON SET ECHO OFF SET PAGESIZE 0 SET LINE 1000 SET FEEDBACK ON SET NEWPAGE 0 SET TERMOUT OFF SET SERVEROUT OFF SET TRIMSPOOL ON WHENEVER OSERROR EXIT 1 ROLLBACK WHENEVER SQLERROR EXIT SQL.SQLCODE ROLLBACK spool /XX/XX/XXX.csv select ( STRA || ',' || STRB || ',' || TO_CHAR(NUMC) ) from Table; spool off

VB 全角文字有無のチェック

Function NoMultiByte(value As string) As Boolean Dim LetterCount As Long Dim ByteCount As Long LetterCount = Len(value) ByteCount = LenB(StrConv(value,vbFromUnicode)) If LetterCount <> ByteCount Then NoMultiByte = False Else NoMultiByte = True End If End Function

Tera Term(テラターム)のマクロサンプル

;set the server to connect inputbox 'input server name:' 'server name:' server = inputstr ;set user and password user= 'xxx' passwd = 'xxx' ;set log file path filename = 'C:¥xxx¥xxx' ;IP mapping strcompare server 'hostname1' if result = 0 then srvip= 'xxx.xxx.xxx.xxx:23 /telnet' goto CONN endif ; ... ... ;start connect :CONN connet srvip wait 'login: ' sendln user wait 'Password: ' sendln passwd ;set title titile = 'connect ' strconcat title server settitle title ;open log file getdate date gettime time strcopy time 1 2 hour strcopy time 4 2 min strcopy time 7 2 sec strconcat filename server strconcat filename '_' strconcat filename hour strconcat filename min strconcat filename sec strconcat filename '.log' logopen filename 0 1