title: How do I run non query sql commands using cx_Oracle?
body: <p>I am trying to run these commands using cx_oracle:</p>
  
  <pre><code>begin
  add_command_pkg.add_command
  (  command_id    =&gt; 7,
     expiry_time   =&gt; sysdate + 7
   );
  
  add_command_pkg.add_command
  (  command_id    =&gt; 12,
     expiry_time   =&gt; sysdate + 7
   );
  commit;
  end;
  </code></pre>
  
  <p>So this is my Python code:</p>
  
  <pre><code>dsn = cx_Oracle.makedsn(hostname, port, sid)
  orcl = cx_Oracle.connect(username + '/' + password + '@' + dsn)
  
  curs = orcl.cursor()
  cmd = "begin \n\
         add_command_pkg.add_command \n\
         (  command_id    =&gt; 7, \n\
            expiry_time   =&gt; sysdate + 7 \n\
         ); \n\
         \n\
         add_command_pkg.add_command \n\
         (  command_id    =&gt; 12, \n\
            expiry_time   =&gt; sysdate + 7 \n\
         ); \n\
         commit; \n\
         end;"
  
  curs.execute(cmd)
  orcl.close()
  </code></pre>
  
  <p>When I run this code, I get this error: </p>
  
  <blockquote>
    <p>cx_Oracle.InterfaceError: not a query</p>
  </blockquote>
  
  <p>So how do I run these sql commands that aren't queries using cx_oracle?</p>
  
  <p>Edit:</p>
  
  <p>After making changes this is what I have now:</p>
  
  <pre><code>            curs.callproc('add_command_pkg.add_command', [],
                            { 'command_id' : 7,
                              'session_id' : 'null',
                              'p_expiry_time' : 'sysdate + 7',
                              'config_id' : 6 })
  </code></pre>
  
  <p>When I run this, I get this error:</p>
  
  <blockquote>
    <p>File "N:\App\MainWidget.py", line 456, in myFunc<br>
        'config_id' : 6 })<br>
    cx_Oracle.DatabaseError: ORA-01858: a non-numeric character was found where a numeric was expected<br>
    ORA-06512: at line 1</p>
  </blockquote>
  
  <p>Also, how do I commit this?</p>