В coldfusion, queryExecute() могу ли я использовать структуру JSON с {} и: для 2-го параметра 'params' типа структуры struct. Каковы плюсы и минусы?
Я борюсь с двумя синтаксисами холодного слияния. Пожалуйста помоги..!!
QueryExecute(sql, параметры, параметры);
Обычный синтаксис:
sqlEmployees = "SELECT * FROM Employees
WHERE empid = :empid
AND country = :country";
sqlParamsEmployees.empid = { value = 1, cfsqltype = "cf_sql_integer", "null": "yes"};
sqlOptionsEmployees = {dataSource = "#DSN_new#", maxRows = "10", returnType = "json/struct"};
qEmployees = queryExecute(sqlEmployees, sqlParamsEmployees, sqlOptionsEmployees);
Предлагаемый синтаксис:
sqlEmployees = "SELECT * FROM Employees
WHERE empid = :empid
AND country = :country";
sqlParamsEmployees.empid = {
"value": 1,
"cfsqltype": "cf_sql_integer",
"null": "yes"
};
sqlOptionsEmployees = {
"dataSource": "#newDS#",
"maxRows": "10",
"returnType": "json/struct"
};
qEmployees = queryExecute(sqlEmployees, sqlParamsEmployees, sqlOptionsEmployees);
Может ли кто-нибудь помочь, что лучше и почему?
Спасибо.
я попробовал оба синтаксиса купить, почему я должен использовать один над другим. Какая рекомендация и почему?