1. A programmable controller comprising: a processor which executes multiple commands in a user program other than a last END command in order and that after the END command is executed by the processor, executes the commands of the user program again in order; a memory which stores a database that holds data used in a process performed by the processor in a table format; wherein, when the commands include a command to access the database, the processor is further configured to convert the access command into a database query command described in a database query language, to access the database in the memory and to acquire data specified by the database query command; wherein, after the commands in the user program are executed by the processor, the processor is further configured to execute the END command including a process of acquiring the result of executing the database query command, wherein, when a process corresponding to the database query command issued is completed, the processor performs a completion checking process of writing the data acquired by the processor in an address specified by the command to access the database of a user-data storage, and wherein, when the process corresponding to the database query issued is not completed, the processor is configured to further perform the completion checking process at a time of executing a next END command.