Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to insert null value into sybase with python

William Wang
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 23, 2025

How to handle Sybase table with null value in Python

create table Account(

accountId varchar(12) not null,

rollup_indicator  char(1) null

)

when need to insert one row as ('038C08234', null)  (roolliup_indicator has null value)

sql= "insert into Account(accountId, rollup_indicator)  values(?, ?) "

in Python, when detect a value is None, we can't pass None to the sql statement, and there is no NULL variable, if pass 'NULL'  string as rollup_indicator value, the insert will not take effect, since rollup_indicator is char(1), 'NULL' is 4 characters.

I am  using sybpydb module and execute with cursor

cur.executor(sql, ('038C08234', 'NULL'))

 

Anyone has experienced  with inserting/updating null value in Python Sybase?  Thanks,

Bill  

 

 

1 answer

0 votes
Trudy Claspill
Community Champion
July 23, 2025

Hello @William Wang 

Welcome to the Atlassian community.

This specific forum is a location for questions concerning the Confluence product from Atlassian.

Can you clarify how your question relates to the Confluence product?

Assuming the answer is that your question does not relate to Confluence, you may want to look elsewhere for assistance.

For instance, I used Google to search for insert null value in sybase with python and got several answers in the results which might prove useful (if I was familiar with sybase).

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
ENTERPRISE
TAGS
AUG Leaders

Atlassian Community Events