Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

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

asked 22 Jun '20, 07:47

SimonT's gravatar image

SimonT
11113
accept rate: 0%

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.

(22 Jun '20, 08:35) Chris Keating

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

(22 Jun '20, 08:41) SimonT
Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×128
×21

question asked: 22 Jun '20, 07:47

question was seen: 644 times

last updated: 22 Jun '20, 08:42