Can I send a CREATE TABLE statement to SQL DBs via the dataiku Python package?

akshaykatre
akshaykatre Registered Posts: 4 ✭✭✭✭

Hi everyone,

I'm trying to launch a create table query onto a SQL DB and I want to use the Dataiku Python API package to do that;

I tried the following:

executor = SQLExecutor2(connection=cInfo['connectionName'])
x = executor.query_to_df('create table X(var1 int); select 1 as ready;')

I couldn't find a method in the package that let me run a query on a server without expecting a return value.

I'm looking for something on the lines of execute with the pyodbc python package, if its available.

Thanks in advance,

Akshay

Tagged:

Answers

  • Marlan
    Marlan Neuron 2020, Neuron, Registered, Dataiku Frontrunner Awards 2021 Finalist, Neuron 2021, Neuron 2022, Dataiku Frontrunner Awards 2021 Participant, Neuron 2023 Posts: 321 Neuron

    Hi @akshaykatre
    ,

    Yes, this is possible. An approach similar to what you propose worked for me on a couple of different SQL platforms. More information in this post.

    Marlan

Setup Info
    Tags
      Help me…