Pesquisar

Artigo
· Set. 25 2min de leitura

GROUP BY や DISTINCT クエリで大文字で検索されてしまう場合の対処方法

これは InterSystems FAQ サイトの記事です。
 

何の設定も行なっていない場合、GROUP BYやDISTINCTで指定したフィールドは大文字小文字を区別せずに全て大文字として処理されます。

これはGROUP BYやDISTINCTのグループ化がフィールドに対して定義された照合タイプに基づいて行われ、その文字列照合の既定値がSQLUPPERになっているためです。

以下のドキュメントに説明がある通り、DISTINCT は、フィールドに対して定義された照合タイプに基づいて、文字列値をグループ化します。

大文字/小文字の区別と DISTINCT の最適化

これを変更する方法は、以下の3種類になっています。

(A) %SQLSTRING または %EXACT照合関数を使用する
(B) フィールドの文字列照合を SQLSTRINGに変更する
 また、フィールドにインデックスが設定されている場合には、インデックスの文字列照合も SQLSTRINGに変更する
(C) 管理ポータルで設定を変更する 

※(B)について補足
・文字列照合をEXACTに設定しても動作しますが、一般的にはSQLSTRINGの使用が推奨されています。
・フィールドの文字列照合とインデックスの文字列照合は、同じ設定にすることが推奨されています。

※(C)の設定手順

システム > 構成 > SQL  - (構成設定) 
GROUP BY と DISTINCT クエリでオリジナルの値を結果に返す にチェックを入れる

※この設定変更を有効にするためには、クエリキャッシュの削除が必要です。

 

詳細は、以下のドキュメントをご参照ください。

ドキュメント: GROUP BY

ドキュメント: DISTINCT

Discussão (0)1
Entre ou crie uma conta para continuar
Pergunta
· Set. 24

JDBC経由でのDB接続ができない

IRIS Communityの再インストールを行ったところ

tomcat上で動作するJavaのWEBアプリケーションから

JDBC経由でのDB接続ができなくなりました。

他のSQLクライアントツールからは問題なく接続できていますので

接続情報やDBの起動状態には問題ないと考えています。

解決策をご指導頂ければ幸いです。

 

■環境

IRISバージョン:IRIS_Community-2025.2.0.227.0-win_x64

JDKバージョン:11.0.28

JDBCドライバ:intersystems-jdbc-3.2.0.jar

 

■事前作業

ライセンス有効期限が切れてサービス起動できなくなったため、以下投稿と同様、再インストールを行っています。

https://jp.community.intersystems.com/post/iris%E3%82%A4%E3%83%B3%E3%82%...

ちなみに前回利用したバージョン(IRIS_Community-2024.2.0.247.0-win_x64)では

以下エラー(messages.log)となりサービス起動できなかったため

今回あらたに前述のバージョンをダウンロードし、インストールを行っています。

 

09/25/25-10:45:03:182 (15836) 3 [Utility.Event] Error: Invalid Community Edition license, may have exceeded core limit. - Shutting down the system : $zu(56,2)=$Id: //iris/2024.2.0/kernel/common/src/acmd.c#1 $ 4564 127

 

■tomcatログのエラー抜粋

 

Caused by: java.sql.SQLException: [InterSystems IRIS JDBC] Communication link failure: General error

    at com.intersystems.jdbc.IRISConnection.connect(IRISConnection.java:695)

    at com.intersystems.jdbc.IRISConnection.<init>(IRISConnection.java:156)

    at com.intersystems.jdbc.IRISDriver.connect(IRISDriver.java:47)

    at org.apache.tomcat.dbcp.dbcp2.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:52)

    at org.apache.tomcat.dbcp.dbcp2.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:414)

    at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.validateConnectionFactory(BasicDataSource.java:112)

    at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:628)

    ... 7 more

Caused by: java.sql.SQLException: General error

    at com.intersystems.jdbc.IRISConnection.getServerError(IRISConnection.java:907)

    at com.intersystems.jdbc.IRISConnection.processError(IRISConnection.java:1072)

    at com.intersystems.jdbc.InStream.readMessage(InStream.java:204)

    at com.intersystems.jdbc.InStream.readMessage(InStream.java:183)

    at com.intersystems.jdbc.IRISConnection.connect(IRISConnection.java:610)

    ... 13 more

 

■tomcatのcontext.xml内のデータソース設定

 

    <Resource

        name="jdbc_xxxxxx"

        auth="Container"

        type="javax.sql.DataSource"

        driverClassName="com.intersystems.jdbc.IRISDriver"

        url="jdbc:IRIS://192.168.0.xxxxxx:1972/xxxxxx"

        username="xxxxxx"

        password="xxxxxx"

        maxTotal="10"

        maxIdle="5"

        maxWaitMillis="180000"

        validationQuery="SELECT 1"

        testOnBorrow="true"

        testWhileIdle="true"

        removeAbandonedOnBorrow="true"

        removeAbandonedTimeout="3600"

        logAbandoned="true"

        lifo="false"

    />

 

※上記「xxxxxx」の箇所は実際にはそれぞれ別の文言が記載されています。

※再インストール前は上記接続情報で問題なく接続できています。

7 Comments
Discussão (7)1
Entre ou crie uma conta para continuar
Anúncio
· Set. 24

Autumn Edition: Unlock Exciting New Rewards on Global Masters

Hi Community!

🍂 Autumn Rewards Are Here on Global Masters!

Step into the season with our fresh new rewards - it’s the perfect time to explore the Rewards section and claim your favorites!

Remember, prize availability varies by region, so be sure to check what’s on offer for your location.

Don’t miss out on these seasonal treats!

Not a Global Masters member yet? Join here using your InterSystems SSO credentials.

Discussão (0)1
Entre ou crie uma conta para continuar
Pergunta
· Set. 24

Resending a message automatically every 60 minutes from Business Operations

Our vendor is developing an interface API on their end to capture HL7 data on a Server Port, and they require us to send a pre-defined HL7 Order message for testing every hour until the API is completely operational.

Is it possible to accomplish that in a Business Operation automatically without utilizing a service or process? The BO is a standard TCP/IP connection.

I'm manually sending the message again from the Operations right now. I do not have access to the System Operation to use the Task Manager feature.

3 Comments
Discussão (3)3
Entre ou crie uma conta para continuar
Pergunta
· Set. 24

How to Merge Contents from Multiple Routine Databases into a Common Target Database

I am working on a tool that configures an instance to use a common default routine database across all custom Namespaces. For instances that already have distinct default routine databases for their Namespaces, this would involve a step of merging over all code from the current default routine databases to the new "super" routine database. This should be done in such a way that only merges contents in the default routine database (not mapped databases) and is able to detect/exclude contents that already exist in the target database.

Are there any supported tools/APIs for merging routine database contents to help accomplish this? I should clarify there is no guarantee as to what packages may or may not be present in the default routine databases and no guarantee as to what packages may be mapped from other databases. The goal is to allow a user to run this tool and be able to seamlessly access and run code previously stored in default routine databases from any of their custom Namespaces.

11 Comments
Discussão (11)5
Entre ou crie uma conta para continuar