mod query to avoid problem in escaping using "?"
set cachePath in case it's is not set in configuration
removed two NOT NULL limit due the fact that source DB has NOOL values