Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As a comment says, the <code>job(...)</code> part is a function (or class) call -- whatever is returned from that call also gets returned from this <code>return</code> statement.</p> <p>Let's assume it's a tuple. What if "the user didn't enter anything in <code>jreg</code>" -- well then, depending on a lot of code you're not showing us, that could be a runtime error (name <code>jreg</code> being undefined), an empty string or other initial default value never altered, or <code>None</code>; in the latter case that would indeed eventually become a <code>NULL</code> in the DB (if acceptable per the DB schema, of course -- otherwise, the DB would reject the insert attempt).</p> <p>Once you DO finally have a correct and proper tuple <code>T</code> that you want to insert,</p> <pre><code>`mycursor.execute('INSERT INTO sometable VALUES(?, ?, ?, ?, ?, ?)', T) </code></pre> <p>is going to be close to the syntax you want -- if <code>T</code> has six items (and <code>sometable</code> has six columns, of course). Each <code>?</code> is a placeholder and gets replaced with the corresponding item. <code>mycursor</code> will need to be an instance of Cursor, presumably obtained by some earlier call to <code>myconnection.cursor</code> where <code>myconnection</code> is an instance of Connection, built by the proper call to <code>connect</code> from the DB API module you're using with the right argumentrs.</p> <p>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;-).</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload