cancel
Showing results for 
Search instead for 
Did you mean: 

This routine can be called only if the command structure is idle.

0 Kudos
916

When running an insert statement using params in Python. I get the below error when one of the params has a value of None. I was under the assumption that this should be auto translated to NULL using the sybase module? If I remove the param that is set to None the entire row inserts correctly.

Exception Sybase.DatabaseError: DatabaseError('Layer: 1, Origin: 1\\nct_cmd_drop(): user api layer: external error: This routine can be called only if the command structure is idle.',) in <bound method="" cursor.__del__="" of="" cursor(48503624)=""> ignored Exception Sybase.DatabaseError: DatabaseError('Layer: 1, Origin: 1\\nct_cmd_drop(): user api layer: external error: This routine can be called only if the command structure is idle.',) in <module 'threading'="" from="" '="" usr="" lib64="" python2.7="" threading.pyc'=""> ignored

chris_keating
Product and Topic Expert
Product and Topic Expert
0 Kudos

Are you connection to SQL Anywhere or to Adaptive Server Enterprise (ASE)? This error appears to be a CTLib based error. If this is for ASE, you may want to raise this question in a forum that is ASE based.

The error, based on a search (not knowledge), can occur if the application has not completely processed the result set by calling ct_fetch as long as ct_fetch continues to indicate that rows are available. I am not sure how that translates into python call sequence.

0 Kudos

Adaptive Server Enterprise/16.0 SP03. I'll try elsewhere, as I'm not sure what I am doing wrong.

Accepted Solutions (0)

Answers (0)