メインコンテンツへスキップ
Data Explorer は次のような場合に有用です:
  • データソースが正しく接続されているかどうかを確認する
  • データソースで利用できるカラムとデータ型を調べる
  • SQL Editor またはQuery Builder を使用して、データソースから特定のデータを検索する
Data Explorer を開くと、インターフェースの左側にナビゲーションペイン、右側にクエリエディタが表示されます。クエリをQuery Builder で作成するか、SQL Editor で作成するかを選択します。Build Query をクリックすると、Query Builder がクエリを作成する手順をガイドします。SQL Editor をクリックすると、シンプルなSQL エディタが表示されます。
Data Explorer
データエクスプローラーでは、いつでも右側のHome タブをクリックして、Query Builder とSQL Editor のどちらかを選択できます。プラスボタンをクリックして、任意の新しいタブ(Query Builder またはSQL Editor)を追加することもできます。タブのタイトルには、クエリがQuery Builder クエリであるか、SQL Editor クエリであるかが表示されます。 You can use the search bar to search for connections. Once you are within a connection, you can use the search bar to search for schemas and tables. At any time in the Data Explorer, you can click the Home tab on the right side to choose between Query Builder and SQL Editor. You can also click the plus button to add a new tab of your choice (Query Builder or SQL Editor). The tab titles display whether the query is a Query Builder query or a SQL Editor query.

SQL Editor の使用

SQL Editor を使って、クエリを作成・編集・保存することができます。
Query Builder を使用してクエリを作成する手順については、Query Builder を参照してください。

SQL Editor でのクエリの作成

Data Explorer でSQL Editor を使用してクエリを実行するには、次の手順に従います:
1
コネクションまたはワークスペース内のテーブルまたはビューを選択するか、保存済みクエリまたはDerived View を選択します。利用可能なすべての項目が左のカラムに表示されます。
  • 実線のテーブルアイコンは、テーブルを示します。
  • 破線の四角いアイコンは、ビューを示します。
  • アイテムの右側にある青い二重ドキュメントアイコンは、アイテムがキャッシュされていることを示します。詳しくは、Caching を参照してください。
2
Choose the data that you want to query.
  • To view the SQL query for an entire table or view, click that table or view. Alternatively, click the three dots next to the table or view and select Open. The SQL query appears on the right. Column details appear below the SQL query. This query is read-only until you execute it.
  • Click the three dots next to the table or view and select Query to create a new query based on the table or view. You can edit the query before you execute it.
  • Some data source types contain SQL templates for commonly-used queries. These queries appear under Common Queries when you expand the connection name. Click the three dots next to the query name and click Query to view the query. You can edit the query, if needed, before you execute it.
Alternatively, you can enter a query manually by clicking the + sign in the tab bar and selecting SQL Editor. Use SQL syntax in the SQL Editor. Connect AI has an autocomplete feature to assist you with SQL syntax.
SQL syntax help
SQL Editor は接続、スキーマ、およびテーブル名もオートコンプリートします。接続を選択すると、オートコンプリート機能によりドロップダウンリストからスキーマを選択できます。次に、スキーマ内のテーブルを選択します。
Autocomplete
3
Limit フィールドに、返したい結果の数を設定します。デフォルトではリミットは100です。リミットは自由に設定できますが、このフィールドには必ず値を入力してください。(SQL LIMIT 句は使用しないでください。)
4
Execute をクリックしてクエリを実行します。クエリを実行すると、Results セクションに読み込み中のアイコンと経過時間が表示されます。読み込み中のアイコンは、クエリのタブにも表示されます。
Processing query
経過時間が5分を超える場合は、CData サポートまでお問い合わせください。
5
クエリの実行が終了すると、クエリエディタの下に結果が表示されます。Details セクションにはクエリによって返されたメタデータが表示され、Results セクションにはクエリによって返されたデータが表示されます。ページ下部のフィールドで、ページをスクロールしたり、1ページあたりの検索結果数を調整したりできます。また、テーブルの詳細および結果のカラム幅を調整することもできます。クエリでエラーが発生した場合、クエリの上にエラーメッセージが表示されます。エラーアイコンは、クエリのタブにも表示されます。エラーの詳細については、Learn More をクリックしてください。
Query error

クエリの編集

After a read-only query executes, a new tab appears with a name such as Query 1. You can then modify the query and save it with a new name.
  • クエリエディタにクエリパラメータを入力し、手動でクエリを変更。
  • Clear を選択し、表示されるプロンプトでOK をクリックしてクエリエディタをクリア。

クエリの保存

Data Explorer では、クエリを保存しておくことができ、後からクエリパラメータを再入力することなくクエリを呼び出すことができます。 クエリを作成し正常に実行すると、Data Explorer ペインの上部にあるSave ボタンが利用可能になります。クエリを保存して後でアクセスするには、以下の手順に従います。
1
Save > Save as Saved Query をクリックします。Save Query ダイアログが表示されます。
2
クエリの名前を入力し、Confirm をクリックします。
3
Data Explorer Saved Queries メニューが開き、新しく保存したクエリがリストに表示されます。
You can also click the down arrow to the right of the query’s tab and select Rename Tab. Rename the query and click Confirm.

保存されたクエリの使用

保存されたクエリは、Data Explorer のナビゲーションペインにあるSaved Queries フォルダから利用でき、保存されたDerived View はDerived Views フォルダで利用できます。保存されたクエリを実行するには、クエリ名の横にある三点リーダー(縦)をクリックし、Query を選択します。保存されたクエリの内容がQuery Editor に入力され、Execute をクリックして結果を取得できます。 三点リーダー(縦)をクリックすると、保存されたクエリの名前を変更したり削除したりすることもできます。

Add to a Workspace

You can use the Data Explorer to add assets to a workspace.
1
Click the table or view you want to add to a workspace. Connect AI calls contents of a workspace assets.
2
Click the three dots next to the asset and select Add to Workspace.
3
Select the workspace to move the asset to and click Confirm.

Derived View の設定

Data Explorer のDerived Views 機能を使用すると、コネクションから動的に入力されたデータ結果を返すクエリを作成して保存できます。保存したDerived View はインテグレーションからクエリでき、コネクション内のデータが変更されると結果が自動的に更新されます。
Derived View を作成または変更できるのはConnect AI の管理者のみです。クエリユーザーは、管理者が作成した保存済みのDerived View をクエリできます。

Derived View の作成

新しいDerived View を作成するには、次の手順に従ってください:
1
Query Builder またはSQL Editor でクエリを作成します。クエリを実行すると、Save ボタンが表示されます。Save > Save as Derived View をクリックします。Create Derived View ダイアログが表示されます。
2
View Name フィールドにDerived View の名前を入力します。これは、保存されたDerived Views のリストに表示される名前です。
3
Confirm をクリックし、Derived View を保存します。

インテグレーションからDerived View へのアクセス

インテグレーションツールからDerived View にクエリを発行する場合、Connection またはDatabase の値をCData に設定します。次の構文は、Derived View にアクセスするための正しい完全修飾構文を示しています:
SELECT * FROM [CData].[DerivedViews].[SampleDerivedView]
上の例の[SampleDerivedView] の値には、Derived View の名前を入れてください。

Data Explorer からDerived View へのアクセス

Derived View を作成すると、Data Explorer のDerived Views のリストに表示されます。リスト内のエントリの横にある三点リーダー(縦)をクリックして、オプションのリストを開くことができます。
Query derived view
  • クエリを実行するにはQuery をクリックします。Derived View の内容がData Explorer のクエリビューに表示され、Execute をクリックしてクエリ結果を表示できます。
  • You can click the three dots next to the derived view and select Open/Edit to change the name of the derived view, or you can click Delete to remove it from the list.

Derived View の編集

Derived View のクエリを編集するには、上記で説明した方法のいずれかを使用してアクセスします。Derived View を開いた状態で、クエリフィールド内のテキストを必要に応じて編集し、Data Explorer 上部のSave Changes をクリックします。 Derived View の名前を変更するには、リスト内のエントリの横にある三点リーダー(縦)をクリックしてRename を選択します。表示されたダイアログに新しい名前を入力し、Confirm をクリックします。

Derived View の削除

Derived View を削除するには、リスト内のエントリの横にある三点リーダー(縦)をクリックしてDelete を選択します。表示される確認ダイアログで、再びDelete をクリックします。
Derived View を削除しても、ソース内のデータには影響ありません。

スケジュールクエリの作成

クエリをスケジュールクエリとして保存できます。スケジュールクエリは、ユーザーが定義した間隔で実行されます。 スケジュールクエリを作成するには:
1
Query Builder またはSQL Editor を使用して、クエリを作成します。
2
Save > Save as Scheduled Query をクリックします。
3
次に、実行頻度など、スケジュールクエリの詳細を入力します。詳しくは、Scheduled Queries を参照してください。

Add to a Workspace

You can use the Data Explorer to add assets to a workspace.
1
Click the table or view you want to add to a workspace. Connect AI calls contents of a workspace assets.
2
Click the three dots next to the asset and select Add to Workspace.
3
Select the workspace to move the asset to and click Confirm.

Add a Cache Job

You can use the Data Explorer to cache the data for a table or view. Caching allows you to fetch cached data from a database instead of retrieving live data, improving performance. See Caching for details. To add a cache job:
1
Click the table or view you want to cache.
2
Click the three dots next to the asset and select Add Cache Job. You are redirected to the Edit Job page.
3
Follow the instructions in Edit a Caching Job.