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

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

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

0 Kudos
0 Replies

Labels

?
Labels (3)
A banner prompting to get Dataiku