Sybase 資料一覧
システム情報を取得する関数
2007/12/8更新
対応バージョン: 11.9.2
システム情報を取得する組み込み関数(いわゆるシステム関数)には様々なものがあるが、ここではその一部を紹介する。
現在日時
1> select getdate() 2> go Dec 07 2007 7:54PM
現在DB、あるいは指定したDBのID
1> select db_id() 2> go 14 1> select db_id("testdb") 2> go 20
現在DB、あるいは指定したDBの名前
1> select db_name() 2> go foodb 1> select db_name("20") 2> go testdb
現在ホスト
1> select host_name() 2> go host_a
現在プロセスのPID
1> select host_id() 2> go 15122
現在ユーザの名前
1> select user 2> go dbo
現在ユーザ、あるいは指定したユーザのID
1> select user_id() 2> go 1 1> select user_id("foo") 2> go 3
現在ユーザ、あるいは指定したユーザの名前
1> select user_name() 2> go dbo 1> select user_name(3) 2> go foo
現在ユーザの有効ロール(役割)
1> select show_role() 2> go sa_role sso_role oper_role replication_role