As a comment says, the job(...)
part is a function (or class) call -- whatever is returned from that call also gets returned from this return
statement.
Let's assume it's a tuple. What if "the user didn't enter anything in jreg
" -- well then, depending on a lot of code you're not showing us, that could be a runtime error (name jreg
being undefined), an empty string or other initial default value never altered, or None
; in the latter case that would indeed eventually become a NULL
in the DB (if acceptable per the DB schema, of course -- otherwise, the DB would reject the insert attempt).
Once you DO finally have a correct and proper tuple T
that you want to insert,
`mycursor.execute('INSERT INTO sometable VALUES(?, ?, ?, ?, ?, ?)', T)
is going to be close to the syntax you want -- if T
has six items (and sometable
has six columns, of course). Each ?
is a placeholder and gets replaced with the corresponding item. mycursor
will need to be an instance of Cursor, presumably obtained by some earlier call to myconnection.cursor
where myconnection
is an instance of Connection, built by the proper call to connect
from the DB API module you're using with the right argumentrs.
If you show us about 100 times more code and DB schemas and tell us exactly WHAT you're trying to accomplish, we, collectively speaking, could no doubt be MUCH more useful and specific -- but based on the sub-epsilon amount of info you supply that's about as much as we, collectively speaking, can offer;-).