-sed -i "s|DBNAME|$dbname|g" "$main_path/dbscripts/postgresql/onap-holmes_engine-createobj.sql"
-sed -i "s|DBUSER|$user|g" "$main_path/dbscripts/postgresql/onap-holmes_engine-createobj.sql"
-sed -i "s|DBPWD|$password|g" "$main_path/dbscripts/postgresql/onap-holmes_engine-createobj.sql"
+# if deployed using helm, use the helm-generated configuration file.
+if [[ -d /opt/hemconfig ]]; then
+ cp /opt/hemconfig/onap-holmes_engine-createobj.sql "$main_path/dbscripts/postgresql/onap-holmes_engine-createobj.sql"
+else
+ sed -i "s|DBNAME|$dbname|g" "$main_path/dbscripts/postgresql/onap-holmes_engine-createobj.sql"
+ sed -i "s|DBUSER|$user|g" "$main_path/dbscripts/postgresql/onap-holmes_engine-createobj.sql"
+ sed -i "s|DBPWD|$password|g" "$main_path/dbscripts/postgresql/onap-holmes_engine-createobj.sql"
+fi