Skip to main content
Solved

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

  • November 12, 2023
  • 2 replies
  • 83 views

Forum|alt.badge.img

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?

Best answer by Ankit Singh

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?

This topic has been closed for replies.

2 replies

Ankit Singh
Forum|alt.badge.img+1
  • Employee
  • Answer
  • November 13, 2023

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?


Forum|alt.badge.img
  • Author
  • Collaborator
  • November 28, 2023

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