Solved

Is "CREATE TABLE" supported with Cdata JDBC Drivers for NoSQL database?

  • 12 November 2023
  • 2 replies
  • 52 views

Userlevel 3
Badge

I have looked at the document: https://cdn.cdata.com/help/EEJ/jdbc/pg_overview.htm for Elasticsearch but create table statements could not be found here.
So it means Cdata does not support SQL-like create table statement? Is there any way I could create index (Elasticsearch) or collections (MongoDB) with JDBC driver?

icon

Best answer by Ankit Singh 13 November 2023, 11:43

View original

2 replies

Userlevel 5
Badge +1

Hi @quangdutran809 

While the CREATE statements are not supported as such due to the limitations for certain source APIs, you can still execute stored procedures to complete any action on the source API. 

For example, with ElasticSearch JDBC Drivers, you can use Create Index stored procedure to create an index with specified settings. The input parameters can be applied within the EXECUTE statement like:

EXECUTE CreateIndex Index = 'firstindex', Alias = 'search', NumberOfShards = '3’


Can you give this a try and see if it helps?

Userlevel 3
Badge

Hi @quangdutran809 

While the CREATE statements are not supported as such due to the limitations for certain source APIs, you can still execute stored procedures to complete any action on the source API. 

For example, with ElasticSearch JDBC Drivers, you can use Create Index stored procedure to create an index with specified settings. The input parameters can be applied within the EXECUTE statement like:

EXECUTE CreateIndex Index = 'firstindex', Alias = 'search', NumberOfShards = '3’


Can you give this a try and see if it helps?

Oh yes, the idea of running procedure could probably work. Thanks Ankit

Reply