Partilhar via


Statement Class

Definition

The Statement class executes a static SQL statement and obtains the results it produces.

public ref class Statement : Microsoft::Dynamics::Ax::Xpp::XppObjectBase
[Microsoft.Dynamics.Ax.Xpp.KernelClass]
public class Statement : Microsoft.Dynamics.Ax.Xpp.XppObjectBase
[<Microsoft.Dynamics.Ax.Xpp.KernelClass>]
type Statement = class
    inherit XppObjectBase
Public Class Statement
Inherits XppObjectBase
Inheritance
Microsoft.Dynamics.AX.KernelInterop.ProxyBase
Statement
Attributes

Remarks

Only one per Statement can be open at any point in time. Therefore, if the reading of one ResultSet is interleaved with the reading of another, each must have been generated by different Statements. Record and field level securities are not enforced on the Statement class. Therefore, make sure you are not exposing data returned to the user without doing explicit security validation. All statement executed methods implicitly close a statement's current ResultSet if an open one exists.

The following example demonstrates the Statement class.

static void example() 
{ 
    Connection Con; 
    Statement Stmt; 
    ResultSet R; 
    SqlStatementExecutePermission perm; 
    str sql = 'SELECT VALUE FROM SQLSYSTEMVARIABLES'; 
    Con = new Connection(); 
    Stmt = Con.createStatement(); 
    perm = new SqlStatementExecutePermission(sql); 
    perm.assert(); 
    R = Stmt.executeQuery(sql); 
    while ( R.next() ) 
    { 
        print R.getString(1); 
    } 
}

Constructors

Statement()
Statement(Connection)
Statement(IntPtr)

Fields

kernelClass (Inherited from XppObjectBase)

Methods

__shouldCallNew(Type) (Inherited from XppObjectBase)
addXppProxyReference(Type, Object) (Inherited from XppObjectBase)
Call(String, Object[], Type[], Object[]) (Inherited from XppObjectBase)
cancelTimeOut(Int32) (Inherited from XppObjectBase)
close()

Releases the database resources of a statement object.

createKernelClass(Object[], Type[], Object[]) (Inherited from XppObjectBase)
equal(XppObjectBase) (Inherited from XppObjectBase)
executeQuery(String)

Executes an SQL statement that returns an instance of the .

executeUpdate(String)

Executes a SQL INSERT, UPDATE, or DELETE statement.

finalize() (Inherited from XppObjectBase)
GetIntPtr()
GetKernelInstanceUniqueId() (Inherited from XppObjectBase)
getLastError()

Retrieves the error code returned by the SQL database backend for the last SQL operation.

getLastErrorText()

Retrieves the error text that is returned by the SQL database backend for the last SQL operation.

getMaxFieldSize()

Returns the current maximum column size limit, if any.

getTimeOutTimerHandle() (Inherited from XppObjectBase)
getXppProxyReference(Type) (Inherited from XppObjectBase)
handle()
IsManagedValid()
kernelhandle()
KernelInstanceDisposed() (Inherited from XppObjectBase)
MakeReflectionCall(String, Object[]) (Inherited from XppObjectBase)
newmethod()
notify() (Inherited from XppObjectBase)
notifyAll() (Inherited from XppObjectBase)
objectOnServer()
Obsolete.
(Inherited from XppObjectBase)
setMaxFieldSize(Int32)

Sets the maximum column size limit.

setTimeOut(String, Int32, Boolean)
Obsolete.
(Inherited from XppObjectBase)
setTimeOut(String, Int32)
Obsolete.
(Inherited from XppObjectBase)
usageCount() (Inherited from XppObjectBase)
VerifyKernelClass() (Inherited from XppObjectBase)
wait() (Inherited from XppObjectBase)
Xml() (Inherited from XppObjectBase)
Xml(Int32) (Inherited from XppObjectBase)

Applies to