アウトプットができる技術者に

it's a time to take a new step !

2014-02-12から1日間の記事一覧

awk 月の足し算

awk

#!/bin/awk function addmonth(yyyymm, n){ yyyy = substr(yyyymm,1,4) mm = substr(yyyymm,5,2) + n time = mktime(yyyy" "mm" 1 0 0 0") return strftime("%Y%m", time) } { print addmonth(201301, 1) == 201302 ? "." : "NG"; print addmonth(201312, 1)…

Sybase ASE 入門 テーブルの作成 select into statement

テーブルを作成するには、create table の他、select into でもOK 作成元にしたテーブルのカラム制約が、新しいテーブルに引き継がれる。 ただし、IndexやPrimaryKey制約は 引き継がれない。 select * into test_table2 from test_table1 -- sample select *…

Sybase ASE 入門 カラム追加

age カラムを追加する例 alter table test_table1 add age int default 99 alter table test_table1 add age int null指定の位置に追加することは不可能?

Sybase ASE 入門 カラム定義変更

"name" カラムの定義を varchar に変更する alter table t1 modify name varchar(10)"name" カラムの定義を null に変更する。カラムの型は省略可能。 alter table t1 modify name varchar(10) null alter table t1 modify name null reference official doc…