cdb2sqlcode

sqlca.sqlerrm.sqlerrmc SQL code -284


I am using embedded C: the following query returns a strange SQLcode -284

  EXEC SQL
   select  *
   into    :xx
   from    xx
   where ....

if (SQLCODE < 0)
  { 
    err_log( "code %ld sqlerrmc %s",sqlca.sqlerrm.sqlerrml,sqlca.sqlerrm.sqlerrmc);
    db_error("");
    return -1;
  }

the error log was: code 4 sqlerrmc SQL error -284 on line 2803

Could you please support me ?


Solution

  • From the PostgreSQL Web site describing the SQLCA:

    -284 (ECPG_INFORMIX_SUBSELECT_NOT_ONE) A result of the subquery is not single row (Informix compatibility mode). (SQLSTATE 21000)

    I found this within two minutes of googling "PostgreSQL embedded sql -284". I'd suggest you make more of an effort to find primary documentation such as this over asking the question on SO.