Skip to main content

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?

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?


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