Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Creates a Statement object that is used to execute an SQL statement.
Syntax
public Statement createStatement([ResultSetType resultSetType, ResultSetConcurrency resultSetConcurrency])
Run On
Server
Parameters
- resultSetType
Type: ResultSetType Enumeration
A ResultSetType enumeration that specifies ForwardOnly by default.
- resultSetConcurrency
Type: ResultSetConcurrency Enumeration
A ResultSetConcurrency enumeration that specifies ReadOnly by default.
Return Value
Type: Statement Class
A data type value that is a new Statement object.
Remarks
There is risk of an SQL injection threat when you use the createStatement method to create an SQL statement and then allow a user to control input to the statement. For information about SQL injection, see https://go.microsoft.com/fwlink/?LinkId=114986.
You can use Query Elements in the AOT, views, and X++ Select statements as safer alternatives to executing SQL statements.