2008年7月20日 (日)

ORA-01722がエラーメッセージマニュアルに記載されていない怪

さて、随分間が空いてしまいましたがしばらくはこんなベースでしょうおそらく。

先日、珍しいオラクルエラーに遭遇している方をフォローしたこともあり案外ハマる方も多いのかなぁ。と思いそんな方々の為の備忘録ということで書いておきましょう。


Oracle11gより前のリリースでも同じ結果になるのでOracleのバージョンはどうでもいいのですが、とりあえず最新ですよ。ということで。

SCOTT> select * from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
PL/SQL Release 11.1.0.6.0 - Production
CORE 11.1.0.6.0 Production
TNS for Linux: Version 11.1.0.6.0 - Production
NLSRTL Version 11.1.0.6.0 - Production

ある方がプロシージャの実行時に以下のようなエラーで悩んでいた。

SCOTT> exec sample1722(10);
Department Name : ACCOUNTING
BEGIN sample1722(10); END;

*
行1でエラーが発生しました。:
ORA-01722: 数値が無効です。
ORA-06512: "SCOTT.SAMPLE1722", 行6
ORA-06512: 行1

続きを読む "ORA-01722がエラーメッセージマニュアルに記載されていない怪"

| | コメント (0) | トラックバック (0)

2008年7月 8日 (火)

iPhone 3G

☆〜〜〜っ。

11

| | コメント (0) | トラックバック (0)

2008年7月 7日 (月)

Oracle Wiki

そういえば、随分前に、Oracle Wikiが立ち上がったって聞いたのでアカウント作ってあったんだっけ。。。(^^;;;, 何時の間にか日本語でもOKになったんだね。

アクセスログを見ていたら、Oracle Wikiからリンクされていたのでびっくり。www.

ありがとうございます。時間があったらWikiにも書き込むか。。


9

| | コメント (2) | トラックバック (0)

2008年6月29日 (日)

Mac de Ruby on Rails - #14 - IntelMac編 #5

さて、準備は整ったのでサンプルを作ってみましょう。利用するのはSCOTTスキーマのemp表。

Macintosh:test discus$ rails -d oracle emp_list
create
create app/controllers
create app/helpers
create app/models
create app/views/layouts
create config/environments
create config/initializers
create db
create doc
create lib

・・・・・・中略・・・・・・

create public/favicon.ico
create public/robots.txt
create public/images/rails.png
create public/javascripts/prototype.js
create public/javascripts/effects.js
create public/javascripts/dragdrop.js
create public/javascripts/controls.js
create public/javascripts/application.js
create doc/README_FOR_APP
create log/server.log
create log/production.log
create log/development.log
create log/test.log
Macintosh:test discus$
Macintosh:test discus$

続きを読む "Mac de Ruby on Rails - #14 - IntelMac編 #5"

| | コメント (0) | トラックバック (0)

2008年6月22日 (日)

Mac de Ruby on Rails - #13 - IntelMac編 #4

前回のつづき旧バージョンが悪さをしているようなのでこの際、残っている古いバージョンをuninstallしてしまえ! ということに。
尚、Leopardでは事前にRoRが/System/Library/Frameworks/Ruby.framework/以下にインストールされている。


Macintosh:test discus$ sudo gem uninstall activerecord --install-dir=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8

Select gem to uninstall:
1. activerecord-1.15.3
2. activerecord-1.15.6
3. activerecord-2.1.0
4. All versions
> 2

You have requested to uninstall the gem:
activerecord-1.15.6
actionwebservice-1.2.6 depends on [activerecord (= 1.15.6)]
rails-1.2.6 depends on [activerecord (= 1.15.6)]
If you remove this gems, one or more dependencies will not be met.
Continue with Uninstall? [Yn] Y
Successfully uninstalled activerecord-1.15.6
Macintosh:test discus$ ruby test.rb
/Library/Ruby/Site/1.8/rubygems.rb:139:in `activate': can't activate activerecord (= 1.15.3), already activated activerecord-2.1.0] (Gem::Exception)
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require'
from /Library/Ruby/Gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/abstract/connection_specification.rb:230:in `establish_connection'
from test.rb:8
Macintosh:test discus$ sudo gem uninstall activerecord --install-dir=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8

Select gem to uninstall:
1. activerecord-1.15.3
2. activerecord-2.1.0
3. All versions
> 1

You have requested to uninstall the gem:
activerecord-1.15.3
actionwebservice-1.2.3 depends on [activerecord (= 1.15.3)]
rails-1.2.3 depends on [activerecord (= 1.15.3)]
If you remove this gems, one or more dependencies will not be met.
Continue with Uninstall? [Yn] Y
Successfully uninstalled activerecord-1.15.3
Macintosh:test discus$ ruby test.rb
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/abstract/connection_specification.rb:232:in `establish_connection': Please install the oracle adapter:
`gem install activerecord-oracle-adapter` (no such file to load -- active_record/connection_adapters/oracle_adapter) (RuntimeError)
from test.rb:8
Macintosh:test discus$
Macintosh:test discus$

お〜〜〜、忘れていました。 oracle_adapter.rbを。

続きを読む "Mac de Ruby on Rails - #13 - IntelMac編 #4"

| | コメント (0) | トラックバック (0)

2008年6月21日 (土)

Mac de Ruby on Rails - #12 - IntelMac編 #3

さて、少々間が空いてしまったがこれから暫くは土日中心に記事をアップすることが多くなるかも。(おチビちゃんの世話などいろいろあるのでね。w 土日に1週間分のネタを時間指定公開しるようにしておいてもよいかもしれないが、そのネタを纏めてる時間がなかなか取れない。く〜〜〜っ。という感じ。)

と長い前置きはこれくらいにして、本題です。前回は、ruby-oci8をインストールしたところまでだった。(自分でも忘れてる。。)
今日は確認のため以前PPC版の時も使ったテストコードでオラクルへアクセスできるか確認しておくことにする。

続きを読む "Mac de Ruby on Rails - #12 - IntelMac編 #3 "

| | コメント (0) | トラックバック (0)

2008年6月15日 (日)

Mac de Ruby on Rails - #11 - IntelMac編 #2

さて、つづきです。ruby-oci8をインストールする。(ruby-oci8は、1.0.0を事前にダウンロードしておいた。尚、本記事を書いている時点では、1.0.1が最新。)

まず、make。

Macintosh:˜ discus$ ll
total 216
drwx------+ 32 discus staff 1088 6 8 23:25 Desktop
drwx------+ 10 discus staff 340 1 3 01:32 Documents
drwx------+ 14 discus staff 476 6 8 23:26 Downloads
drwxr-xr-x 10 discus staff 340 12 19 16:03 Image Browser
drwxr-xr-x 10 discus staff 340 12 19 16:57 Image Kit Browser
drwx------+ 32 discus staff 1088 3 1 14:07 Library
drwx------+ 3 discus staff 102 11 26 2007 Movies
drwx------+ 4 discus staff 136 2 2 11:12 Music
drwx------+ 9 discus staff 306 6 14 05:21 Pictures
drwxr-xr-x+ 5 discus staff 170 11 26 2007 Public
drwxr-xr-x+ 5 discus staff 170 11 26 2007 Sites
drwxr-xr-x 16 discus staff 544 11 25 2007 ruby-oci8-1.0.0
-rw-r--r-- 1 discus staff 107494 3 2 02:27 ruby-oci8-1.0.0.tar.gz
Macintosh:˜ discus$ cd ruby-oci8-1.0.0
Macintosh:ruby-oci8-1.0.0 discus$ make
ruby setup.rb config
---> lib
---> lib/DBD
---> lib/DBD/OCI8
<--- lib/DBD/OCI8
<--- lib/DBD
<--- lib
---> ext
---> ext/oci8
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby /Users/discus/ruby-oci8-1.0.0/ext/oci8/extconf.rb
checking for load library path... (DYLD_LIBRARY_PATH)...
found: /Users/Shared/OracleInstantClient/libclntsh.dylib.10.1 looks like an instant client.
checking for cc... ok
checking for gcc... yes
checking for LP64... no
checking for ruby header... ok
checking for OCIInitialize() in oci.h... no
---------------------------------------------------
error messages:
Could not compile with Oracle instant client.
You may need to set a environment variable:
DYLD_LIBRARY_PATH=/Users/Shared/OracleInstantClient
export DYLD_LIBRARY_PATH

---------------------------------------------------
See:
* http://ruby-oci8.rubyforge.org/ja/HowToInstall.html
* http://ruby-oci8.rubyforge.org/ja/ReportInstallProblem.html

*** /Users/discus/ruby-oci8-1.0.0/ext/oci8/extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=/Users/discus/ruby-oci8-1.0.0/ext/oci8
--curdir
--ruby=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
--with-instant-client
--without-instant-client
/Users/discus/ruby-oci8-1.0.0/ext/oci8/oraconf.rb:941:in `initialize': RuntimeError (RuntimeError)
from /Users/discus/ruby-oci8-1.0.0/ext/oci8/oraconf.rb:236:in `new'
from /Users/discus/ruby-oci8-1.0.0/ext/oci8/oraconf.rb:236:in `get'
from /Users/discus/ruby-oci8-1.0.0/ext/oci8/extconf.rb:6
'system /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby /Users/discus/ruby-oci8-1.0.0/ext/oci8/extconf.rb ' failed
Try 'ruby setup.rb --help' for detailed usage.
make: *** [config.save] Error 1
Macintosh:ruby-oci8-1.0.0 discus$

続きを読む "Mac de Ruby on Rails - #11 - IntelMac編 #2 "

| | コメント (0) | トラックバック (0)

2008年6月14日 (土)

Mac de Ruby on Rails - #10 - IntelMac編 #1

さて、やっと時間ができたので前回Leopard(IntelMac)のRosettaで動作させていたOracle Instant Client 10g R1 10.1.0.3.0 for MacOSX(PPC)からネイディブで動作するOracle Instant Client 10g R2 10.2.0.4.0 for MacOSX(Intel x86)へ入れ替えたのもこれをやるための準備。


Mac OS X 10.5.1 Leopard (Intel x86)にはRuby/Ruby on Railsがインストールされている。やっとx86ネイティブなOracle Instant Client for MacOSX(intel x86)がリリースされたのだからその環境を整えておかないと。。。というのがその理由。

続きを読む "Mac de Ruby on Rails - #10 - IntelMac編 #1 "

| | コメント (0) | トラックバック (0)

2008年6月 8日 (日)

Oracle Instant Client 10g R2 10.2.0.4.0 for IntelMacへ入れ替える

随分前にRosettaを介してOracle Instant Client 10g R1 for PPCがIntelMac上で動作するという記事を書いたが、少々前のこと、やっとIntalMac版Oracle Instant Client 10g R2 10.2.0.4.0 for IntelMacがリリースされたので次のステップへの準備として以前インストールしたPPC版Oracle Instant ClientをIntelMac版に入れ替えておく!

インストール手順などは以前の記事を参考してくださいね。同じですから。

尚、今回は以前のインストールしたPPC版Oracle Instant ClientをIntelMac版と入れ替えるだけなので、PPC版を一旦削除してからIntelMac版のOracle Instant Clientをダウンロード、解凍しただけ。環境変数も以前のままです。

続きを読む "Oracle Instant Client 10g R2 10.2.0.4.0 for IntelMacへ入れ替える"

| | コメント (0) | トラックバック (0)

2008年6月 5日 (木)

なんだ〜 iPhoneが〜

iPhoneがソフトバンクから発売に。。なんだよ〜もう暫く待っとけば良かった〜。922 SHに機種変更したばかりなのに〜。(><) でもいいか、暫くは入手困難な状態かもしれないし。。落ち着いてから考えよう。。。でも実物みたら辛抱できるんだろうか。。。w

F1801p5l

| | コメント (0) | トラックバック (0)

2008年6月 3日 (火)

イタリアから

16

イタリアからアクセスがあるなぁなんて見てみたらリンクされてました。ありがとう。イタリア語分からないけど。

| | コメント (0) | トラックバック (0)

2008年5月16日 (金)

Mac100% 2008 spring

MacOS9のころ作っていたフリーウェアがいろいろな雑誌に掲載された時以来だからかなり久しぶり。
Dashborad de Aquarium v1.1がMac100%で紹介されました。(献本ありがとうございました。)


17

| | コメント (0) | トラックバック (0)

2008年5月 7日 (水)

PL/SQL で Python Challenge Level 18 う〜〜〜ん。

やることは分かったのだがPL/SQLでは重要な部分(pythonなら一発だけど)を手作りしないとならない。。。とりあえず適当に作ってはみたもののまだ思うような結果にはなっていない。。だが、そこさえクリアできればlevel18はPL/SQLだけで解けるはず。。。。。ということで暇を見て実装中。といってもその暇がなかなか取れなくなりそうな予感も。。。まあ、今回のネタはおもしろそうなので、少しづつでも進めて行きますよ。。。w

| | コメント (0) | トラックバック (0)

2008年5月 3日 (土)

少々前のネタで m(_ _)m

Sun Business Next 2008のコミュニティートラックのOpen Solaris関連セッション

Open SolarisってSolarisの良さとUbuntuの良さを合わせ持とうとしているのか〜〜。(自分用の備忘録)

Cimg1037

Cimg1038

Cimg1040

OpenSolars/Solaris Hot Topics セミナー #2なんてのもあるなぁ。行けるようなら参加してみるか。。

| | コメント (0) | トラックバック (0)

2008年4月26日 (土)

Oracle Instant Client 10.2.0.4.0 for MacOSX (Intel x86)

お〜〜〜、ついにというか、やっとでたか〜〜、Oracle Instant Client 10.2.0.4.0 for MacOSX(Intal x86)

これでやっとIntel MacでもRuby on RailsでOracleへアクセスできる〜。

15

| | コメント (0) | トラックバック (0)