0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Oracle データベースの RAWTOHEX と同じ出力結果を PostgreSQL で得る

Posted at

やりたいこと

Oracle データベースの RAWTOHEX と同じ出力結果を PostgreSQL で得たい。

Oracle の出力例

  • Live SQL を使用
  • select RAWTOHEX('あいうえお') from dual
    • 出力結果: E38182E38184E38186E38188E3818A

PostgreSQL での対応

  • select upper(encode(convert_to('あいうえお', 'UTF8'), 'hex'))
    • 出力結果: E38182E38184E38186E38188E3818A
  • 元になる Oracle の環境によって文字コードを切り替える
    • convert_to('あいうえお', 'SJIS') など
  • バージョンは 10.16 で確認
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?