create order db-function