57011 in DB2 yesterday I wrote a very waste of code SQL code create procedure batch_cargo () language SQL begin declare in_date date; declare his_date date; declare p_tj_date varchar (8 ); declare p_his_date varchar (8); declare p_tj_year varchar (4); declare p_tj_month varchar (2); declare p_tj_day varchar (2); declare p_his_year varchar (4 ); declare p_his_month varchar (2); declare p_his_day varchar (2); set in_date = current date-1 da Y; set his_date = current date-10 day; set p_tj_year = trim (char (year (in_date); set p_tj_month = case when month (in_date) <10 then '0' | trim (char (month (in_date) else trim (char (month (in_date) end; set p_tj_day = case when day (in_date) <10 then '0' | trim (char (day (in_date) else trim (char (day (in_date) end; set p_tj_date = p_tj_year | p_tj_month | p_tj_day; set p_his_year = trim (char (year (hi S_date); set p_his_month = case when month (his_date) <10 then '0' | trim (char (month (his_date ))) else trim (char (month (his_date) end; set p_his_day = case when day (his_date) <10 then '0' | trim (char (day (his_date ))) else trim (char (day (his_date) end; set p_his_date = p_his_year | p_his_month | p_his_day; insert into t_test_proc values (p_tj_date, p_his_date ); when the end @ process is executed, the system prompts that the application heap is not enough. SQLSTATE = 57011 Later, we modified the two parameters SORTHEAP and APPLHEAPSZ, and then it went normal.
The following figure shows the parameter description for the database heap (4 kb) (DBHEAP) = 1200 utility heap size (4 kb) (UTIL_HEAP_SZ) = 5000 Maximum Application Control Heap size (4 KB) (APP_CTL_HEAP_SZ) = 128 sorting LIST Heap (4KB) (SORTHEAP) = 2500 SQL statement heap (4KB) (sort theap) = 2048 Default Application heap (4KB) (APPLHEAPSZ) = 2048 statistics heap size (4 kb) (STAT_HEAP_SZ) = 4384