title: Cannot insert a null into column — Informix
body: <p>I was working on program for bill generation of vendors where a library program code is called for inserting data into a table t_job that stores records for  some important jobs like purchase order generation etc.</p>
  
  <p>The problem is that this library code for inserting data into a table <code>t_job</code> gets called from many different 4ge programs and from different users but I am facing a peculiar problem for a newly created user.</p>
  
  <p>I am getting an error "Cannot insert a null into column (t_job.username)" for this user.</p>
  
  <p>The program that deals with  inserting data into t_job has some lines of code that I find worth mentioning with regard to the problem.</p>
  
  <pre><code>select username into _user from sysusers where username = user
  
  insert into t_job values(_user,
                           _job_key1,
                           _job_key2,
                           _cd,
                           today,
                           _time)
  </code></pre>
  
  <p>It's driving me nuts why only in this case username for t_jobs is showing as null.</p>
  
  <p>I looked into the sysusers table in sysuser database and found 2 rows there as shown below:</p>
  
  <pre><code>username  informix
  usertype  D
  priority  9
  password
  defrole
  
  username  public
  usertype  C
  priority  5
  password
  defrole
  </code></pre>
  
  <p>Any help in this regard is highly regarded.</p>