I have the following 2 chunks. Once the first chunk gets executed in python it seems to me that it takes time for the stored procedure to execute in sql. Before that is done, however, python moves immediately to next chunk. Is it possible to delay running of the next chunk by say 5 minutes?
JavaScript
x
11
11
1
gmd_connection.autocommit=True
2
3
# create cursor
4
cursor = gmd_connection.cursor()
5
6
query='EXEC sm.spSecuritiesCreate'
7
8
cursor.execute(query)
9
# close cursor
10
cursor.close()
11
JavaScript
1
13
13
1
# create cursor
2
cursor = gmd_connection.cursor()
3
4
query='EXEC sm.spSolsteinSecuritiesMap'
5
6
cursor.execute(query)
7
8
# close cursor
9
cursor.close()
10
11
#close connection
12
gmd_connection.close()
13
Advertisement
Answer
I’m not sure if Jupyter supports this directly, but you can just add time.sleep(n)
as the first line in the block you want to have a delayed start. Here’s the reference.