Ubuntu で次のテスト プログラムを実行して、インスタント クライアント OCCI ライブラリを使用して Oracle データベースに接続しようとしています。
#include <iostream>
#include <occi.h>
using namespace oracle::occi;
int main() {
Environment *env = Environment::createEnvironment(Environment::DEFAULT);
Connection *conn = env->createConnection( "user", "1234" );
env->terminateConnection(conn);
Environment::terminateEnvironment(env);
}
コンパイル時にエラーはありません
g++ main.cpp -L ~/instantclient_12_2 -locci -lclntsh -I ~/instantclient_12_2/sdk/include
しかし、実行すると取得します
terminate called after throwing an instance of 'oracle::occi::SQLException'
what(): ORA-24960: the attribute OCI_ATTR_USERNAME is greater than the maximum allowable length of 255
Aborted
Ubuntu 16.04、gcc 5.4.0 を実行していますが、インスタント クライアント 11.2 および 12.2 でも同じ結果が得られます。
これは以前に尋ねられました: https://stackoverflow.com/questions/40022118/ora-24960-the-attribute-oci-attr-username-is-greater-than-the-maximumしかし、答えは Linux には当てはまりません (または私は要点を逃しています)。
どんな助けでも大歓迎です。