Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat are sql function possible positions in sql statement?
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COWhat are you using to validate the user input (and where)? is this just in a stored procedure (or something) and you're building a dynamic query or...? and when you say "sql function" do you mean absolutely no functions? like they can't use `datepart` or anything like that? can you give examples of what valid and invalid input look like?
      singulars
    2. COI'm not sure how you could check that exactly.... "`I am typing(text)`" would be valid if `typing` is not a function. To get a list of all user defined functions you can do something like `SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_TYPE = 'FUNCTION'` and use that to compare but I'm not sure how you could check for system functions (like `datepart` or something) without hardcoding them. Or -- (_risky unless you're sure the input is safe_), you could try to run the input and see if the value changes... if it does, a function might have been used.
      singulars
    3. CO@gloomy.penguin, I write C# to understand sql statement(this is the input), if there is any sql function in it, the input sql statement is not valid. In order to detect where are the sql functions in a sql statement, I have to know its possible positions in SQL statement first (like, in SELECT clause, or FROM clause, or any other positions)
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload