How to Print Output Return Value of Stored Procedure into Job Log

ankitmahato
ankitmahato Registered Posts: 11 ✭✭✭✭
edited July 16 in Using Dataiku

Hi,

Below is my code which reads the name of the dataset and prints it. Then it executes a Stored Procedure and prints the returned value. Somehow it is not reflecting in the generated log. Kindly suggest how to do so.


import dataiku
from dataiku.customrecipe import *

# Import the class that allows us to execute SQL on the Studio connections
from dataiku.core.sql import SQLExecutor2

# Recipe inputs
main_input_name = get_input_names_for_role('main')[0]
tblancovatest = dataiku.Dataset(main_input_name)

executor = SQLExecutor2(dataset=tblancovatest)
print main_input_name
ancova_run = executor.query_to_df("Exec SP_ANCOVA('"+main_input_name+"', 'GroupID', 'XVAL', 'YVAL', 0.05)")

# Recipe outputs
print ancova_run

Tagged:
Setup Info
    Tags
      Help me…