[Feature Request] SQL strings
See original GitHub issueIt would be great if the syntax highlighter could detect SQL in strings like it does for queryExecute(). I frequently break out my SQL statements from queryExecute(), and form them in a string before calling the function. For example:
public query function someSQL(someArg, ID){
var sql = '';
var params = {};
if(ARGUMENTS.someArg == 'all') {
sql &= 'SELECT * FROM someTable';
} else if(ARGUMENTS.someArg == 'name'){
sql &= 'SELECT name FROM someTable';
}
sql &= 'WHERE ID = :ID'
params.ID = { value = ARGUMENTS.ID, sqltype = "INTEGER"};
return query = queryExecute(sql, params, {datasource = DSN});
}
I don’t know how many people program like this, but if there was some reg ex that could detect either ‘sql =’ or ‘sql &=’ before a string, and then treat the string as SQL, it would help quite a bit. Thanks!
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
The Top 10 Feature Requests for SQL Server on Connect ...
The Top 10 Feature Requests for SQL Server on Connect.Microsoft.com · 1. Please fix the “String or binary data would be truncated” message...
Read more >[feature request] option to save sql chunk to a string #1441
SQL chunks have the nice feature of syntax highlighting, but as far as I know they only offer the option to save the...
Read more >Using SQL String Functions to Clean Data - Mode Analytics
This lesson of the SQL tutorial for data analysis covers SQL string functions to clean data strings and fix date formats.
Read more >String Functions (Transact-SQL) - SQL Server - Microsoft Learn
All built-in string functions except FORMAT are deterministic. This means they return the same value any time they are called with a specific ......
Read more >SQL SERVER - Connect Item - Vote for Feature Request ...
At both the times, I have put forth one request to the product team regarding implementing of function Trim(). As per my opinion,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Adding those seems fine to me.
@jcberquist Would it be reasonable to add a couple more triggers? For consideration, it would be nice to have “TRUNCATE TABLE” and “BULK INSERT”. I’m not sure how many others would benefit from this, though I have some sections where this would apply for me.